Valhalla Legends Forums Archive | C/C++ Programming | RichEdit and custom font dialog box

AuthorMessageTime
Okee
Sorry for the two posts of mine up top, but this question has been troubling me.
I'm currently using a RichEdit, well not really using because I'm just starting to work on the RichEdit/message output part of my bot, but I tried allowing custom fonts by using the Font Dialog Box and a CHOOSEFONT struct.  Now, I know you initialize the CHOOSEFONT struct and then pass it to the ChooseFont funct, by value, and it returns the selected settings to the CHOOSEFONT struct. My question is though, is this compatible with RichEdit? I couldn't get the RichEdit to display the settings I had set. I'm not sure which items within the CHOOSEFONT struct actually define what either. I only want the font name, size, color and bold/underline to be optional, so only those things need to be saved from the returned struct.

If this makes sense, any help would be greatful. Thanks.
December 15, 2004, 2:40 AM
UserLoser.
Not familiar with CHOOSEFONT, so I can't tell you.  But otherwise, you can use the CHARFORMAT structure to set the way the contents of your RichEdit will appear.  This allows you to set the [font=Comic Sans]font[/font], style as bold, [u]underlined[/u], or italic, and even [color=Green]colored[/color] text, and more.
December 15, 2004, 3:16 AM
Okee
Can you use CHARFORMAT struct with a font dialog box? I would like the keep this part of my bot as system default looking as I can (ie i dont want to make my own font dialog, it wouldnt look how i want it to look)
December 15, 2004, 4:57 PM
warz
I never found a way to use CHARFORMAT with the Font Dialog box. CHOOSEFONT was too specific and annoying, also. I remember you would have to use CHOOSECOLOR also. Who cares about custom fonts, anyways. :-P
December 16, 2004, 4:08 PM
Eibro
[quote author=warz link=topic=9911.msg92594#msg92594 date=1103213290]
I never found a way to use CHARFORMAT with the Font Dialog box. CHOOSEFONT was too specific and annoying, also. I remember you would have to use CHOOSECOLOR also. Who cares about custom fonts, anyways. :-P
[/quote]No, color can be chosen on a CHOOSEFONT dialog if the right flags are set.
December 17, 2004, 12:38 PM

Search