[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Devel] compute bounding box
From: |
Tom Kacvinsky |
Subject: |
Re: [Devel] compute bounding box |
Date: |
Tue, 17 Apr 2001 16:34:50 -0400 (EDT) |
Well, it is in the TODO list that computing the bbox of a glyph that uses cubic
Bezier curves is broken. Given the fact that you may want to use the bbox of
each glyph shown in a string to compute the glocabl bbox of the string, I'd have
to say that you are going to have problems with Type 1 fonts. :(
But, supposing the glyph bbox code for each font format FreeType supports works
and
assuming a left to right (or right to left) language script:
The height of the global bbox should be the maximum of
{y: y is the "height" of the bbox of a glyphs shown in the string}
Similarly for the depth of the global bbox. The left (right, resp.) edge is a
rather simple case: the left (right) edge of the first glyph shown (if kerning
isn't wacked out).
The right (or left) edge poses a problem, because the advanced width, kerning,
and left side bearing tricks that can come into play. I leave that up to the
interested reader. :)
Tom
P.S. Thierry, did the ASCI85 code I pointed out to you (on comp.text.pdf) work
out?
On Tue, 17 Apr 2001, Thierry Frey wrote:
>
> I was interested in using freetype to compute the bounding box of a given
> string. Unfortunately, the FAQ only hints at this at the moment. Does
> anybody have a more thorough answer? I'd be happy to write up something for
> the FAQ afterwards.
>