|
setDefaultFonts vs. setFontStyle |
Posted by Michael Opitz on Jan-14-2014 22:55 |
|
Hi Peter,
i have a question regarding setDefaultFonts(..) vs. setFontStyle(...):
I am using ChartDirector for java.
The problem is, that I need to display japanese / korean / chinese characters with a composite font. Unfortunately, the composite font is self-created and consist of several fonts, but chart director uses only the base font which can not display the japanese characters.
I tried to set the default fonts with setDefaultFonts, but it does not work. I assume that is because I set the base font only to all sorts of text components (titles, labels, legends, etc.) individually.
My question is: Is there a fallback, that chart director uses the DefaultFonts, if the one, which is used for axis titles, axis labels and all sorts of text boxes can not render the text, or do I have to set the font list to every text box individually?
Example:
BaseChart c = new XYChart(200,200);
c.setDefaultFonts("Segoe UI;MS UI Gothic");
TextBox tb = c.addText(10, 10, "フォントの設定対象");
tb.setFontStyle("Arial Bold")
Which font will be used for "フォントの設定対象"? "Arial Bold" or "MS UI Gothic"?
Regards,
Michael |
Re: setDefaultFonts vs. setFontStyle |
Posted by Peter Kwan on Jan-15-2014 05:38 |
|
Hi Michael,
For your example code, the font "Arial Bold" will be used. If you would like to use
setFontStyle, and you need to have fallback fonts, you would need to include the fallback
fonts in the setFontStyle (eg. by appending them to "Arial Bold").
The setDefaultFonts are the fonts used if you do not specify the font using setFontStyle. If
you specify a font using setFontStyle, the font in setFontStyle will always be used instead
of the default fonts.
Regards
Peter Kwan |
|