Forum > LazUtils

[LazFreeType] How to read information from a font file?

(1/2) > >>

felipemdc:
It would be great to have an example on that, thanks

zeljko:
I guess that such code exists in fontconfig source.

felipemdc:
But LCL-CustomDrawn uses non-native text in multiple operating systems where fontconfig does not exist (Windows, Mac OS X, Android). I was hoping that circular would know the answer.

felipemdc:
Ok, so I will answer my own question. Guiliano Colla found out how to do this and he sent me a patch, and here it is:

http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/lcl/interfaces/customdrawn/customdrawnproc.pas?root=lazarus&r1=35879&r2=35878&pathrev=35879

I think that the most important part is:

TT_Get_Name_String(AFace,J,NameString,NameLen);

Which is part of LazFreeType. But in general the entire routine there is a nice example of how to extract font information with LazFreeType

zeljko:
I didn't mean that you'll use fontconfig, but to see in source how it is extracted.

Navigation

[0] Message Index

[#] Next page

Go to full version