[Top][All Lists]

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

Re: [ft] FT_New_Face

From: Wenlin Institute
Subject: Re: [ft] FT_New_Face
Date: Sun, 17 Sep 2006 09:48:06 -0700

On Sep 16, 2006, at 5:52 PM, Brian Weed wrote:

Hartwig Wiesmann wrote:

the file path parameter is a pointer to a constant char type. A lot of OS are not using ASCII characters but Unicode to describe the file name and its path. Is there any workaround to have also access to font files that have non-ASCII characters in their file names?

AFAIK, FT_New_Face eventually just calls fopen()...

On Win32 if you compile FreeType with _MBCS (a win32 define), then you can pass Multi-Byte-Character-Strings (which can be represented with a CHAR *). On MacOS, I think the default is UTF-8 (which can also be represented by a CHAR *).

Yes, on OS X you can use UTF-8 for the font filename (which can include Chinese characters, for example) and FT_New_Face() will open the font.

I store all strings as UTF-8 (regardless of platform), and convert to MBCS on Win32 as needed.

Same here. On Win32, I don't know if FT_New_Face works with UTF-8 or whether fopen() can be made to work reliably with UTF-8. (My Windows XP computer is currently broken so I can't test it.) Otherwise, on Win32, when the filename is known to be UTF-8, it can be converted to UTF-16, and _wfopen() can be called instead of fopen(). That works. (I've tested it on XP with text files, but not with fonts.) It might be good for FT_New_Face to support that method on Win32, if it doesn't already.



Freetype mailing list

文林 Wenlin Institute, Inc.        Software for Learning Chinese
E-mail: address@hidden     Web:
Telephone: 1-877-4-WENLIN (1-877-493-6546)

reply via email to

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