1. how get to font name from font file name?

Hi,

If I use 'dir' in my program to walk through C:\windows\fonts I can get the
font file names but I want the font names, such as Courier New. Can anyone
tell me how to get to them?

Thanks,
Judith Evans

new topic     » topic index » view message » categorize

2. Re: how get to font name from font file name?

Judith Evans wrote:

> how to get [font names]?

The 'official' way to get a list of fonts use EnumFontFamilies. I haven't
coded it yet, but it's on my ToDo list, along with a lot of other stuff. It
requires that you set up a callback, and read from structures.

If you want the file format for TTF, take a look at http://www.wotsit.org/.

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

3. Re: how get to font name from font file name?

Thanks, David,

I was hoping it would be something simple, sigh. I understand setting up the
structures but not the callbacks. Would I have to hack into winlib to set up
the callback in WinMain()?

Judith Evans

new topic     » goto parent     » topic index » view message » categorize

4. Re: how get to font name from font file name?

Judith Evans wrote:

> Would I have to hack into winlib to set up
> the callback in WinMain()?

No, you can set up your own callback without messing with Win32Lib.

At the time that Win32Lib was first written, Euphoria only supported one
callback. That's why WndProc has this funky "if not a Window call
subclassed()" logic. You can now set up as many callbacks as you want. I'm
probably going to have to set subclassed() up as a seperated callback, in
order to get TabControls working.

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu