提交 25d5fc7a 编写于 作者: D dmarkov

8201801: RTL language (Hebrew) is presented from left to right

Reviewed-by: prr, psadhukhan
上级 1b17beb7
...@@ -149,12 +149,27 @@ public final class SunLayoutEngine implements LayoutEngine, LayoutEngineFactory ...@@ -149,12 +149,27 @@ public final class SunLayoutEngine implements LayoutEngine, LayoutEngineFactory
this.key = key; this.key = key;
} }
private boolean isAAT(Font2D font) {
if (font instanceof TrueTypeFont) {
TrueTypeFont ttf = (TrueTypeFont)font;
return ttf.getDirectoryEntry(TrueTypeFont.morxTag) != null ||
ttf.getDirectoryEntry(TrueTypeFont.mortTag) != null;
} else if (font instanceof PhysicalFont) {
PhysicalFont pf = (PhysicalFont)font;
return pf.getTableBytes(TrueTypeFont.morxTag) != null ||
pf.getTableBytes(TrueTypeFont.mortTag) != null;
}
return false;
}
public void layout(FontStrikeDesc desc, float[] mat, int gmask, public void layout(FontStrikeDesc desc, float[] mat, int gmask,
int baseIndex, TextRecord tr, int typo_flags, int baseIndex, TextRecord tr, int typo_flags,
Point2D.Float pt, GVData data) { Point2D.Float pt, GVData data) {
Font2D font = key.font(); Font2D font = key.font();
FontStrike strike = font.getStrike(desc); FontStrike strike = font.getStrike(desc);
long layoutTables = font.getLayoutTableCache(); // Ignore layout tables for RTL AAT fonts due to lack of support in ICU
long layoutTables = (((typo_flags & 0x80000000) != 0) && isAAT(font)) ? 0 :
font.getLayoutTableCache();
nativeLayout(font, strike, mat, gmask, baseIndex, nativeLayout(font, strike, mat, gmask, baseIndex,
tr.text, tr.start, tr.limit, tr.min, tr.max, tr.text, tr.start, tr.limit, tr.min, tr.max,
key.script(), key.lang(), typo_flags, pt, data, key.script(), key.lang(), typo_flags, pt, data,
......
...@@ -79,6 +79,7 @@ public class TrueTypeFont extends FileFont { ...@@ -79,6 +79,7 @@ public class TrueTypeFont extends FileFont {
public static final int GPOSTag = 0x47504F53; // 'GPOS' public static final int GPOSTag = 0x47504F53; // 'GPOS'
public static final int GSUBTag = 0x47535542; // 'GSUB' public static final int GSUBTag = 0x47535542; // 'GSUB'
public static final int mortTag = 0x6D6F7274; // 'mort' public static final int mortTag = 0x6D6F7274; // 'mort'
public static final int morxTag = 0x6D6F7278; // 'morx'
/* -- Tags for non-standard tables */ /* -- Tags for non-standard tables */
public static final int fdscTag = 0x66647363; // 'fdsc' - gxFont descriptor public static final int fdscTag = 0x66647363; // 'fdsc' - gxFont descriptor
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册