Einzelnen Beitrag anzeigen

Fukiszo
(Gast)

n/a Beiträge
 
#6

AW: Win 10 : add/remove Font Resource

  Alt 15. Jan 2018, 12:59
so rufe ich die API auf um einer visuellen komponente eine bestimmte font zuzuordnen.
in diesem beispiel "MS Sans Serif"

vielleicht hilft's in anderen projekten aber nicht unbedingt in deinem.

Beispiel:

var hFont: Integer;

{ Create Font Handle }
hFont := CreateFont(-13, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,
DEFAULT_PITCH or FF_DONTCARE, 'MS Sans Serif');
{ set Font }
if hFont <> 0 then
begin
SendMessage( WasSollFontBekommen, WM_SETFONT, hFont, 0);
end;

...code...
wenn fertig

DeleteObject(hFont);
  Mit Zitat antworten Zitat