[luatex] Get area of a glyph?
Arno.Trautmann at gmx.de
Sun Sep 16 17:56:52 CEST 2012
Paul Isambert wrote:
> Arno Trautmann <Arno.Trautmann at gmx.de> a écrit:
>> Hi all,
>> again a rather unusual question: I'd like to get the black area of a
>> glyph. Why? To estimate it's greyness: For a “–” e.g. I want to get
>> something like “5%” (of the whole box surface), while a “m” would give
>> some “30%”, and a black box of course would result in 100%. Of course I
>> would also be happy with any absolute value like “0.1 square inches” or
>> whatever. So: Is there any chance to read such a value from inside
>> LuaTex? Or is this information not available?
> LuaTeX doesn't even read the curves used to draw a glyph, so no way you
> can get that information, as far as I can tell; you'll have to read
> directly from the font file
I heard the rumor that LuaTeX can read several things from font files ;)
So this sounds as if I had to learn how to read a font file and to
extract the curves in LuaTeX. Will be my task for the next few months …
> (under the assumption that knowing the shape
> of the glyph gives you its area, which I don't know, not being a
Being a physicist, I guess it should give the area. But it won't be easy …
> perhaps by hit or miss?).
> Perhaps approximations exist, but I've never heard of them.
Maybe someone else?
Thanks for the answer,
More information about the luatex