TFPFontCacheItem properties (FamilyName, IsBold, IsItalic, ...) aren't loaded from the font file. I have to assign them explicitely. Is it really wanted? Can a TTF file embed font with various styles?

E.g. I have to do now:

  TPrintFontCacheList = class(TFPFontCacheList)
  public
    function Add(const AObject: TFPFontCacheItem): Integer;
  end;

function TPrintFontCacheList.Add(const AObject: TFPFontCacheItem): Integer;
begin
  Result := inherited Add(AObject);
  AObject.FamilyName := AObject.GetFontData.FamilyName;
  AObject.IsBold := AObject.GetFontData.Bold;
  AObject.IsItalic := AObject.GetFontData.ItalicAngle <> 0;
end;

in order the used font is correctly found.

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.

Ondrej

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to