JBR-4114 Rollback JBR-10 fix

This commit is contained in:
Dmitry Batrak
2021-12-13 12:20:59 +03:00
parent 761239703b
commit c785b3de0e
2 changed files with 5 additions and 22 deletions

View File

@@ -81,14 +81,6 @@ import java.util.concurrent.ConcurrentHashMap;
import static java.lang.Character.*;
public final class GlyphLayout {
/**
* A flag to layoutGlyphVector requesting to disable detection of paired characters
* when splitting text into scripts.
*
* TODO: move to java.awt.Font when upstreaming the fix
*/
private static final int LAYOUT_NO_PAIRED_CHARS_AT_SCRIPT_SPLIT = 8;
// data for glyph vector
private GVData _gvdata;
@@ -377,8 +369,6 @@ public final class GlyphLayout {
init(count);
boolean handlePairedChars = (flags & LAYOUT_NO_PAIRED_CHARS_AT_SCRIPT_SPLIT) == 0;
// need to set after init
// go through the back door for this
if (font.hasLayoutAttributes()) {
@@ -424,7 +414,7 @@ public final class GlyphLayout {
_textRecord.init(text, offset, lim, min, max);
int start = offset;
if (font2D instanceof CompositeFont) {
_scriptRuns.init(text, offset, count, handlePairedChars); // ??? how to handle 'common' chars
_scriptRuns.init(text, offset, count); // ??? how to handle 'common' chars
_fontRuns.init((CompositeFont)font2D, text, offset, lim);
while (_scriptRuns.next()) {
int limit = _scriptRuns.getScriptLimit();
@@ -447,7 +437,7 @@ public final class GlyphLayout {
}
}
} else {
_scriptRuns.init(text, offset, count, handlePairedChars); // ??? don't worry about 'common' chars
_scriptRuns.init(text, offset, count); // ??? don't worry about 'common' chars
while (_scriptRuns.next()) {
int limit = _scriptRuns.getScriptLimit();
int script = _scriptRuns.getScriptCode();

View File

@@ -43,7 +43,7 @@ package sun.font;
* COMMON and INHERITED characters are first, they will be assigned to
* the same script as the following characters.
*
* The iterator will try (optionally) to match paired punctuation. If it sees an
* The iterator will try to match paired punctuation. If it sees an
* opening punctuation character, it will remember the script that
* was assigned to that character, and assign the same script to the
* matching closing punctuation.
@@ -83,8 +83,6 @@ public final class ScriptRun
private int stack[]; // stack used to handle paired punctuation if encountered
private int parenSP;
private boolean handlePairedChars;
public ScriptRun() {
// must call init later or we die.
}
@@ -102,11 +100,7 @@ public final class ScriptRun
init(chars, start, count);
}
public void init(char[] chars, int start, int count) {
init(chars, start, count, true);
}
public void init(char[] chars, int start, int count, boolean pairedChars)
public void init(char[] chars, int start, int count)
{
if (chars == null || start < 0 || count < 0 || count > chars.length - start) {
throw new IllegalArgumentException();
@@ -120,7 +114,6 @@ public final class ScriptRun
scriptLimit = textStart;
scriptCode = Script.INVALID_CODE;
parenSP = 0;
handlePairedChars = pairedChars;
}
/**
@@ -172,7 +165,7 @@ public final class ScriptRun
while ((ch = nextCodePoint()) != DONE) {
int sc = ScriptRunData.getScript(ch);
int pairIndex = handlePairedChars && sc == Script.COMMON ? getPairIndex(ch) : -1;
int pairIndex = sc == Script.COMMON ? getPairIndex(ch) : -1;
// Paired character handling:
//