Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
66d85601
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
66d85601
编写于
4月 25, 2013
作者:
P
prr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8012421: Better positioning of PairPositioning
Reviewed-by: srl, mschoene, vadim
上级
46117574
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
10 deletion
+22
-10
src/share/native/sun/font/layout/PairPositioningSubtables.cpp
...share/native/sun/font/layout/PairPositioningSubtables.cpp
+19
-8
src/share/native/sun/font/layout/PairPositioningSubtables.h
src/share/native/sun/font/layout/PairPositioningSubtables.h
+3
-2
未找到文件。
src/share/native/sun/font/layout/PairPositioningSubtables.cpp
浏览文件 @
66d85601
...
@@ -76,23 +76,30 @@ le_uint32 PairPositioningFormat1Subtable::process(const LEReferenceTo<PairPositi
...
@@ -76,23 +76,30 @@ le_uint32 PairPositioningFormat1Subtable::process(const LEReferenceTo<PairPositi
{
{
LEGlyphID
firstGlyph
=
glyphIterator
->
getCurrGlyphID
();
LEGlyphID
firstGlyph
=
glyphIterator
->
getCurrGlyphID
();
le_int32
coverageIndex
=
getGlyphCoverage
(
base
,
firstGlyph
,
success
);
le_int32
coverageIndex
=
getGlyphCoverage
(
base
,
firstGlyph
,
success
);
if
(
LE_FAILURE
(
success
))
{
return
0
;
}
GlyphIterator
tempIterator
(
*
glyphIterator
);
GlyphIterator
tempIterator
(
*
glyphIterator
);
if
(
coverageIndex
>=
0
&&
glyphIterator
->
next
())
{
if
(
coverageIndex
>=
0
&&
glyphIterator
->
next
())
{
Offset
pairSetTableOffset
=
SWAPW
(
pairSetTableOffsetArray
[
coverageIndex
]);
Offset
pairSetTableOffset
=
SWAPW
(
pairSetTableOffsetArray
[
coverageIndex
]);
PairSetTable
*
pairSetTable
=
(
PairSetTable
*
)
((
char
*
)
this
+
pairSetTableOffset
);
LEReferenceTo
<
PairSetTable
>
pairSetTable
(
base
,
success
,
((
char
*
)
this
+
pairSetTableOffset
));
if
(
LE_FAILURE
(
success
))
{
return
0
;
}
le_uint16
pairValueCount
=
SWAPW
(
pairSetTable
->
pairValueCount
);
le_uint16
pairValueCount
=
SWAPW
(
pairSetTable
->
pairValueCount
);
le_int16
valueRecord1Size
=
ValueRecord
::
getSize
(
SWAPW
(
valueFormat1
));
le_int16
valueRecord1Size
=
ValueRecord
::
getSize
(
SWAPW
(
valueFormat1
));
le_int16
valueRecord2Size
=
ValueRecord
::
getSize
(
SWAPW
(
valueFormat2
));
le_int16
valueRecord2Size
=
ValueRecord
::
getSize
(
SWAPW
(
valueFormat2
));
le_int16
recordSize
=
sizeof
(
PairValueRecord
)
-
sizeof
(
ValueRecord
)
+
valueRecord1Size
+
valueRecord2Size
;
le_int16
recordSize
=
sizeof
(
PairValueRecord
)
-
sizeof
(
ValueRecord
)
+
valueRecord1Size
+
valueRecord2Size
;
LEGlyphID
secondGlyph
=
glyphIterator
->
getCurrGlyphID
();
LEGlyphID
secondGlyph
=
glyphIterator
->
getCurrGlyphID
();
const
PairValueRecord
*
pairValueRecord
=
NULL
;
LEReferenceTo
<
PairValueRecord
>
pairValueRecord
;
if
(
pairValueCount
!=
0
)
{
if
(
pairValueCount
!=
0
)
{
pairValueRecord
=
findPairValueRecord
(
(
TTGlyphID
)
LE_GET_GLYPH
(
secondGlyph
),
pairSetTable
->
pairValueRecordArray
,
pairValueCount
,
recordSize
);
pairValueRecord
=
findPairValueRecord
(
base
,
(
TTGlyphID
)
LE_GET_GLYPH
(
secondGlyph
),
pairSetTable
->
pairValueRecordArray
,
pairValueCount
,
recordSize
,
success
);
}
}
if
(
pairValueRecord
==
NULL
)
{
if
(
pairValueRecord
.
isEmpty
()
)
{
return
0
;
return
0
;
}
}
...
@@ -154,22 +161,26 @@ le_uint32 PairPositioningFormat2Subtable::process(const LEReferenceTo<PairPositi
...
@@ -154,22 +161,26 @@ le_uint32 PairPositioningFormat2Subtable::process(const LEReferenceTo<PairPositi
return
0
;
return
0
;
}
}
const
PairValueRecord
*
PairPositioningFormat1Subtable
::
findPairValueRecord
(
TTGlyphID
glyphID
,
const
PairValueRecord
*
records
,
le_uint16
recordCount
,
le_uint16
recordSize
)
const
LEReferenceTo
<
PairValueRecord
>
PairPositioningFormat1Subtable
::
findPairValueRecord
(
const
LETableReference
&
base
,
TTGlyphID
glyphID
,
const
PairValueRecord
*
records
,
le_uint16
recordCount
,
le_uint16
recordSize
,
LEErrorCode
&
success
)
const
{
{
#if 1
#if 1
// The OpenType spec. says that the ValueRecord table is
// The OpenType spec. says that the ValueRecord table is
// sorted by secondGlyph. Unfortunately, there are fonts
// sorted by secondGlyph. Unfortunately, there are fonts
// around that have an unsorted ValueRecord table.
// around that have an unsorted ValueRecord table.
const
PairValueRecord
*
record
=
records
;
LEReferenceTo
<
PairValueRecord
>
record
(
base
,
success
,
records
);
record
.
verifyLength
(
0
,
recordSize
,
success
);
for
(
le_int32
r
=
0
;
r
<
recordCount
;
r
+=
1
)
{
for
(
le_int32
r
=
0
;
r
<
recordCount
;
r
+=
1
)
{
if
(
LE_FAILURE
(
success
))
return
(
const
PairValueRecord
*
)
NULL
;
if
(
SWAPW
(
record
->
secondGlyph
)
==
glyphID
)
{
if
(
SWAPW
(
record
->
secondGlyph
)
==
glyphID
)
{
return
record
;
return
record
;
}
}
record
=
(
const
PairValueRecord
*
)
((
char
*
)
record
+
recordSize
);
record
=
LEReferenceTo
<
PairValueRecord
>
(
base
,
success
,
((
const
char
*
)
record
.
getAlias
())
+
recordSize
);
record
.
verifyLength
(
0
,
recordSize
,
success
);
}
}
#else
#else
#error dead code - not updated.
le_uint8
bit
=
OpenTypeUtilities
::
highBit
(
recordCount
);
le_uint8
bit
=
OpenTypeUtilities
::
highBit
(
recordCount
);
le_uint16
power
=
1
<<
bit
;
le_uint16
power
=
1
<<
bit
;
le_uint16
extra
=
(
recordCount
-
power
)
*
recordSize
;
le_uint16
extra
=
(
recordCount
-
power
)
*
recordSize
;
...
@@ -195,7 +206,7 @@ const PairValueRecord *PairPositioningFormat1Subtable::findPairValueRecord(TTGly
...
@@ -195,7 +206,7 @@ const PairValueRecord *PairPositioningFormat1Subtable::findPairValueRecord(TTGly
}
}
#endif
#endif
return
NULL
;
return
(
const
PairValueRecord
*
)
NULL
;
}
}
U_NAMESPACE_END
U_NAMESPACE_END
src/share/native/sun/font/layout/PairPositioningSubtables.h
浏览文件 @
66d85601
...
@@ -77,8 +77,9 @@ struct PairPositioningFormat1Subtable : PairPositioningSubtable
...
@@ -77,8 +77,9 @@ struct PairPositioningFormat1Subtable : PairPositioningSubtable
le_uint32
process
(
const
LEReferenceTo
<
PairPositioningFormat1Subtable
>
&
base
,
GlyphIterator
*
glyphIterator
,
const
LEFontInstance
*
fontInstance
,
LEErrorCode
&
success
)
const
;
le_uint32
process
(
const
LEReferenceTo
<
PairPositioningFormat1Subtable
>
&
base
,
GlyphIterator
*
glyphIterator
,
const
LEFontInstance
*
fontInstance
,
LEErrorCode
&
success
)
const
;
private:
private:
const
PairValueRecord
*
findPairValueRecord
(
TTGlyphID
glyphID
,
const
PairValueRecord
*
records
,
LEReferenceTo
<
PairValueRecord
>
findPairValueRecord
(
const
LETableReference
&
base
,
TTGlyphID
glyphID
,
const
PairValueRecord
*
records
,
le_uint16
recordCount
,
le_uint16
recordSize
)
const
;
le_uint16
recordCount
,
le_uint16
recordSize
,
LEErrorCode
&
success
)
const
;
};
};
LE_VAR_ARRAY
(
PairPositioningFormat1Subtable
,
pairSetTableOffsetArray
)
LE_VAR_ARRAY
(
PairPositioningFormat1Subtable
,
pairSetTableOffsetArray
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录