1 /*
2 * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
35 * concept of RUNS_ONLY which is a double operation.
36 * It could be advantageous to divide this into 3 concepts:
37 * a) Operation: direct / inverse / RUNS_ONLY
38 * b) Direct algorithm: default / NUMBERS_SPECIAL / GROUP_NUMBERS_WITH_L
39 * c) Inverse algorithm: default / INVERSE_LIKE_DIRECT / NUMBERS_SPECIAL
40 * This would allow combinations not possible today like RUNS_ONLY with
41 * NUMBERS_SPECIAL.
42 * Also allow to set INSERT_MARKS for the direct step of RUNS_ONLY and
43 * REMOVE_CONTROLS for the inverse step.
44 * Not all combinations would be supported, and probably not all do make sense.
45 * This would need to document which ones are supported and what are the
46 * fallbacks for unsupported combinations.
47 */
48
49 package sun.text.bidi;
50
51 import java.lang.reflect.Array;
52 import java.text.AttributedCharacterIterator;
53 import java.text.Bidi;
54 import java.util.Arrays;
55 import jdk.internal.misc.JavaAWTFontAccess;
56 import jdk.internal.misc.SharedSecrets;
57 import sun.text.normalizer.UBiDiProps;
58 import sun.text.normalizer.UCharacter;
59 import sun.text.normalizer.UTF16;
60
61 /**
62 *
63 * <h2>Bidi algorithm for ICU</h2>
64 *
65 * This is an implementation of the Unicode Bidirectional Algorithm. The
66 * algorithm is defined in the <a
67 * href="http://www.unicode.org/unicode/reports/tr9/">Unicode Standard Annex #9</a>.
68 * <p>
69 *
70 * Note: Libraries that perform a bidirectional algorithm and reorder strings
71 * accordingly are sometimes called "Storage Layout Engines". ICU's Bidi and
72 * shaping (ArabicShaping) classes can be used at the core of such "Storage
73 * Layout Engines".
74 *
75 * <h3>General remarks about the API:</h3>
76 *
|
1 /*
2 * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
35 * concept of RUNS_ONLY which is a double operation.
36 * It could be advantageous to divide this into 3 concepts:
37 * a) Operation: direct / inverse / RUNS_ONLY
38 * b) Direct algorithm: default / NUMBERS_SPECIAL / GROUP_NUMBERS_WITH_L
39 * c) Inverse algorithm: default / INVERSE_LIKE_DIRECT / NUMBERS_SPECIAL
40 * This would allow combinations not possible today like RUNS_ONLY with
41 * NUMBERS_SPECIAL.
42 * Also allow to set INSERT_MARKS for the direct step of RUNS_ONLY and
43 * REMOVE_CONTROLS for the inverse step.
44 * Not all combinations would be supported, and probably not all do make sense.
45 * This would need to document which ones are supported and what are the
46 * fallbacks for unsupported combinations.
47 */
48
49 package sun.text.bidi;
50
51 import java.lang.reflect.Array;
52 import java.text.AttributedCharacterIterator;
53 import java.text.Bidi;
54 import java.util.Arrays;
55 import jdk.internal.access.JavaAWTFontAccess;
56 import jdk.internal.access.SharedSecrets;
57 import sun.text.normalizer.UBiDiProps;
58 import sun.text.normalizer.UCharacter;
59 import sun.text.normalizer.UTF16;
60
61 /**
62 *
63 * <h2>Bidi algorithm for ICU</h2>
64 *
65 * This is an implementation of the Unicode Bidirectional Algorithm. The
66 * algorithm is defined in the <a
67 * href="http://www.unicode.org/unicode/reports/tr9/">Unicode Standard Annex #9</a>.
68 * <p>
69 *
70 * Note: Libraries that perform a bidirectional algorithm and reorder strings
71 * accordingly are sometimes called "Storage Layout Engines". ICU's Bidi and
72 * shaping (ArabicShaping) classes can be used at the core of such "Storage
73 * Layout Engines".
74 *
75 * <h3>General remarks about the API:</h3>
76 *
|