This is an area of the spec I haven't worked with before, so I can't
give you much specific guidance. However, a quick look at the opentype
spec tells me that the structure is basically a header that tells you
the data is in format 14, the number of bytes in the subtable, and the
number of records (Variation Selector Records) to follow.
This information tells you how many records to read, and how much
space they take up in the file.
Variation Selector Records consists of three things:
a selector, an offset into a default UVS table, and an offset into
a non-default UVS table. So for each of these records, you should
unpack these three values.
Once you have unpacked all of them, you'll also need to process both
default and non-default UVS tables. It looks like former is a set of
ranges that are considered to be treated as "default" (i.e. not
manipualted) and the latter are "non-default" and so they map various
unicode values to non-default glyphs.
I don't really understand much of this, but hopefully knowing the
structure will help you. It looks like there is a Format 14 example at
the bottom of the page related to cmaps:
http://www.microsoft.com/typography/otspec/cmap.htm
More generally, you can learn a bit about binary file processing by
reading this article:
https://practicingruby.com/articles/binary-file-formats?u=dc2ab0f9bb
And for more specific learning, you may want to try looking at how some
of the other formats in TTFunk are implemented:
https://github.com/prawnpdf/ttfunk/tree/master/lib/ttfunk/table/cmap
That's as much as I can help for now... it's been years since I've been
working on this code so I don't have much specific memory of it. Still,
hope it was helpful!
-greg
> > an email to
prawn-ruby+...@googlegroups.com <javascript:>
> > <mailto:
prawn-ruby+...@googlegroups.com <javascript:>>.
> <
https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Prawn" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
prawn-ruby+...@googlegroups.com
> <mailto:
prawn-ruby+...@googlegroups.com>.