Font resizing/bold/italic on the fly

Is there a way to create a default version of a font (say Ariel) with CreateFont and then make changes to the size, boldness, or italic without having to create multiple HFONT handles? I got working what I needed, but had to create 8 different Ariel fonts to handle the different configurations I wanted. I couldn't find any writeups on another way.
I don't think so dodge. To the best of my knowledge, every change to a font will require another HFONT. You aren't doing this thing with all these various fonts to handle multiple monitors, screen resolutions, DPI changes, are you? If that's the case, then there is a possible solution perhaps more to your liking.
No. Just standard printing on the same monitor. Oh, well. Thought I would ask. Thanks.
there is something called a LOGFONT that is either the underlying thing HFONT is made of or close to it. You can get this with a getobject(font) and possibly modify your font via some raw pointer hackery (unclear, I think getobject is making a copy, but there has to be a backdoor into the real one somewhere). This is probably unsound: most likely if you hack an existing font, everything written in it will change when/if you manage to change the font. So you can't like turn it bold for a few words then back again, or at least, I do not think doing that would work safely at all. Its clear M$ did NOT want you to do that, and DOES want you to make a new font each time, so this would, even if it works, be 'fragile' and unsound, but it could be a fun exercise to try to figure out what its made of inside.

You might use a rich text control; I am not sure, but rich text is a markup language, and you can set the tags in it directly I think?
Registered users can post here. Sign in or register to post.