freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] Font distribution woes


From: David Turner
Subject: Re: [Freetype] Font distribution woes
Date: Sat, 07 Jul 2001 00:53:58 +0200

Hello Paul,

> Thanks for the advice.
> 
> In looking at the docs for FT_New_Memory_Face, it seems to
> work by you providing a pointer to memory. If that's
> correct then I can't use this technique because some of
> the fonts we want to use are megabytes in size, due to
> Asian glyphs.
> 
> Now if there was a function that took a file handle and
> you gave it a starting offset and length, then I could
> use it. Would FT_Attach_Stream or some other function be
> able to do something like this?
>

I think that the solution is to:

  A - implement a custom FT_Stream object to access
      your font file. That should be relatively trivial
      since there are very little callbacks to
      provide. Have a look at the files named
      "ftsystem.c" in "src/base" and "builds/unix"
      for two simple implementations..

  B - use FT_Open_Face (instead of FT_New_Face or
      FT_New_Memory_Face) to create the corresponding
      FT_Face objects. See the API reference for
      details on this function..

Another simple alternative is to use memory-mapped
files on Windows with FT_New_Memory_Face. However,
using a custom stream allows you to perform simple
encryption of the font file in order to "protect"
it !!

Hope this helps,

- David



reply via email to

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