[
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