[Lazarus] fpTTF: TFPFontCacheItem properties aren't loaded from font

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Wed Apr 13 18:30:40 CEST 2016


On 2016-04-13 17:02, Ondrej Pokorny wrote:
> Can a TTF file embed font with various styles?

No, not that I'm aware of. Each style is a different TTF file.


> IMO the file should be read in TFPFontCacheItem.Create and the 
> properties should be set accordingly. Furthermore the properties should 
> be read-only as well.

You are correct on both counts. You are welcome to make that change.


On a side note:
  My initial thinking was that the TFPContCacheItem could manage
multiple TTF files of the same FamilyName. eg: Ubuntu-Regular.ttf,
Ubuntu-Bold.ttf, Ubuntu-Italic.ttf etc. The FamilyName would be
"Ubuntu". This thinking came from how fpGUI manages fonts. eg:
Label1.FontDesc = 'Ubuntu-13:bold,italic'; My thinking was that fpReport
could use similar. Internally the fontcache would know exactly which TTF
file to use. I found some problem with that idea (unfortunately I can't
remember what that was), and stopped work in that direction - until a
later date.

But you are welcome to make the changes you suggested above. I will take
up my research on fontcache mods some time in the future. I don't have
time at the moment.


Regards,
  — Graeme —

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp




More information about the Lazarus mailing list