The MASM Forum

Projects => Rarely Used Projects => GoAsm => Topic started by: Donkey on December 18, 2012, 08:49:39 PM

Title: Fun with fonts
Post by: Donkey on December 18, 2012, 08:49:39 PM
If your looking for the most complicated way to enumerate system fonts I have the program for you. I was messing around and decided to translate a DirectWrite example from MSDN:

http://msdn.microsoft.com/en-us/library/windows/desktop/dd756584%28v=vs.85%29.aspx

It uses the DirectWrite COM interface to enumerate fonts and outputs to the console. I haven't put in much in the way of error checks but those are just "donkey work" anyway :)
Title: Re: Fun with fonts
Post by: frktons on December 18, 2012, 11:29:30 PM
If your looking for the most complicated way to enumerate system fonts I have the program for you. I was messing around and decided to translate a DirectWrite example from MSDN:

http://msdn.microsoft.com/en-us/library/windows/desktop/dd756584%28v=vs.85%29.aspx

It uses the DirectWrite COM interface to enumerate fonts and outputs to the console. I haven't put in much in the way of error checks but those are just "donkey work" anyway :)


Do you know if all these fonts are usable by the windows console?
If yes, how to select them? I've seen that in my system, win7, I have
installed the SDK 7.1 with these examples in CPP to enumerate or
choose the font, and I'm curious about the possibility to see them in action
in the win console.
Title: Re: Fun with fonts
Post by: Donkey on December 19, 2012, 04:05:48 AM
Hi frktons,

No, these are system fonts for GUI (using DirectX), they are not related to the console. I chose to output the names to the console because the example did.
Title: Re: Fun with fonts
Post by: TouEnMasm on December 20, 2012, 02:00:49 AM


GetSystemDefaultLocaleName is only supported by Windows Vista
By what can it be replaced ?
Title: Re: Fun with fonts
Post by: dedndave on December 20, 2012, 02:03:34 AM
GetSystemDefaultLCID

that was a hard one   :P
Title: Re: Fun with fonts
Post by: TouEnMasm on December 20, 2012, 02:22:36 AM
IDWriteFontCollection
Is only supported by Windows 7
 :(
Title: Re: Fun with fonts
Post by: Donkey on December 21, 2012, 05:17:39 AM
IDWriteFontCollection
Is only supported by Windows 7
 :(

Actually it's available for Vista with the platform update according to the docs.

Quote
Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps]

As for the GetSystemDefaultLocaleName function, since the interface is only supported on systems after that function became available it should not present a problem.

Edgar