Hello Suzuki,
>
There are already FT_F2Dot14 (16bit), and FT_F26Dot6 (32bit) and FT_Fixed (16Dot16, 32bit).
I think using FT_F2Dot14 will be a good option because the signed distance field will have a range [-1.0, 1.0].
But for now I'll stick with *float* as you suggested.
> BTW, the most biggest trade-off in your mind is the size
> of extra table (in TrueType font file) to store Distance
> Fields info? Or, the speed to calculate the Distance Fields
> info?
And since each pixel in the distance field is the distance to the nearest edge/outline there
can be more than 255 values. So, in this case the trade-off can be the accuracy of the distance.
But, on the other hand, I think 255 values might be enough because they are interpolated if a
point lies between two.
> *This is just my idea without deep thinking*, XML or JSON
> (or, compressed version of them) would be considerable option
> to store the data, during the development of the initial
> draft, because it is easy for them to change the data
> format, insert or remove some extra data. Also it would be
> easy for external programs to extract or manipulate.
This is interesting, I haven't thought about storing them as XML or JSON.
This option can be good if the parsing time is less than the generation time,
otherwise the external application can directly generate the distance field.
We can also store them in some format which support floating point (e.g. hdr)
But, for now I think the storing part can be postponed until we have compared the
accuracy. If there isn't a much difference in the accuracy of floats vs integers, then
we can simply use 8 bits per pixel and store them as something like PNG.
What do you think about this?
Thanks,
Anuj