Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2025-11

conflicting types in fpTTF

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

duilio foschi

fsBold in unit fpTTF is declared as
TTrueTypeFontStyle = (fsRegular, fsItalic, fsBold, fsCondensed, fsExtraLight, fsLight, fsSemibold, fsMedium, fsBlack, fsFixedWidth);

the standard declaration of fsBold in unit Graphcs is
  TFontStyle = (fsBold, fsItalic, fsUnderline, fsStrikeOut);

This causes errors at compile time like:
Printer.Canvas.Font.Style := [fsBold];
Error: Incompatible type for arg no. 1: Got "{Array Of Const/Constant Open} Array of TTrueTypeFontStyle", expected "TFontStyles"

It becomes impossible to use TPrinter and TPDFDocument in the same unit.

HTH

Peppe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20251102/2d5bc64a/attachment.htm>

Reply by email

Flávio Etrusco
to duilio foschi

Em dom., 16 de nov. de 2025 ?s 16:37, duilio foschi via lazarus <

Show quoted text 11 lines
escreveu: fsBold in unit fpTTF is declared as TTrueTypeFontStyle = (fsRegular, fsItalic, fsBold, fsCondensed, fsExtraLight, fsLight, fsSemibold, fsMedium, fsBlack, fsFixedWidth); the standard declaration of fsBold in unit Graphcs is TFontStyle = (fsBold, fsItalic, fsUnderline, fsStrikeOut); (...) It becomes impossible to use TPrinter and TPDFDocument in the same unit

This doesn't make it impossible, just less convenient. Just prepend the type: TFontStyle.fsBold
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20251116/4a16d3d6/attachment.htm>

Reply by email