Author Topic: Fun with fonts  (Read 4578 times)

Donkey

  • Moderator
  • Member
  • *****
  • Posts: 195
  • ASS-embler
    • Donkey's Stable
Fun with fonts
« 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 :)
"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

  • Member
  • ***
  • Posts: 491
Re: Fun with fonts
« Reply #1 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.

Donkey

  • Moderator
  • Member
  • *****
  • Posts: 195
  • ASS-embler
    • Donkey's Stable
Re: Fun with fonts
« Reply #2 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.
"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

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: Fun with fonts
« Reply #3 on: December 20, 2012, 02:00:49 AM »


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

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: Fun with fonts
« Reply #4 on: December 20, 2012, 02:03:34 AM »
GetSystemDefaultLCID

that was a hard one   :P

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: Fun with fonts
« Reply #5 on: December 20, 2012, 02:22:36 AM »
IDWriteFontCollection
Is only supported by Windows 7
 :(
Fa is a musical note to play with CL

Donkey

  • Moderator
  • Member
  • *****
  • Posts: 195
  • ASS-embler
    • Donkey's Stable
Re: Fun with fonts
« Reply #6 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
"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