02-21-2012 10:40 AM
02-22-2012 05:48 PM
I agree that that does not make a whole lot of sense. No, the font added to the system fonts. The font exists in that process only.
I took the code from that example just as it is and font contained NIMetaDialogFont. Could you post the code you are using, or is it also copy pasted from the example?
02-23-2012 08:10 AM
02-23-2012 09:40 AM
02-23-2012 03:39 PM
I was a little confused by this behavior too. I think it is most clear when you distringuish typeface from font.
For the sake of explanation, let's assume you are using 20 point bold Courier as your font. The reason GetCtrlAttribute returns your new MetaFont "Something" after creating it is because "Something" is functionally equivalent to "Courier" with the same attributes. By this I mean they both 20 point bold with Courier typeface. When getting ATTR_TEXT_FONT from the control it finds the "Something" MetaFont before the "Courier" font.
You can see this is action if you change the size of the control font and then get the ATTR_TEXT_FONT again. It will then return "Courier" as you originally expected. This behavior may be confusing if you are actually looking at the names of the fonts, but it is functionally the same. If you need to retrieve the typeface from the font, use the GetFontTypefaceName function.
02-24-2012 07:10 AM
02-24-2012 07:40 AM