News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Fun with fonts

Started by Donkey, December 18, 2012, 08:49:39 PM

Previous topic - Next topic

Donkey

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 :)
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

frktons

Quote from: 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 :)


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.
There are only two days a year when you can't do anything: one is called yesterday, the other is called tomorrow, so today is the right day to love, believe, do and, above all, live.

Dalai Lama

Donkey

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.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

TouEnMasm



GetSystemDefaultLocaleName is only supported by Windows Vista
By what can it be replaced ?
Fa is a musical note to play with CL

dedndave

GetSystemDefaultLCID

that was a hard one   :P

TouEnMasm

IDWriteFontCollection
Is only supported by Windows 7
:(
Fa is a musical note to play with CL

Donkey

Quote from: ToutEnMasm on December 20, 2012, 02:22:36 AM
IDWriteFontCollection
Is only supported by Windows 7
:(

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

QuoteWindows 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
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable