Question

I am using Delphi XE4 and Report Builder 15. I have to change all the fonts in the report builder to Verdana. I am facing one issue while dealing with fraction values in the report. Following is my code sample:

var
AppFont: TLogFont;
....
....

AppFont.lfFaceName := 'Times Fraction';

It can show 1/2, 3/4 etc. in my reports. I have to change all the fonts in the reports to Verdana. When I changed above line as:

AppFont.lfFaceName := 'Verdana';

All the fraction values in the report started showing some garbage values.

Does Verdana support fractions? Please suggest.

Was it helpful?

Solution

Unicode has a range of code points to represent vulgar fractions. For instance VULGAR FRACTION ONE HALF (U+00BD). This character has a perfectly decent glyph in the Verdana font that ships with Windows. And there are many other common vulgar fractions defined in the Unicode standard.

What I suspect you are doing is using a special font that contains fraction glyphs in code points that are not specified to contain fractions according to the Unicode standard. When you choose to do this you are committing yourself to use that font alone. That is a bad move. Where possible, stick to standards.

So I suggest that you stop using Times Fraction and stick to Unicode fonts using the Unicode code points for vulgar fractions.

Of course, if you need fractions that are not in the Unicode standard, then you need a different solution, one that does not attempt to use single glyphs from Verdana!

OTHER TIPS

Does Verdana support fractions? Yes, it is completely support expressions like 1/2 1/3 etc. Check you another settings.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top