|
Font Size |
Posted by Philippe on Apr-14-2009 18:04 |
|
Hi,
I have an applet where i use ChartDirector Component and Swing Component
Arial Font Size 30 is different on screen with Swing component and ChartDirector Component ?
Do you have an idea ?
Regards
Philippe |
Re: Font Size |
Posted by Philippe on Apr-14-2009 22:30 |
|
Hi,
On my screen an Arial Bold Font Size 30 into an swing component like an JLABEL, has not same size of chartdirector component with line addText(100,60,"MAXI","Arial Bold",30,Chart.TextColor,Chart.Center)
Regards
Philippe |
Re: Font Size |
Posted by Peter Kwan on Apr-15-2009 02:31 |
|
Hi Philippe,
Because ChartDirector is designed to create charts to be viewed using common desktop operating systems (eg. Windows, Mac OS X, Linux, etc), so its font size is consistent with the operating system. For example, a 30 point Arial Bold font in ChartDirector should be the same size as a 30 point Arial Bold font in an HTML web page (assuming the Windows display properties are configured to use standard font size, not "magnified" font size), or in any common desktop applications. If ChartDirector is used to generate a chart and the chart is inserted in a web page, its font size will be consistent to that of the web page.
On the other hand, Java is designed to be hardware and OS independent, and its font size may not be compatible with the desktop OS.
If I remember correctly, to make Java consistent with the OS, you need to multiply the Java font size by 1.333. So to be consistent with a 30 point Arial Bold used on a web page, the Java Applet should use 40 as the font size. This should make it consistent with the web page and the OS, and with ChartDirector.
If the above still does not solve the problem, is it possible to provide a screen shot so I may see exactly what is the size of a 30 point Arial font in Java and in ChartDirector?
Regards
Peter Kwan |
Re: Font Size |
Posted by Philippe on Apr-15-2009 16:17 |
|
Hi,
I attch an word file with screenshot and source code
Regards
Philippe
|
Re: Font Size |
Posted by Peter Kwan on Apr-15-2009 18:10 |
|
Hi Philippe,
After analysing your screen shot, it seems the font size used by ChartDirector is correct.
To check, please try the following web page:
<html>
<body>
<div style="font-family:Arial;font-weight:bold;font-size:30pt">MAXI</div>
<img src="myMAXIChart.jsp">
</body>
</html>
In the above, myMAXIChart.jsp is the JSP script that uses ChartDirector to create the MAXI text.
You can compare the MAXI test as created by the browser, to the MAXI text as created by ChartDirector. If they are of the same size, it proves the ChartDirector text is correct.
If the ChartDirector text is correct, you may want to modify your Applet, because it is inconsistent with the text size of the browser.
Hope this can help.
Regards
Peter Kwan |
|