freetype
[Top][All Lists]
Advanced

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

Re: [ft] Reading KERN subtables


From: Alex Taylor
Subject: Re: [ft] Reading KERN subtables
Date: Thu, 22 Aug 2013 23:30:29 -0400 (EDT)
User-agent: PMMail/3.08 (os/2; U; Warp 4.5; en-CA; i386; ver 3.08.70.1660)

On Thu, 22 Aug 2013 09:22:00 +0200 (CEST) Werner LEMBERG wrote:
> > For a couple of my projects, I need to retrieve a list of all
> > kerning pairs defined in the KERN table (subtable format 0).  (I'm
> > populating externally-defined API data structures which require it.)
> 
> Sounds very inefficient.

Unfortunately, yes; I am caching the information to an extent, though.


> > If anyone knows where I can find a sample of such a (TrueType) font,
> > I'd appreciate it.  (That's question #1.)
> 
> Given that it essentially affects old Apple fonts only you probably
> might ignore format 2 completely.  Modern fonts don't have `kern' (or
> probably just a rudimentary version covering the most basic needs) but
> `GPOS'.  However, in case you find one I would like to have it
> also :-)

OK, fair enough.  

It's not so much the type 2 format as my code's ability to parse over 
multiple subtables of any type that I'd like to test if possible.  I wonder 
if FontForge can generate such a beast?


> Having such a large table is indeed against the specification.
> However, it *might* work, depending on the strictness of the
> implementation: If there is only a single subtable, the actual value
> of the `length' field is basically unimportant.  Of course, the right
> solution is to split into a set of smaller subtables.

I've decided to basically ignore the length field (except when skipping 
past non-format-0 subtables, at least for now) and calculate it myself 
based on the number of pairs in the table.  I can also check to make sure 
I'm not running past the end of the entire kerning directory.

At least it seems to work, at least with what I have. :)

Thanks.
-- 
Alex Taylor <address@hidden>
http://www.altsan.org



reply via email to

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