-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0, 1.2.2
-
None
-
1.2.2
-
generic, sparc
-
solaris_2.5, windows_nt
If a Font is not specified directly (with the TextAttribute.FONT key) and TextLayout finds a character which is not displayable in the current Font, TextLayout will search for a Font which can display the character. The actual search is in SunGraphicsEnvironment.getBestFontFor. TextLayout uses maximal Font runs; that is, it displays as many characters as possible before switching Fonts.
Here's the problem with this approach. Consider the text: AB<aleph><bet>AB - all in one style run with no Font specified. Suppose initially TextLayout selects a Font with Latin-1, but not Hebrew. The first two characters will be in this Font. Then it hits the Hebrew, and switches to a Font like Cyberbit. Then the second AB sequence is in a different Font than the first, even though they have the same style. This creates a bug in TextMeasurer, where text is measured in one Font and drawn in another.
Once text is measured in a particular font, it should remain in that font.
Here's the problem with this approach. Consider the text: AB<aleph><bet>AB - all in one style run with no Font specified. Suppose initially TextLayout selects a Font with Latin-1, but not Hebrew. The first two characters will be in this Font. Then it hits the Hebrew, and switches to a Font like Cyberbit. Then the second AB sequence is in a different Font than the first, even though they have the same style. This creates a bug in TextMeasurer, where text is measured in one Font and drawn in another.
Once text is measured in a particular font, it should remain in that font.
- duplicates
-
JDK-4202637 GraphicAttribute method of placement failing to apply properly.
-
- Closed
-