Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
056c7ec1
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
大约 1 年 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
056c7ec1
编写于
5月 18, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[GPOS] Start filling apply() functions in
上级
4fa77d3c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
116 addition
and
50 deletion
+116
-50
src/harfbuzz-buffer-private.h
src/harfbuzz-buffer-private.h
+1
-0
src/harfbuzz-buffer.c
src/harfbuzz-buffer.c
+0
-3
src/hb-ot-layout-common-private.h
src/hb-ot-layout-common-private.h
+21
-14
src/hb-ot-layout-gpos-private.h
src/hb-ot-layout-gpos-private.h
+94
-33
未找到文件。
src/harfbuzz-buffer-private.h
浏览文件 @
056c7ec1
...
@@ -79,6 +79,7 @@ _hb_buffer_allocate_ligid( HB_Buffer buffer );
...
@@ -79,6 +79,7 @@ _hb_buffer_allocate_ligid( HB_Buffer buffer );
#define IN_LIGID( pos ) (buffer->in_string[(pos)].ligID)
#define IN_LIGID( pos ) (buffer->in_string[(pos)].ligID)
#define IN_COMPONENT( pos ) (buffer->in_string[(pos)].component)
#define IN_COMPONENT( pos ) (buffer->in_string[(pos)].component)
#define POSITION( pos ) (&buffer->positions[(pos)])
#define POSITION( pos ) (&buffer->positions[(pos)])
#define CURPOSITION() (&buffer->positions[buffer->in_pos])
#define OUT_GLYPH( pos ) (buffer->out_string[(pos)].gindex)
#define OUT_GLYPH( pos ) (buffer->out_string[(pos)].gindex)
#define OUT_ITEM( pos ) (&buffer->out_string[(pos)])
#define OUT_ITEM( pos ) (&buffer->out_string[(pos)])
...
...
src/harfbuzz-buffer.c
浏览文件 @
056c7ec1
...
@@ -354,9 +354,6 @@ HB_INTERNAL HB_Error
...
@@ -354,9 +354,6 @@ HB_INTERNAL HB_Error
_hb_buffer_replace_glyph
(
HB_Buffer
buffer
,
_hb_buffer_replace_glyph
(
HB_Buffer
buffer
,
HB_UInt
glyph_index
)
HB_UInt
glyph_index
)
{
{
HB_Error
error
;
if
(
!
buffer
->
separate_out
)
if
(
!
buffer
->
separate_out
)
{
{
buffer
->
out_string
[
buffer
->
out_pos
].
gindex
=
glyph_index
;
buffer
->
out_string
[
buffer
->
out_pos
].
gindex
=
glyph_index
;
...
...
src/hb-ot-layout-common-private.h
浏览文件 @
056c7ec1
...
@@ -404,24 +404,31 @@ ASSERT_SIZE (ClassDef, 2);
...
@@ -404,24 +404,31 @@ ASSERT_SIZE (ClassDef, 2);
*/
*/
struct
Device
{
struct
Device
{
int
get_delta
(
int
ppem_size
)
const
{
int
get_delta
(
unsigned
int
ppem_size
)
const
{
if
(
ppem_size
>=
startSize
&&
ppem_size
<=
endSize
&&
deltaFormat
>=
1
&&
deltaFormat
<=
3
)
{
int
s
=
ppem_size
-
startSize
;
int
f
=
deltaFormat
;
uint16_t
byte
=
deltaValue
[
s
>>
(
4
-
f
)]
;
unsigned
int
f
=
deltaFormat
;
uint16_t
bits
=
byte
>>
(
16
-
(((
s
&
((
1
<<
(
4
-
f
))
-
1
))
+
1
)
<<
f
));
if
(
HB_UNLIKELY
(
f
<
1
||
f
>
3
))
uint16_t
mask
=
0xFFFF
>>
(
16
-
(
1
<<
f
))
;
return
0
;
int
delta
=
bits
&
mask
;
if
(
ppem_size
<
startSize
||
ppem_size
>
endSize
)
return
0
;
if
(
delta
>=
((
mask
+
1
)
>>
1
))
unsigned
int
s
=
ppem_size
-
startSize
;
delta
-=
mask
+
1
;
return
delta
;
unsigned
int
byte
=
deltaValue
[
s
>>
(
4
-
f
)];
}
unsigned
int
bits
=
byte
>>
(
16
-
(((
s
&
((
1
<<
(
4
-
f
))
-
1
))
+
1
)
<<
f
));
return
0
;
unsigned
int
mask
=
0xFFFF
>>
(
16
-
(
1
<<
f
));
int
delta
=
bits
&
mask
;
if
(
delta
>=
((
mask
+
1
)
>>
1
))
delta
-=
mask
+
1
;
return
delta
;
}
inline
int
operator
()
(
unsigned
int
ppem_size
)
const
{
return
get_delta
(
ppem_size
);
}
}
private:
private:
...
...
src/hb-ot-layout-gpos-private.h
浏览文件 @
056c7ec1
...
@@ -67,31 +67,77 @@ struct ValueRecord {
...
@@ -67,31 +67,77 @@ struct ValueRecord {
* PosTable (may be NULL) */
* PosTable (may be NULL) */
};
};
ASSERT_SIZE (ValueRecord, 16);
ASSERT_SIZE (ValueRecord, 16);
#endif
struct ValueFormat {
struct
ValueFormat
:
USHORT
{
/* TODO */
enum
{
xPlacement
=
0x0001
,
/* Includes horizontal adjustment for placement */
yPlacement
=
0x0002
,
/* Includes vertical adjustment for placement */
xAdvance
=
0x0004
,
/* Includes horizontal adjustment for advance */
yAdvance
=
0x0008
,
/* Includes vertical adjustment for advance */
xPlaDevice
=
0x0010
,
/* Includes horizontal Device table for placement */
yPlaDevice
=
0x0020
,
/* Includes vertical Device table for placement */
xAdvDevice
=
0x0040
,
/* Includes horizontal Device table for advance */
yAdvDevice
=
0x0080
,
/* Includes vertical Device table for advance */
reserved
=
0xF000
,
/* For future use */
};
inline
unsigned
int
get_len
()
const
{
return
_hb_popcount32
((
unsigned
int
)
*
this
);
}
private:
const
Value
*
apply_value
(
hb_ot_layout_t
*
layout
,
0x0001 xPlacement; /* Includes horizontal adjustment
const
char
*
base
,
* for placement */
const
Value
*
values
,
0x0002 yPlacement; /* Includes vertical adjustment for
HB_Position
glyph_pos
)
const
* placement */
{
0x0004 xAdvance; /* Includes horizontal adjustment
unsigned
int
x_ppem
,
y_ppem
;
* for advance */
hb_16dot16_t
x_scale
,
y_scale
;
0x0008 yAdvance; /* Includes vertical adjustment for
unsigned
int
pixel_value
;
* advance */
unsigned
int
format
=
*
this
;
0x0010 xPlaDevice; /* Includes horizontal Device table
* for placement */
if
(
!
format
)
0x0020 yPlaDevice; /* Includes vertical Device table
return
values
;
* for placement */
0x0040 xAdvDevice; /* Includes horizontal Device table
x_scale
=
layout
->
gpos_info
.
x_scale
;
* for advance */
y_scale
=
layout
->
gpos_info
.
y_scale
;
0x0080 yAdvDevice; /* Includes vertical Device table
/* design units -> fractional pixel */
* for advance */
if
(
format
&
xPlacement
)
0xF000 reserved; /* For future use */
glyph_pos
->
x_pos
+=
x_scale
*
*
(
USHORT
*
)
values
++
/
0x10000
;
};
if
(
format
&
yPlacement
)
ASSERT_SIZE (ValueFormat, 18);
glyph_pos
->
y_pos
+=
y_scale
*
*
(
USHORT
*
)
values
++
/
0x10000
;
#endif
if
(
format
&
xAdvance
)
glyph_pos
->
x_advance
+=
x_scale
*
*
(
USHORT
*
)
values
++
/
0x10000
;
if
(
format
&
yAdvance
)
glyph_pos
->
y_advance
+=
y_scale
*
*
(
USHORT
*
)
values
++
/
0x10000
;
if
(
HB_LIKELY
(
!
layout
->
gpos_info
.
dvi
))
{
x_ppem
=
layout
->
gpos_info
.
x_ppem
;
y_ppem
=
layout
->
gpos_info
.
y_ppem
;
/* pixel -> fractional pixel */
if
(
format
&
xPlaDevice
)
glyph_pos
->
x_pos
+=
(
base
+*
(
OffsetTo
<
Device
>*
)
values
++
).
get_delta
(
x_ppem
)
<<
6
;
if
(
format
&
yPlaDevice
)
glyph_pos
->
y_pos
+=
(
base
+*
(
OffsetTo
<
Device
>*
)
values
++
).
get_delta
(
y_ppem
)
<<
6
;
if
(
format
&
xAdvDevice
)
glyph_pos
->
x_advance
+=
(
base
+*
(
OffsetTo
<
Device
>*
)
values
++
).
get_delta
(
x_ppem
)
<<
6
;
if
(
format
&
yAdvDevice
)
glyph_pos
->
y_advance
+=
(
base
+*
(
OffsetTo
<
Device
>*
)
values
++
).
get_delta
(
y_ppem
)
<<
6
;
}
else
{
if
(
format
&
xPlaDevice
)
values
++
;
if
(
format
&
yPlaDevice
)
values
++
;
if
(
format
&
xAdvDevice
)
values
++
;
if
(
format
&
yAdvDevice
)
values
++
;
}
return
values
;
}
};
ASSERT_SIZE
(
ValueFormat
,
2
);
struct
AnchorFormat1
{
struct
AnchorFormat1
{
...
@@ -212,8 +258,13 @@ struct SinglePosFormat1 {
...
@@ -212,8 +258,13 @@ struct SinglePosFormat1 {
private:
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
/* TODO */
return
false
;
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
valueFormat
.
apply_value
(
layout
,
(
const
char
*
)
this
,
values
,
CURPOSITION
());
return
true
;
}
}
private:
private:
...
@@ -221,7 +272,7 @@ struct SinglePosFormat1 {
...
@@ -221,7 +272,7 @@ struct SinglePosFormat1 {
OffsetTo
<
Coverage
>
OffsetTo
<
Coverage
>
coverage
;
/* Offset to Coverage table--from
coverage
;
/* Offset to Coverage table--from
* beginning of subtable */
* beginning of subtable */
USHORT
valueFormat
;
/* Defines the types of data in the
ValueFormat
valueFormat
;
/* Defines the types of data in the
* ValueRecord */
* ValueRecord */
ValueRecord
values
;
/* Defines positioning
ValueRecord
values
;
/* Defines positioning
* value(s)--applied to all glyphs in
* value(s)--applied to all glyphs in
...
@@ -235,8 +286,18 @@ struct SinglePosFormat2 {
...
@@ -235,8 +286,18 @@ struct SinglePosFormat2 {
private:
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
/* TODO */
return
false
;
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
if
(
HB_LIKELY
(
index
>=
valueCount
))
return
false
;
valueFormat
.
apply_value
(
layout
,
(
const
char
*
)
this
,
values
+
index
*
valueFormat
.
get_len
(),
CURPOSITION
());
return
true
;
}
}
private:
private:
...
@@ -244,7 +305,7 @@ struct SinglePosFormat2 {
...
@@ -244,7 +305,7 @@ struct SinglePosFormat2 {
OffsetTo
<
Coverage
>
OffsetTo
<
Coverage
>
coverage
;
/* Offset to Coverage table--from
coverage
;
/* Offset to Coverage table--from
* beginning of subtable */
* beginning of subtable */
USHORT
valueFormat
;
/* Defines the types of data in the
ValueFormat
valueFormat
;
/* Defines the types of data in the
* ValueRecord */
* ValueRecord */
USHORT
valueCount
;
/* Number of ValueRecords */
USHORT
valueCount
;
/* Number of ValueRecords */
ValueRecord
values
;
/* Array of ValueRecords--positioning
ValueRecord
values
;
/* Array of ValueRecords--positioning
...
@@ -307,10 +368,10 @@ struct PairPosFormat1 {
...
@@ -307,10 +368,10 @@ struct PairPosFormat1 {
OffsetTo
<
Coverage
>
OffsetTo
<
Coverage
>
coverage
;
/* Offset to Coverage table--from
coverage
;
/* Offset to Coverage table--from
* beginning of subtable */
* beginning of subtable */
USHORT
valueFormat1
;
/* Defines the types of data in
ValueFormat
valueFormat1
;
/* Defines the types of data in
* ValueRecord1--for the first glyph
* ValueRecord1--for the first glyph
* in the pair--may be zero (0) */
* in the pair--may be zero (0) */
USHORT
valueFormat2
;
/* Defines the types of data in
ValueFormat
valueFormat2
;
/* Defines the types of data in
* ValueRecord2--for the second glyph
* ValueRecord2--for the second glyph
* in the pair--may be zero (0) */
* in the pair--may be zero (0) */
OffsetArrayOf
<
PairSet
>
OffsetArrayOf
<
PairSet
>
...
@@ -334,10 +395,10 @@ struct PairPosFormat2 {
...
@@ -334,10 +395,10 @@ struct PairPosFormat2 {
OffsetTo
<
Coverage
>
OffsetTo
<
Coverage
>
coverage
;
/* Offset to Coverage table--from
coverage
;
/* Offset to Coverage table--from
* beginning of subtable */
* beginning of subtable */
USHORT
valueFormat1
;
/* ValueRecord definition--for the
ValueFormat
valueFormat1
;
/* ValueRecord definition--for the
* first glyph of the pair--may be zero
* first glyph of the pair--may be zero
* (0) */
* (0) */
USHORT
valueFormat2
;
/* ValueRecord definition--for the
ValueFormat
valueFormat2
;
/* ValueRecord definition--for the
* second glyph of the pair--may be
* second glyph of the pair--may be
* zero (0) */
* zero (0) */
OffsetTo
<
ClassDef
>
OffsetTo
<
ClassDef
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录