Peter B. West wrote:

On Thu, 2006-06-15 at 17:24 +0100, Peter B. West wrote:


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:



its not 'the most powerful'

"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.



as you say it doesn't do Bidi and as David Kavanagh as trying to remember
AttributedString can handle text in multiple fonts (ie suppose you wnat
to style
one word in italics,) and with various stylings (have a word in red or
have it underlined)
AttributedString together with LineBreakMeasurer can handle that. It
will also handle Bidi

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.





you get most of the same benefit by caching the TextLayout objects that
LineBreakMeasurer
returns. Mostly apps should avoid GlyphVector unless you know you can
make some
simplifying assumptions about the text you will be handling.

So my feeling is you are digging into the guts rather than using the
higher level APIs
that have been designed for this sort of purpose.

I am not sure if you are also wanting to somehow break at hyphens or
have some
special behaviour associated with them. LineBreakMeasurer could also do that
by telling calling the overload of LBM.nextLayout() that takes offSetLimit.

-phil.

This seems to be a silly idea on reflection.  The whole point of doing
complex layout is that it accounts for all sorts of context
dependencies. This would show up most glaringly when hyphenation occurs.
It seems to me now that I may need to perform GlyphVector layout on a
word-by-word basis, and to get separate GlyphVectors or the hyphenated
components of words.

Any other suggestions?

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".



===========================================================================
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".

Reply via email to