freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Freetype] Question on MacOS X


From: Leonard Rosenthol
Subject: RE: [Freetype] Question on MacOS X
Date: Sat, 01 Dec 2001 08:41:00 -0500

At 07:18 PM 11/30/2001 -0500, Changyuan Hu wrote:
>          True, but the standard FT_New_Face() on the Mac goes through some
> special processing to provide transparent support for Mac OS fonts.  I
> would recommend that you use that call instead, so that FT can deal with
> all the complexities for you.

Function FT_New_Face() requires font file path name as input.

        Correct.


That is almost useless for a serious application in Windows or Mac, in which you would allow user to choose font from family name, style and size, but not from font file selection.

Agreed. Which is why there is a new routine (not checked in yet!) that lets you specify the name and style, and get back the path name and FOND index to use for calling FT_New_Fac().


It is the same case in Windows, where you probably use Windows standard ChooseFont() to open standard font selection dialogue and upon return, you get the handle to the selected font. Because the Windows ChooseFont() function uses special algorithm to map user requirement to the font Windows sees as the best match, using a file dialog to let user choose a font file directly is not such a nice solution. (That is why I still did not use FreeType in my Windows application.)

I haven't looked, but I suspect that Windows has a call similar to FT_Face_From_FOND that lets you get an FT_Face from an HFONT.


So, I have to use Mac native way to open a font, i.e. passing a FOND resource handle to FT_New_Face_From_FOND(). Macintosh dev technical note TN2024 has a detailed explaination on how to open the FOND resource hand from both the traditional resource-fork font and the new data-fork font (.dfont).

Correct. BUT it also has a problem where it doesn't take into account the face offset (as reported to me by someone else on this list, and patches WERE added to FT2 to deal with it).


By the way, the patch code in FT2 version ftmac.c to allow parse_font find a face which is not the first one in FOND resource seems not complete.

        Oh?


It still does not support style (normal, italic, bold and bold-italic). Some FOND contains sfnt resource of all the four possible styles (such as Times). So, we should loop into the AsscEntry array to find the best fit. I did this patch for the FT1.2.2 code locally and of course I added the style argument in the FT_New_Face_From_FOND() function. Following is my local modification.

        I'll test it out (though I am sure it's fine) and check it in!


LDR




reply via email to

[Prev in Thread] Current Thread [Next in Thread]