When I try to load an otf font, the terminal generates an exception.
I did not know I should use the PostScript font name. I was using the names with which the font is recognized by the system.The reason we used the PostScript name in the FontCache lookup, is because the Family Name doesn't supply enough information to extract the exact TTF or OTF file you want. Note that you have one font file for each font attribute (Regular, Bold, Italic, Bold+Italic etc). So if we only used the Family Name, the FontCache would have had to return a list of TTF or OTF files. Not what we normally wanted. That is also why the Find() method has the parameter name APostScriptName, to try and make it clearer to the developer.
One more question. I am having difficulty understanding the value returned by ItalicAngle property.
But FontForge warns that the italic angle to this font is -16.33.I'm not 100% sure why FontForge is complaining. Maybe because it is using a floating point? Instead of -16. I've reviewed about 10 italic fonts and all use a LongInt range, not floating points. But then that's just 10 fonts I sampled out of hundreds of thousands of fonts out there. I'll look into ItalicAngle a bit more.
Fixed --> 32-bit signed fixed-point number (16.16)
It would be interesting to replace the longword type for a single type (or Double)?This has been fixed in FPC Trunk as commit r34060.
Why an integer type was used?
What will be the type of Free Pascal data that most fits the definition of Fixed shown on the Microsoft website?One also needs to take into account if the fixed point data type is signed or unsigned. The 'Fixed' data type used by TTF's ItalicAngle is a Signed Fixed Point 16.16, thus in Object Pascal you have to use a Int32 data type, and that is what I've done.
For convenience, I've also modified the TTFFileInfo.ItalicAngle() function which returns the ItalicAngle value as a Single data type. So this is probably what you would want to use.