Schriftarten
-
Hallo zusammen
Ich brauche immer die gleiche Schriftart (DEFAULT_GUI_FONT), jedoch in immer wieder unterschiedlichen Grössen, wie mache ich das am besten ?? Das Mit CreateFont oder CreateFontIndirect erschien mir deutlich zu aufwändig...Gruss Ishildur
-
Was ist an CreateFontIndirect() zu aufwändig?
HFONT hDefGuiFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); // LOGFONT lf; int PointSize = 24; HFONT hFont; GetObject(hDefGuiFont, sizeof(LOGFONT), &lf); lf.lfHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72); hFont = CreateFontIndirect(&lf);
Fertig!
Kannst ja auch ne Funktion draus machen.