Re: [JAVA2D] layoutGlyphVector

2006-01-26 Thread Peter B. West

douglas felt wrote:

Peter B. West wrote On 01/22/06 14:36,:


-- Information from the mail header ---
Sender:   Discussion list for Java 2D API <[EMAIL PROTECTED]>
Poster:   "Peter B. West" <[EMAIL PROTECTED]>
Subject:  layoutGlyphVector
---

The API docs for java.awt.Font.layoutGlyphVector(...) have a slight bug.
The underlying text reads:
-quote-
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.  Support for different
 scripts depends on the font and implementation.
 Bidi, and should only be performed on text that
 has a uniform direction.
-endquote-

This is confusing.  It says that layout requires bidi analysis, but then
appears to be saying that if, following this analysis, there is any
mixed bidi text, you can't use layoutGlyphVector. Is this correct? Does
this mean that I must perform the bidi analysis, then iterate through
the paragraph, calling layoutGlyphVector on each of the fragments in turn?



Yes, that's what it means.  Layout is architected so that the layout
engines only operate on unidirectional runs-- bidirectional analysis
(and font/style mapping) is done at a higher level.  This is exactly
(among other things) what TextLayout does.

I agree, the documentation should be clarified.

In the future it might be possible to make more of TextLayout's internal
state visible so that clients could get the list of GlyphVectors that
the TextLayout generated.  Would that be useful to you?

Doug


Thanks Doug. Well, it would be handy, and will be handy for anyone using
GlyphVectors for custom layout in the future. It seems a logical
complement to the TextLayout facilities.

Peter
--
Peter B. West 
Folio 
---
[This E-mail has been scanned for viruses but it is your responsibility
to maintain up to date anti virus software on the device that you are
currently using to read this email. ]

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


Re: [JAVA2D] layoutGlyphVector

2006-01-25 Thread douglas felt
Peter B. West wrote On 01/22/06 14:36,:
> -- Information from the mail header 
> ---
> Sender:   Discussion list for Java 2D API <[EMAIL PROTECTED]>
> Poster:   "Peter B. West" <[EMAIL PROTECTED]>
> Subject:  layoutGlyphVector
> ---
>
> The API docs for java.awt.Font.layoutGlyphVector(...) have a slight bug.
> The underlying text reads:
> -quote-
> 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.  Support for different
>   scripts depends on the font and implementation.
>  Layout requires bidi analysis, as performed by
>   >Bidi, and should only be performed on text that
>   has a uniform direction.
> -endquote-
>
> This is confusing.  It says that layout requires bidi analysis, but then
> appears to be saying that if, following this analysis, there is any
> mixed bidi text, you can't use layoutGlyphVector. Is this correct? Does
> this mean that I must perform the bidi analysis, then iterate through
> the paragraph, calling layoutGlyphVector on each of the fragments in turn?
>
Yes, that's what it means.  Layout is architected so that the layout
engines only operate on unidirectional runs-- bidirectional analysis
(and font/style mapping) is done at a higher level.  This is exactly
(among other things) what TextLayout does.

I agree, the documentation should be clarified.

In the future it might be possible to make more of TextLayout's internal
state visible so that clients could get the list of GlyphVectors that
the TextLayout generated.  Would that be useful to you?

Doug

> Peter
> --
> Peter B. West 
> Folio 
> ---
> [This E-mail has been scanned for viruses but it is your responsibility
> to maintain up to date anti virus software on the device that you are
> currently using to read this email. ]
>
> ===
> 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".


Re: [JAVA2D] layoutGlyphVector

2006-01-22 Thread Phil Race

1. Yes that's a bad javadoc closing tag placement.

2. What it is trying to say is that if you have text that needs Bidi,
then use the java.text.Bidi analysis to
break it into runs, each of which can then be used with
layoutGlyphVector. This does mean you'd
have multiple GVs you'd have to draw individually.

3. This may seem tricky but 99.99% of apps don't go near here .. it was
only added in 1.4
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4403152
has some background on this relatively recent origin of layoutGlyphVector.

So most apps use drawString will automatically handle Bidi by under the
covers invoking TextLayout.
In fact a lot of typical desktop apps don't even call drawString
directly : they set text on a Component.

-Phil.

Peter B. West wrote:

The API docs for java.awt.Font.layoutGlyphVector(...) have a slight bug.
The underlying text reads:
-quote-
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.  Support for different
 scripts depends on the font and implementation.
 Bidi, and should only be performed on text that
 has a uniform direction.
-endquote-

This is confusing.  It says that layout requires bidi analysis, but then
appears to be saying that if, following this analysis, there is any
mixed bidi text, you can't use layoutGlyphVector. Is this correct? Does
this mean that I must perform the bidi analysis, then iterate through
the paragraph, calling layoutGlyphVector on each of the fragments in
turn?

Peter
--
Peter B. West 
Folio 
---
[This E-mail has been scanned for viruses but it is your responsibility
to maintain up to date anti virus software on the device that you are
currently using to read this email. ]

===

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


[JAVA2D] layoutGlyphVector

2006-01-22 Thread Peter B. West

The API docs for java.awt.Font.layoutGlyphVector(...) have a slight bug.
The underlying text reads:
-quote-
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.  Support for different
 scripts depends on the font and implementation.
 Bidi, and should only be performed on text that
 has a uniform direction.
-endquote-

This is confusing.  It says that layout requires bidi analysis, but then
appears to be saying that if, following this analysis, there is any
mixed bidi text, you can't use layoutGlyphVector. Is this correct? Does
this mean that I must perform the bidi analysis, then iterate through
the paragraph, calling layoutGlyphVector on each of the fragments in turn?

Peter
--
Peter B. West 
Folio 
---
[This E-mail has been scanned for viruses but it is your responsibility
to maintain up to date anti virus software on the device that you are
currently using to read this email. ]

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