Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Generate a usable font list from user pc for use in QM
#1
How do you generate a correct font-list which you can directly use in QM.

For example in:
Code:
Copy      Help
...
f.Create("Courier New" 15 1)
...

I want to generate a font-list with names that can be used in the above command f.create
The only thing that come up with is a function that get's the TITLE of .ttf file.
The problem is, that it generates a list like this:
(function code based on this topic: MS Word document built-in Properties)

Code:
Copy      Help
...
BatangChe Regular
Cambria Math Regular
Courier Regular
DaunPenh Regular
DFKai-SB Regular
DokChampa Regular
...

I can clean up the Regular/Bold/...etc from each title.
But I still wind up with a list of font titles that I cant use in the above command 'f.create...'
Is there another way to generate a font-list of which directly usable within QM font based commands (dialogs)?

EDIT: I use the following folder to iterate through the font files: C:\Windows\Fonts
#2
Macro enum fonts
Code:
Copy      Help
LOGFONTW lf
__Hdc dc.Init
EnumFontFamiliesExW(dc &lf &sub.EnumFontProc 0 0)


#sub EnumFontProc
function# ENUMLOGFONTEXW*lpelfe NEWTEXTMETRICEXW*lpntme FontType lParam
str s.ansi(&lpelfe.elfLogFont.lfFaceName)
out s
ret 1
#3
Thank you!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)