xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist <mlundqui...@comcast.net>
Subject Re: need help w/ <flowRoot> + getBBox()
Date Wed, 13 Sep 2006 21:42:59 GMT
thomas.deweese@kodak.com wrote:

> 
>    It appears you are right.  However I don't think we are apt to fix this
> as SVG 1.2 changed directions after we implemented this.  Post
> Batik 1.6 we updated the flowDiv/flowPara elements to implement the 
> TextContent interface.  So you can get the bbox of individual chars
> which you could use to build this up.

OK, thanks... I still have more questions :-/

1) From what I could scrounge up, it looks like textContent is just a 
string.  How does that help?

2) I can alert() the textContent of the <flowPara> element... and it 
does appear to be just a string...?

3) Yes, I did have to build Batik from trunk to get that...  but then, 
my image didn't display correctly; all I got was a black rectangle.  If 
I add style="fill: white" on the <rect>, then I can see my text again... 
but I don't really want a white background, I need a transparent 
background.  How do I make that happen?  (Sorry, I don't really know 
SVG, I'm just bumbling along).

I have to admit that all this is a wee bit discouraging... "All I Want 
To Do"(TM) is render some text and have the hight of the graphic be 
constrained to the height of the wrapped text.  It seems like that 
should be dead simple, but it turns out that SVG has no concept of this, 
and I need to write an onload handler to fixup the container size.  OK, 
no problem... oh, but wait, it's not as easy as just asking for a 
bounding box anymore, now you have to walk over the glyphs and calculate 
that yourself...  This feels like punishment for what must be some abuse 
of SVG, or else... is it a bad sign when the very first thing a clueless 
newbie wants to do with SVG turns out to require "esoterica" to get it 
working?  (It feels like something in the same league as HTML+CSS not 
supporting vertical centering or grid layouts).

OK, whiney rant over.  Getting this working is the only thing holding up 
  a web site launch that's already late, so... you know :-).  Anyway, I 
can see that the flowPara element has a textContent attribute but I have 
no idea how to use that to build up a composite bounding box (as it 
appears this attribute is just a string).  Any help is much appreciated!

Thanks,
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message