[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] [PATCH 2/2] [cmake] add support for customized ftsystem o
From: |
Werner LEMBERG |
Subject: |
Re: [ft-devel] [PATCH 2/2] [cmake] add support for customized ftsystem on Windows |
Date: |
Tue, 31 Oct 2017 10:10:04 +0100 (CET) |
> For one project which I contribute to, we need some mechanism that
> loads specific FontFace from file. Currently we are using little
> quirky approach what messing with FreeType's internal structures, so
> actually we bundled library into our code. My intention is
> externalize it.
OK.
> The problem is that we can get a situation where the user uses
> non-standard fonts in Windows with Unicode in the pathname.
> Standard fopen() call in Windows can't handle Unicode, you need to
> use _wfopen().
>
> On Linux and macOS there no problem, since standard fopen() can
> handle with Unicode names. We can use FT_New_Memory_Face(), that
> works on already opened stream, yes, but in this case we forced to
> load whole file into memory which is in some cases leads to useless
> memory consumption.
As mentioned in
http://lists.nongnu.org/archive/html/freetype-devel/2017-10/msg00055.html
you should try `FT_Open_Face' together with the FT_OPEN_STREAM flag so
that you can directly pass a `FILE*' handle to FreeType. How you get
this file handle is then completely up to your application.
> I carefully studied docs/CUSTOMIZE from sources and figured out that
> forking system interface for platform specific issue would be best
> approach. I can do same with "#ifdef WIN32" hacks in
> src/base/ftsystem.c, but I'm think, this is a not clean solution.
I agree that your solution is better than a bunch of WIN32
conditionals. However, I doubt that it is necessary at all, given
that a fully workable solution is already available.
>> Azamat, there have been already some other follow-up e-mails on the
>> e-mail list, so please subscribe and discuss!
>
> I'm little confused, where is discussion going on? Here on
> freetype-devel or somewhere else?
On freetype-devel – since I still have to approve your e-mails I'm
assuming that you are not subscribed to the list yet.
Werner