David, Thanks for the response. I did look at LineBreakMeasurer, but in looks as though the most powerful layout mechanism available is Font.layoutGlyphVector. The docs say:
"Returns a new GlyphVector object, performing full layout of the text if possible. Full layout is required for complex text, such as Arabic or Hindi." It was that flexibility and power I was after. You have to do your own Bidi which is a complicationg factor, but you get everything else, as far as I can tell. I'm using AttributedString as well, with subclasses of AttributedCharacterIterator.Attribute for hyphenation markers and character replacement graphics. Full layout is an expensive process, so I would like to be able to work off the GlyphVectors I have, if possible, to retrieve the broken lines. Peter On Thu, 2006-06-15 at 11:38 -0400, David Kavanagh wrote: > Peter, > I've used AttributedString to represent a sequence of text with various > attributes at different segments. Then, you can use the > LineBreakMeasurer(and passing the AttributedCharacterIterator, and > FontRenderContext). I found that the LBM didn't work well for blank > lines (and paragraph breaks), so I ended up handling those cases specially. > Once I had the lines broken up, I could iterate through and render them, > creating a glyph vector for each as I go. > > David > > Thus Spoke Peter B. West: > > >I have been using Font.layoutGlyphVector to obtain the dimensions of > >laid-out text. This includes multiple concatenated runs of text, with > >possible different Fonts, in a paragraph. The text also includes > >markers for optional hyphenation positions. After being dimensioned the > >paragraph is subjected to line-breaking. > > > >I need to be able to slice the vectors at the line-break positions. One > >of the possible output formats for the text is GlyphVectors for display. > >Is there any way to extract new GlyphVectors by slicing an splicing from > >an existing set of vectors, or do I have to perfrom the GlyphVector > >layout again for each line? > > > >For example, I may have a paragraph comprised of three sub-vectors > >created with different Fonts. This is to be sliced into seven lines. > >Some of the lines will contain sections from more than one of the > >original GlyphVectors. > > > >Thanks > >Peter =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".