You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Manuel Mall <mm...@arcus.com.au> on 2005/09/18 05:32:23 UTC
How do I get the height of a character?
The font class provides a width method to determine the width of a
character but how do I figure out the height of a character?
Background: In my quest to get all the inline dimensions right so any
background/border/padding is correctly applied I am currently looking
at leaders. For leader-style="dots" everything is basically user agent
defined. Fop uses the dot character from the current font which is a
sensible selection IMO. The bdp of the content-rectangle for a leader
area is determined by the rule-thickness trait. In this case the rule
thickness would be the height of the dot character. How do I figure
that out? For the time being I will simply use the width of the dot
character as its height.
Manuel
Re: How do I get the height of a character?
Posted by Manuel Mall <mm...@arcus.com.au>.
On Sun, 18 Sep 2005 05:30 pm, J.Pietschmann wrote:
> Manuel Mall wrote:
> > The font class provides a width method to determine the width of a
> > character but how do I figure out the height of a character?
>
> IIRC the height of an individual character doesn't matter. Well,
> for the possible exceptions of characters leaking outside the font
> boxes, like uppercase umlauts and many other accented characters.
> For all other cases, only the font height measurements should matter,
>
> > For leader-style="dots" everything is basically user agent
> > defined. Fop uses the dot character from the current font which is
> > a sensible selection IMO.
>
> I think there is a difference between leaders using the dot character
> (for the "foo...page 19" style) and a leader which is a dotted line
> (rule-style=dotted). THe rule-thickness only applies to the second
> leader style.
>
Not so sure here - I think the rule-thickness property applies only to
leader-style="rule" however according my understanding of 6.6.9 "Trait
Derivation" the rule-thickness trait applies always unless
leader-style="use-content". Therefore the question arises what is the
appropriate value for the rule-thickness trait for leader-style="dots".
My understanding is that this would be user agent specific as are most
properties with respect to leader-style="dots", e.g. the size of the
dots. IMO using the font-size gives a far too big rule-thickness for
the dots. Therefore I was thinking of using the actual vertical size of
the "black" part of the dot character. It appears that this information
is not readily available. So I decided to make it square, i.e. use the
character width as rule-thickness. This seems to give reasonable
results (as long as the dot glyphs of the selected font are square or
round as well). BTW, this only becomes relevant if someone wants to
paint a background or padding or border around the leader or chooses a
bigger font-size for the leader than for the rest of the line as in
that case the rule-thickness may determine the overall height of the
line. All of that are not very common scenarios I would think, so its
really just tidying up a very small and not important loose end.
> J.Pietschmann
Manuel
Re: How do I get the height of a character?
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Manuel Mall wrote:
> The font class provides a width method to determine the width of a
> character but how do I figure out the height of a character?
IIRC the height of an individual character doesn't matter. Well,
for the possible exceptions of characters leaking outside the font
boxes, like uppercase umlauts and many other accented characters.
For all other cases, only the font height measurements should matter,
> For leader-style="dots" everything is basically user agent
> defined. Fop uses the dot character from the current font which is a
> sensible selection IMO.
I think there is a difference between leaders using the dot character
(for the "foo...page 19" style) and a leader which is a dotted line
(rule-style=dotted). THe rule-thickness only applies to the second
leader style.
J.Pietschmann