mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 16:21:01 +02:00
Examples/FontEnum: Get font styles in gtk/qt.
This commit is contained in:
parent
6dddcddc4f
commit
574f312a76
@ -120,10 +120,19 @@ begin
|
|||||||
if LStyles.IndexOf(s)<0 then begin
|
if LStyles.IndexOf(s)<0 then begin
|
||||||
// encode bold (bit 0), italic (bit 1) -- see SelectFont
|
// encode bold (bit 0), italic (bit 1) -- see SelectFont
|
||||||
n := 0;
|
n := 0;
|
||||||
|
{$IFDEF LCLWin32}
|
||||||
if (eLogFont.elfLogFont.lfItalic <> 0) then
|
if (eLogFont.elfLogFont.lfItalic <> 0) then
|
||||||
n := n or 1;
|
n := n or 1;
|
||||||
if (eLogFont.elfLogFont.lfWeight > FW_MEDIUM) then
|
if (eLogFont.elfLogFont.lfWeight > FW_MEDIUM) then
|
||||||
n := n or 2;
|
n := n or 2;
|
||||||
|
{$ENDIF}
|
||||||
|
{$IF DEFINED(LCLGtk2) or DEFINED(LCLGtk3) or DEFINED(LCLQt) or DEFINED(LCLQt5)}
|
||||||
|
s := Lowercase(s);
|
||||||
|
if (pos('italic', s) <> 0) or (pos('oblique', s) <> 0) then
|
||||||
|
n := n or 1;
|
||||||
|
if (pos('bold', s) <> 0) then
|
||||||
|
n := n or 2;
|
||||||
|
{$ENDIF}
|
||||||
LStyles.AddObject(eLogFont.elfStyle, TObject(ptrint(n)));
|
LStyles.AddObject(eLogFont.elfStyle, TObject(ptrint(n)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user