< prev index next >
jdk/test/java/awt/font/NumericShaper/ShapingTest.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 21,31 ****
* questions.
*/
/*
* @test
! * @bug 6842557 6943963 6959267
* @summary confirm that shaping works as expected. (Mainly for new characters which were added in Unicode 5 and 6)
* used where appropriate.
*/
import java.awt.font.NumericShaper;
--- 21,31 ----
* questions.
*/
/*
* @test
! * @bug 6842557 6943963 6959267 8032446
* @summary confirm that shaping works as expected. (Mainly for new characters which were added in Unicode 5 and 6)
* used where appropriate.
*/
import java.awt.font.NumericShaper;
*** 38,47 ****
--- 38,48 ----
public static void main(String[] args) {
test6842557();
test6943963();
test6903266();
+ test8032446();
if (err) {
throw new RuntimeException("shape() returned unexpected value.");
}
}
*** 136,145 ****
--- 137,158 ----
given = "\uabc0 012";
expected = "\uabc0 \uabf0\uabf1\uabf2";
checkResult("Range.MEETEI_MAYEK", ns, given, expected);
}
+ private static void test8032446() {
+ NumericShaper ns = getContextualShaper(EnumSet.of(Range.SINHALA));
+ String given = "\u0d85 012";
+ String expected = "\u0d85 \u0de6\u0de7\u0de8";
+ checkResult("Range.SINHALA", ns, given, expected);
+
+ ns = getContextualShaper(EnumSet.of(Range.MYANMAR_TAI_LAING));
+ given = "\ua9e2 012";
+ expected = "\ua9e2 \ua9f0\ua9f1\ua9f2";
+ checkResult("Range.MYANMAR_TAI_LAING", ns, given, expected);
+ }
+
private static void checkResult(String ranges, NumericShaper ns,
String given, String expected) {
char[] text = given.toCharArray();
ns.shape(text, 0, text.length);
String got = new String(text);
< prev index next >