Howdy, I've managed to get the rendering working (for the simple cases of top, bottom and middle), but I'm a little unsure how to package the align attribute in SVGFlowTextElementBridge. It seems to me that the vertical-align attribute should belong to the <batik:region> element, which is currently converted to a Rectangle2D. I'm guessing that the list of rectangles produced (by SVGFlowTextElementBridge.gatherRects) eventually ends up as the list of flowRects passed to GlyphLayout.textWrapTextChunk() and that I should be passing a RegionInfo class that holds the rectangle and the alignment instead.
Sound ok? Cheers Andrew On Wed, 2002-11-13 at 09:29, Andrew Pietsch wrote: > Thanks for that, I'll give it a go.. > (c: > > On Tue, 2002-11-12 at 00:33, Thomas E Deweese wrote: > > >>>>> "AP" == Andrew Pietsch <[EMAIL PROTECTED]> writes: > > > > AP> I've now decided I need this.. )c: > > > > AP> I'm presuming the final implementation is still someway off, so is > > AP> there any change of adding it (since you feel its easy) or > > AP> pointing me in the right direction so I can implement it? > > > > I'll gadly point you in the right direction ;) > > > > All of text wrapping is done as a post-processing step in text > > layout. That post-processing step has two parts, first it figures out > > what needs to be on each line, then it positions all the glyphs. > > > > All this work is done in the two methods: > > > > // Does the line break determination > > batik.gvt.text.GlyphLayout.textWrapTextChunk(....) > > > > // Does the glyph positioning > > batik.gvt.text.GlyphLayout.layoutChunk(....) > > > > As textWrapTextChunk does it's work it adde LineInfo object to a > > list, one for each line of text. > > > > What I would suggest is adding a vertical-align offset member to > > the LineInfo class. This should be a Point2D.float. Use the same > > Point2D.float for all lines in a single flowRect (the list of > > flowRects is accessed from the 'flowRectsIter'). When we hit the end > > of a flowRect (or of text), you can get the vertical size from 'dy' > > (depending on the case you will need to figure in the current line's > > size - search for 'bottomEdge') & the flow rect size from cRect.height > > from this you can calculate the 'left over' space and put half of it > > in the vertical-align Point2D's y value. > > > > Then in the layoutChunk method just add the vertical-align offset > > in when calculating the correct lineLoc for the current line. > > > > --- > > > > You will also need to pass this information to the text-wrap stuff > > from the source SVG. This is mostly done in the > > batik.extension.svg.SVGFlowTextElementBridge class. You might look at > > how the margin's are done (search for makeMarginInfo) or how the > > FlowRegions are handleded (search for getRegions). > > > > --- > > > > Hope this helps, and good luck (if you get into it and have > > specific questions feel free to post). > > > > AP> Thanks Andrew > > > > AP> On Wed, 2002-10-23 at 22:34, Thomas E Deweese wrote: > > >> >>>>> "AP" == Andrew Pietsch <[EMAIL PROTECTED]> writes: > > >> > > AP> Hi,I was wondering if the css vertical-align property is supported > > AP> (or planned) when using the flow text extension (i've tried a few > > AP> times and browsed the code so I'm guessing no). > > >> No, and eventually :) > > >> > > >> This is on hold pending decisions in the SVG WG. The > > >> implementation was done to get experience to feed back to the SVG > > >> WG. The WG is tring to sort out the details of how text wrapping > > >> will work - what features to support, what algs should be used, > > >> etc. > > >> > > AP> I'm using the cvs version (week or so old). I have a single flow > > AP> region and it would be nice (though not critical) to vertically > > AP> centre the text. > > >> This wouldn't be hard to implement for this case (or actually even > > >> for multiple flow regions), but I haven't bothered since everything > > >> is about to change anyway. > > >> > > >> --------------------------------------------------------------------- > > >> To unsubscribe, e-mail: [EMAIL PROTECTED] For > > >> additional commands, e-mail: [EMAIL PROTECTED] > > >> > > > > > > > > AP> --------------------------------------------------------------------- > > AP> To unsubscribe, e-mail: [EMAIL PROTECTED] For > > AP> additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
