You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Taro App (JIRA)" <ji...@apache.org> on 2011/01/14 02:52:45 UTC

[jira] Created: (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Font looks different when text is selected across multiple lines in TextArea
----------------------------------------------------------------------------

                 Key: PIVOT-697
                 URL: https://issues.apache.org/jira/browse/PIVOT-697
             Project: Pivot
          Issue Type: Bug
    Affects Versions: 2.0
         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
            Reporter: Taro App
            Priority: Minor


Font looks different when text is selected across multiple lines in TextArea.
When the selection is within a single line, font looks the same.
For English text, this font change is subtle and can be ignored.
For Japanese text, this font change is obvious and looks weird.

I'm not sure if this is platform dependent or font dependent.
May have something to do with how Java2D renders fonts.

I will attach screen shots and test codes.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12981714#action_12981714 ] 

Sandro Martini commented on PIVOT-697:
--------------------------------------

It seems that some blurring is applied to selected text ... but if this is true who is applying it  (Pivot, or Java2D, or something more related to the font), and why (could be that by default text looks better in this case) ?

> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>         Attachments: Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] [Updated] (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini updated PIVOT-697:
---------------------------------

    Affects Version/s: 2.0.1
        Fix Version/s:     (was: 2.0.1)
                       2.0.2

This requires more tests, so move to 2.0.2


> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0, 2.0.1
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>             Fix For: 2.0.2
>
>         Attachments: NotePadComparison-MultipleLineSelectEnglish.png, NotePadComparison-MultipleLineSelectJapanese.png, Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012072#comment-13012072 ] 

Noel Grandin commented on PIVOT-697:
------------------------------------

Thanks Taro. 
Very very interesting. Both Pivot and Windows are doing anti-aliasing on the text, but they're doing it very differently.
I'm really not sure what to make of this.


> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: NotePadComparison-MultipleLineSelectEnglish.png, NotePadComparison-MultipleLineSelectJapanese.png, Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Taro App (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Taro App updated PIVOT-697:
---------------------------

    Attachment: Test1.SingleLineSelectEnglish.jpg

> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>         Attachments: Test1.SingleLineSelectEnglish.jpg
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Taro App (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Taro App updated PIVOT-697:
---------------------------

    Attachment:     (was: Test1.SingleLineSelectEnglish.jpg)

> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Taro App (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Taro App updated PIVOT-697:
---------------------------

    Attachment: Test4.MultipleLineSelectJapanese.png
                Test3.SingleLineSelectJapanese.png

> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>         Attachments: Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006400#comment-13006400 ] 

Noel Grandin commented on PIVOT-697:
------------------------------------

This is just the standard Java anti-aliasing logic at work. I'm not sure that there is much we can do to fix it, without making other rendering look worse.

You could try playing with these command-line switches and seeing if they help:
http://stackoverflow.com/questions/1202040/specify-antialias-property-in-the-command-line

> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010645#comment-13010645 ] 

Noel Grandin commented on PIVOT-697:
------------------------------------

@Taro, can you post 2 comparison screenshots of what this looks like in Pivot and in Notepad on your PC? 
So we can compare results.
Thanks.

> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini updated PIVOT-697:
---------------------------------

    Fix Version/s: 2.0.1

> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Taro App (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Taro App updated PIVOT-697:
---------------------------

    Attachment: Test2.MultipleLineSelectEnglish.png
                Test1.SingleLineSelectEnglish.png

> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>         Attachments: Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] [Updated] (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini updated PIVOT-697:
---------------------------------

    Comment: was deleted

(was: This requires more tests, so move to 2.0.2
)
    
> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0, 2.0.1
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>             Fix For: 2.0.2
>
>         Attachments: NotePadComparison-MultipleLineSelectEnglish.png, NotePadComparison-MultipleLineSelectJapanese.png, Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini updated PIVOT-697:
---------------------------------

    Affects Version/s:     (was: 2.0.1)
        Fix Version/s:     (was: 2.0.2)
                       2.1
    
> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>             Fix For: 2.1
>
>         Attachments: NotePadComparison-MultipleLineSelectEnglish.png, NotePadComparison-MultipleLineSelectJapanese.png, Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Taro App (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012394#comment-13012394 ] 

Taro App commented on PIVOT-697:
--------------------------------

Let's just forget the comment above.

Now I partly figured out the cause of the issue. This issue has something to do with clipping. When clipping area is not a rectangle, rendered text will be blurred. I wonder if this behavior is JDK implementation dependent. I use JRE 1.6.0_18 on Windows XP SP3. My guess is that text itself is rendered correctly with antialias, and is further antialiased when JDK applys clipping. JDK may wrongly apply antialias when clipping based on text antialias setting because this issue does not occur when text antialias is disabled with System.setProperty("awt.useSystemAAFontSettings", "off"); To workaround this issue, rectangle clipping should always be used.

In org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.paint(Graphics2D graphics), clipping areas for selected text(selectedArea) and unselected text (unselectedArea) are calculated. When multiple lines of text are selected, selectedArea is not a rectangle, so rendered text looks different (blurred.)


> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: NotePadComparison-MultipleLineSelectEnglish.png, NotePadComparison-MultipleLineSelectJapanese.png, Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Taro App (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009978#comment-13009978 ] 

Taro App commented on PIVOT-697:
--------------------------------

As I understand, Java default anti-aliasing logic is platform dependent (Windows/Linux, CRT/LCD.) Windows default anti-aliasing logic is also font size dependent (small fonts are not anti-aliased.) But I think text should be anti-aliased in the same way on the same PC, the same font size and the same settings. I see there are several places in the Pivot code where RenderingHints.VALUE_ANTIALIAS_ON or RenderingHints.VALUE_ANTIALIAS_OFF are set. I wonder if those values are incorrectly set, or incorrectly not-set when rendering TextArea.

FYI: http://download.oracle.com/javase/6/docs/technotes/guides/2d/flags.html#aaFonts


> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Taro App (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13022005#comment-13022005 ] 

Taro App commented on PIVOT-697:
--------------------------------

Here are some more findings:

On Windows note PC (default LCD anti-alias mode,) Java renders English text anti-aliased, but renders Japanese text anti-aliased only when the font size is larger than 20pt (http://itpro.nikkeibp.co.jp/article/COLUMN/20070205/260649/), however, if non-rectangle clipping is applied, small Japanese font is also anti-aliased somehow. I confirmed this with a simple test case without Pivot. If default anti-alias is set to off with awt.useSystemAAFontSettings system property, text is not anti-aliased even with non-rectangle clipping. I wonder if this behavior is expected or a bug in Java2D, but it is consistent as I tested with WindowsXP / JDK1.6.0_18 and Windows7 / JDK1.6.0_24.

So this issue is not a bug in Pivot, but there's no workaround for Pivot users on Windows except to turn off anti-alias completely. For Pivot to workaround this issue, just have to add two lines of code to make clipping areas rectangular:

org.apache.pivot.wtk.skin.TextAreaSkinParagraphView.java
----------------------------------------
public void paint(Graphics2D graphics) {
...
// Determine the selected and unselected areas
Area selection = textAreaSkin.getSelection();
Area selectedArea = selection.createTransformedArea(AffineTransform.getTranslateInstance(-x, -y));
selectedArea.intersect(new Area(new Rectangle2D.Float(0, 0, width, height))); // workaround for PIVOT-697
Area unselectedArea = new Area();
unselectedArea.add(new Area(new Rectangle2D.Float(0, 0, width, height)));
unselectedArea.subtract(new Area(selectedArea));
unselectedArea.intersect(new Area(new Rectangle2D.Float(0, 0, width, height))); // workaround for PIVOT-697
...
}
----------------------------------------

Can you add this workaround code to Pivot?


> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: NotePadComparison-MultipleLineSelectEnglish.png, NotePadComparison-MultipleLineSelectJapanese.png, Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012448#comment-13012448 ] 

Noel Grandin commented on PIVOT-697:
------------------------------------

Nice work tracking that down Taro.
Can you check the type of graphics driver you have, and the version of the graphics driver?
And perhaps check if there is an updated driver?
Sometimes the JDK manages to tickle interesting new bugs in graphics drivers.

> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: NotePadComparison-MultipleLineSelectEnglish.png, NotePadComparison-MultipleLineSelectJapanese.png, Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Taro App (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Taro App updated PIVOT-697:
---------------------------

    Attachment: NotePadComparison-MultipleLineSelectJapanese.png
                NotePadComparison-MultipleLineSelectEnglish.png

Attached the screen shots.

> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: NotePadComparison-MultipleLineSelectEnglish.png, NotePadComparison-MultipleLineSelectJapanese.png, Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Taro App (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012345#comment-13012345 ] 

Taro App commented on PIVOT-697:
--------------------------------

Here's some more info:

On my Windows XP note PC,
((java.util.Map)Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints")).get(RenderingHints.KEY_TEXT_ANTIALIASING)
returns "LCD HRGB antialiasing text mode" so anti-alias method used should be LCD_HRGB.
(This is how Pivot determines anti-alias method in org.apache.pivot.wtk.Platform.)

Compare these two very closely:
- Test1.SingleLineSelectEnglish.png
  -> both selected and non-selected texts are anti-aliased with LCD_HRGB method.
- Test2.MultipleLineSelectEnglish.png
  -> non-selected text is rendered with LCD_HRGB method, but selected text is rendered with some other anti-alias method. (maybe LCD_VRGB?)

Windows anti-alias is something close to LCD_HRGB. Pivot anti-alias is LCD_HRGB except for multiple-line-selected text.
Who's changing anti-alias method? Java? Can Pivot do something to workaround this?

I'll run some more tests.

> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: NotePadComparison-MultipleLineSelectEnglish.png, NotePadComparison-MultipleLineSelectJapanese.png, Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Taro App (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12981608#action_12981608 ] 

Taro App commented on PIVOT-697:
--------------------------------

TextAreaFontTestJapanese.java is in UTF-8.

> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>         Attachments: Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIVOT-697) Font looks different when text is selected across multiple lines in TextArea

Posted by "Taro App (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Taro App updated PIVOT-697:
---------------------------

    Attachment: TextAreaFontTestJapanese.java
                TextAreaFontTestEnglish.java

> Font looks different when text is selected across multiple lines in TextArea
> ----------------------------------------------------------------------------
>
>                 Key: PIVOT-697
>                 URL: https://issues.apache.org/jira/browse/PIVOT-697
>             Project: Pivot
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP SP3, JDK 1.6.0_18, Japanese
>            Reporter: Taro App
>            Priority: Minor
>         Attachments: Test1.SingleLineSelectEnglish.png, Test2.MultipleLineSelectEnglish.png, Test3.SingleLineSelectJapanese.png, Test4.MultipleLineSelectJapanese.png, TextAreaFontTestEnglish.java, TextAreaFontTestJapanese.java
>
>
> Font looks different when text is selected across multiple lines in TextArea.
> When the selection is within a single line, font looks the same.
> For English text, this font change is subtle and can be ignored.
> For Japanese text, this font change is obvious and looks weird.
> I'm not sure if this is platform dependent or font dependent.
> May have something to do with how Java2D renders fonts.
> I will attach screen shots and test codes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.