May 03, 2024, 01:25:16 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Edit Control Font

Started by Bruce Peaslee, June 02, 2006, 05:23:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bruce Peaslee

I can't get the font in my edit control to switch to wingdings. Everything else (size, boldness) works.


CEdit *pEdit;

...

pEdit = GetControl(RD_txtStars);
pEdit->SetColor(GREEN,BLACK);
SetFont("Wingdings",10,600,0,RD_txtStars);
pEdit->SetText("M"); // shows as an "M", not a bomb
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Ionic Wind Support Team

Probably needs a different character set....SYMBOL_CHARSET perhaps.

pEdit->SetFont("Wingdings",10,600,SYMBOL_CHARSET);
Ionic Wind Support Team

Bruce Peaslee

... at the feet of the master.ÂÃ,  ÂÃ,  ;)

Thanks.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Ionic Wind Support Team

Ionic Wind Support Team

LarryMc

Bruce,
Don't you just hate it when he makes it look so easy. ;)
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Bruce Peaslee

Quote from: Larry McCaughn on June 03, 2006, 04:49:25 AM
Bruce,
Don't you just hate it when he makes it look so easy. ;)

Actually, I hate it when he gives us an answer I just don't get.ÂÃ,  ÂÃ, ;)
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Ionic Wind Support Team

Fonts can have multiple character sets.  If you ask Windows for a font and specify a character set that doesn't exist it will pick a "closest matching" font.  "windings" only has a SYMBOL_CHARSET and the default used by SetFont is ANSI_CHARSET.  So in this case windows looked for the closest matching font that had the same dimensions and characteristics.

The easiest way to tell what character set a font supports is to open wordpad.  Chose the font you want and then pull down the third combo box.  Western = ANSI/UNICODE

You can also use the font selector in "editor options".  The "Script" setting is the character set.

Ionic Wind Support Team

Bruce Peaslee

I understood that answer - I was just commenting in general.   :)
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles