[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] Adding Outline Information
From: |
Werner LEMBERG |
Subject: |
Re: [ft] Adding Outline Information |
Date: |
Sat, 12 Jan 2008 21:36:08 +0100 (CET) |
> Is there any way that my driver can add information (64 bytes) to an
> FT_Outline without breaking things? Since FT_Outline is part of the
> public interface of FreeType, I suspect there is no good way.
There is no good way I fear.
> Use unused outline->flags bit:
>
> This is a hack, I realize. By design, an FT_Outline is an
> FT_Outline, and it has lost all traces of how it got to be that
> way. On the other hand, the 'flags' field of the outline only uses a
> few bits, so there are bits I can set to say that this is one of my
> FT_Outlines.
I like this.
> 4. Stick my information onto the end of one of the arrays in
> FT_Outline. This would (probably) leave the FT_Outline legal, but
> it would not survive any copying of the outline.
Hmm, what about further abusing some outline->flags bits to store a
glyph ID? This ID could be then used by your renderer as an index
into an array which stores those 64byte blocks. `flags' is of type
`int' which normally means 32bits -- using the upper 16 bits for such
an ID you already get 64k possible values.
Werner