| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Fonts problem |
Hello Jan!
If I understand your problem, you are trying to get the System VIO font in
an MLE. I have done this before, but not using WinSetPresParam -- I used
WinSendMsg. With WinSendMsg you just set up a FATTRS variable with the
correct font; just for fun here it is:
hps = WinBeginPaint (hwndFrame, NULLHANDLE, NULL);
cMonoFonts = GpiQueryFonts (hps,
QF_PUBLIC,
"System VIO",
&cFonts,
0L,
(PFONTMETRICS) NULL);
pfm = malloc (cMonoFonts*sizeof(FONTMETRICS));
GpiQueryFonts (hps, QF_PUBLIC, "System VIO",
&cMonoFonts, sizeof (FONTMETRICS), pfm);
iFontsize=0;
while (pfm[iFontsize].sNominalPointSize < POINTSIZE) iFontsize++;
fat.usRecordLength = sizeof (fat);
fat.fsSelection = 0L;
fat.lMatch = pfm[iFontsize].lMatch;
iCharheight = pfm[iFontsize].lMaxBaselineExt;
iCharwidth = pfm[iFontsize].lAveCharWidth;
strcpy (fat.szFacename, "System VIO");
free (pfm);
(Please forgive the sloppy formatting...) The variable types should be
pretty obvious here, so I didn't include them; the only gotcha is that
POINTSIZE is not 14 (in my case) but 140 for a 14-point font, I guess
because some fonts can be sized in tenths of a point. Then when you want
to set your MLE to use the System VIO font you just use
WinSendMsg (hwndMLE, MLM_SETFONT, (MPARAM) &fat, (MPARAM) 0);
and it should work. Actually I have found that if I do this when I create
the MLE it "forgets" what font it should be, and I have to set it
again later -- I haven't bothered to figure out why. Anyway this may help
you a little, I hope.
Richard Price
--- Maximus/2 2.02
* Origin: OS/2 Shareware BBS, telnet://bbs.os2bbs.com (1:109/347)SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934 SEEN-BY: 711/955 712/407 515 624 628 713/317 800/1 @PATH: 109/347 18 7 396/1 270/101 712/515 711/808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.