xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Text overflow
Date Tue, 04 Sep 2007 10:31:00 GMT
Hi Valentin,

"Валентин Алексеев" <valentin.alekseev@gmail.com> wrote on 08/30/2007

02:18:10 AM:

> Is it possible to use (or where to start looking on how to implement
> this) sort of text clipping in case of overflow in the bounding box?
> The difference is that I want to put ellipsis instead of part of the
> text which doesn't fit (something like what CSS attribute "text-
> overflow:ellipsis;" does for HTML in certain browsers). 

   The easiest way to implement this is to get the bounding
box of the text element.  If the width of the bbox is greater
than your clip box then it overflows.

   You can get the bounding box of most elements in SVG with
'getBBox()'.

   If you haven't already you may need to boot the CSS and SVG
DOM (check the Batik Wiki).

Mime
View raw message