c++ - Windows API select bold font -


I'm trying to write some code to choose a bold font (I actually want to send the font file name Wish cross-platform font renderer, but it's also not relevant). I use CreateFont () to set FW_BOLD and pszFaceName to "EDL" to set cWeight I select this font in any DC and use GetTextFace () to check which font is actually selected The result is Ariel I was surprised that the font was not arial bold, which has a different face with a different font file. The only way to specify aerial bold font was to set pszFaceName in "Ail Bold". Unfortunately, only works by adding bold to the end of the font works for some fonts because some fonts do not have different bold fonts.

Is there a common way of specifying bold that will ensure the actual bold version

Phil

This is not the only way to work, the Windows font mapper will not change the face position" Ariel Bold "is not a standard font and has no relation to its standard" aerial "font if If you want to use it then you have to ask for it.

Ask for "Aerial" with FW_AD C: \ windows \ fonts \ arialbd.ttf selects the font file. A font file that was clearly designed to render bold aerials. Similar to the face of the name "Ariel", Ariel. TTF supplies an italic version, Arielb.TTF supplies a bold italic version, Ariel. TTF is normal.

Comments