Skip to content

Commit 9397535

Browse files
Daniel GredlerHarshitha Onkar
authored andcommitted
8356803: Test TextLayout/TestControls fails on windows & linux: line and paragraph separator show non-zero advance
8356812: Create an automated version of TextLayout/TestControls Reviewed-by: prr, honkar
1 parent da49fa5 commit 9397535

File tree

3 files changed

+54
-175
lines changed

3 files changed

+54
-175
lines changed

src/java.desktop/share/classes/sun/font/FontUtilities.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,17 +370,25 @@ public static boolean isDefaultIgnorable(int charCode) {
370370
}
371371

372372
/**
373-
* Checks whether or not the specified codepoint is whitespace which is
373+
* <p>Checks whether or not the specified codepoint is whitespace which is
374374
* ignorable at the shaping stage of text rendering. These ignorable
375375
* whitespace characters should be used prior to text shaping and
376376
* rendering to determine the position of the text, but are not themselves
377377
* rendered.
378378
*
379+
* <p>Includes 0x0009 (horizontal tab / TAB), 0x000A (line feed / LF),
380+
* 0x000B (vertical tab / VT), 0x000C (form feed / FF),
381+
* 0x000D (carriage return / CR), 0x0085 (next line / NEL),
382+
* 0x2028 (line separator / LS), 0x2029 (paragraph separator / PS).
383+
*
379384
* @param ch the codepoint to check
380385
* @return whether the specified codepoint is ignorable whitespace
381386
*/
382387
public static boolean isIgnorableWhitespace(int ch) {
383-
return ch == 0x0009 || ch == 0x000a || ch == 0x000d;
388+
return (ch >= 0x0009 && ch <= 0x000d)
389+
|| ch == 0x0085
390+
|| ch == 0x2028
391+
|| ch == 0x2029;
384392
}
385393

386394
public static PlatformLogger getLogger() {

0 commit comments

Comments
 (0)