Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
3109375b
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看板
提交
3109375b
编写于
5月 14, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove POSITION() and CURPOSITION() macros
上级
d7cfb3b2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
34 deletion
+32
-34
src/hb-buffer-private.hh
src/hb-buffer-private.hh
+0
-2
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+27
-27
src/hb-shape.cc
src/hb-shape.cc
+5
-5
未找到文件。
src/hb-buffer-private.hh
浏览文件 @
3109375b
...
...
@@ -165,8 +165,6 @@ struct _hb_buffer_t {
#define IN_CLUSTER(pos) (BUFFER->in_string[(pos)].cluster)
#define IN_LIGID(pos) (BUFFER->in_string[(pos)].lig_id)
#define IN_COMPONENT(pos) (BUFFER->in_string[(pos)].component)
#define POSITION(pos) (&BUFFER->positions[(pos)])
#define CURPOSITION() (&BUFFER->positions[BUFFER->in_pos])
#define OUT_GLYPH(pos) (BUFFER->out_string[(pos)].codepoint)
#define OUT_INFO(pos) (&BUFFER->out_string[(pos)])
...
...
src/hb-ot-layout-gpos-private.hh
浏览文件 @
3109375b
...
...
@@ -94,7 +94,7 @@ struct ValueFormat : USHORT
void
apply_value
(
hb_ot_layout_context_t
*
layout
,
const
void
*
base
,
const
Value
*
values
,
hb_internal_glyph_position_t
*
glyph_pos
)
const
hb_internal_glyph_position_t
&
glyph_pos
)
const
{
unsigned
int
x_ppem
,
y_ppem
;
hb_16dot16_t
x_scale
,
y_scale
;
...
...
@@ -105,10 +105,10 @@ struct ValueFormat : USHORT
x_scale
=
layout
->
font
->
x_scale
;
y_scale
=
layout
->
font
->
y_scale
;
/* design units -> fractional pixel */
if
(
format
&
xPlacement
)
glyph_pos
->
x_offset
+=
_hb_16dot16_mul_round
(
x_scale
,
get_short
(
values
++
));
if
(
format
&
yPlacement
)
glyph_pos
->
y_offset
+=
_hb_16dot16_mul_round
(
y_scale
,
get_short
(
values
++
));
if
(
format
&
xAdvance
)
glyph_pos
->
x_advance
+=
_hb_16dot16_mul_round
(
x_scale
,
get_short
(
values
++
));
if
(
format
&
yAdvance
)
glyph_pos
->
y_advance
+=
_hb_16dot16_mul_round
(
y_scale
,
get_short
(
values
++
));
if
(
format
&
xPlacement
)
glyph_pos
.
x_offset
+=
_hb_16dot16_mul_round
(
x_scale
,
get_short
(
values
++
));
if
(
format
&
yPlacement
)
glyph_pos
.
y_offset
+=
_hb_16dot16_mul_round
(
y_scale
,
get_short
(
values
++
));
if
(
format
&
xAdvance
)
glyph_pos
.
x_advance
+=
_hb_16dot16_mul_round
(
x_scale
,
get_short
(
values
++
));
if
(
format
&
yAdvance
)
glyph_pos
.
y_advance
+=
_hb_16dot16_mul_round
(
y_scale
,
get_short
(
values
++
));
if
(
!
has_device
())
return
;
...
...
@@ -119,16 +119,16 @@ struct ValueFormat : USHORT
/* pixel -> fractional pixel */
if
(
format
&
xPlaDevice
)
{
if
(
x_ppem
)
glyph_pos
->
x_offset
+=
(
base
+
get_device
(
values
++
)).
get_delta
(
x_ppem
)
<<
16
;
else
values
++
;
if
(
x_ppem
)
glyph_pos
.
x_offset
+=
(
base
+
get_device
(
values
++
)).
get_delta
(
x_ppem
)
<<
16
;
else
values
++
;
}
if
(
format
&
yPlaDevice
)
{
if
(
y_ppem
)
glyph_pos
->
y_offset
+=
(
base
+
get_device
(
values
++
)).
get_delta
(
y_ppem
)
<<
16
;
else
values
++
;
if
(
y_ppem
)
glyph_pos
.
y_offset
+=
(
base
+
get_device
(
values
++
)).
get_delta
(
y_ppem
)
<<
16
;
else
values
++
;
}
if
(
format
&
xAdvDevice
)
{
if
(
x_ppem
)
glyph_pos
->
x_advance
+=
(
base
+
get_device
(
values
++
)).
get_delta
(
x_ppem
)
<<
16
;
else
values
++
;
if
(
x_ppem
)
glyph_pos
.
x_advance
+=
(
base
+
get_device
(
values
++
)).
get_delta
(
x_ppem
)
<<
16
;
else
values
++
;
}
if
(
format
&
yAdvDevice
)
{
if
(
y_ppem
)
glyph_pos
->
y_advance
+=
(
base
+
get_device
(
values
++
)).
get_delta
(
y_ppem
)
<<
16
;
else
values
++
;
if
(
y_ppem
)
glyph_pos
.
y_advance
+=
(
base
+
get_device
(
values
++
)).
get_delta
(
y_ppem
)
<<
16
;
else
values
++
;
}
}
...
...
@@ -406,12 +406,12 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
mark_anchor
.
get_anchor
(
c
->
layout
,
IN_CURGLYPH
(),
&
mark_x
,
&
mark_y
);
glyph_anchor
.
get_anchor
(
c
->
layout
,
IN_GLYPH
(
glyph_pos
),
&
base_x
,
&
base_y
);
hb_internal_glyph_position_t
*
o
=
POSITION
(
c
->
buffer
->
in_pos
)
;
o
->
x_advance
=
0
;
o
->
y_advance
=
0
;
o
->
x_offset
=
base_x
-
mark_x
;
o
->
y_offset
=
base_y
-
mark_y
;
o
->
back
=
c
->
buffer
->
in_pos
-
glyph_pos
;
hb_internal_glyph_position_t
&
o
=
c
->
buffer
->
positions
[
c
->
buffer
->
in_pos
]
;
o
.
x_advance
=
0
;
o
.
y_advance
=
0
;
o
.
x_offset
=
base_x
-
mark_x
;
o
.
y_offset
=
base_y
-
mark_y
;
o
.
back
=
c
->
buffer
->
in_pos
-
glyph_pos
;
c
->
buffer
->
in_pos
++
;
return
true
;
...
...
@@ -438,7 +438,7 @@ struct SinglePosFormat1
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
valueFormat
.
apply_value
(
c
->
layout
,
this
,
values
,
CURPOSITION
()
);
valueFormat
.
apply_value
(
c
->
layout
,
this
,
values
,
c
->
buffer
->
positions
[
c
->
buffer
->
in_pos
]
);
c
->
buffer
->
in_pos
++
;
return
true
;
...
...
@@ -482,7 +482,7 @@ struct SinglePosFormat2
valueFormat
.
apply_value
(
c
->
layout
,
this
,
&
values
[
index
*
valueFormat
.
get_len
()],
CURPOSITION
()
);
c
->
buffer
->
positions
[
c
->
buffer
->
in_pos
]
);
c
->
buffer
->
in_pos
++
;
return
true
;
...
...
@@ -576,8 +576,8 @@ struct PairSet
{
if
(
IN_GLYPH
(
pos
)
==
record
->
secondGlyph
)
{
valueFormats
[
0
].
apply_value
(
c
->
layout
,
this
,
&
record
->
values
[
0
],
CURPOSITION
()
);
valueFormats
[
1
].
apply_value
(
c
->
layout
,
this
,
&
record
->
values
[
len1
],
POSITION
(
pos
)
);
valueFormats
[
0
].
apply_value
(
c
->
layout
,
this
,
&
record
->
values
[
0
],
c
->
buffer
->
positions
[
c
->
buffer
->
in_pos
]
);
valueFormats
[
1
].
apply_value
(
c
->
layout
,
this
,
&
record
->
values
[
len1
],
c
->
buffer
->
positions
[
pos
]
);
if
(
len2
)
pos
++
;
c
->
buffer
->
in_pos
=
pos
;
...
...
@@ -711,8 +711,8 @@ struct PairPosFormat2
return
false
;
const
Value
*
v
=
&
values
[
record_len
*
(
klass1
*
class2Count
+
klass2
)];
valueFormat1
.
apply_value
(
c
->
layout
,
this
,
v
,
CURPOSITION
()
);
valueFormat2
.
apply_value
(
c
->
layout
,
this
,
v
+
len1
,
POSITION
(
j
)
);
valueFormat1
.
apply_value
(
c
->
layout
,
this
,
v
,
c
->
buffer
->
positions
[
c
->
buffer
->
in_pos
]
);
valueFormat2
.
apply_value
(
c
->
layout
,
this
,
v
+
len1
,
c
->
buffer
->
positions
[
j
]
);
if
(
len2
)
j
++
;
...
...
@@ -975,23 +975,23 @@ struct CursivePosFormat1
if
(
c
->
buffer
->
direction
==
HB_DIRECTION_RTL
)
{
/* advance is absolute, not relative */
POSITION
(
c
->
buffer
->
in_pos
)
->
x_advance
=
entry_x
-
gpi
->
anchor_x
;
c
->
buffer
->
positions
[
c
->
buffer
->
in_pos
].
x_advance
=
entry_x
-
gpi
->
anchor_x
;
}
else
{
/* advance is absolute, not relative */
POSITION
(
last_pos
)
->
x_advance
=
gpi
->
anchor_x
-
entry_x
;
c
->
buffer
->
positions
[
last_pos
].
x_advance
=
gpi
->
anchor_x
-
entry_x
;
}
if
(
c
->
lookup_flag
&
LookupFlag
::
RightToLeft
)
{
POSITION
(
last_pos
)
->
cursive_chain
=
last_pos
-
c
->
buffer
->
in_pos
;
POSITION
(
last_pos
)
->
y_offset
=
entry_y
-
gpi
->
anchor_y
;
c
->
buffer
->
positions
[
last_pos
].
cursive_chain
=
last_pos
-
c
->
buffer
->
in_pos
;
c
->
buffer
->
positions
[
last_pos
].
y_offset
=
entry_y
-
gpi
->
anchor_y
;
}
else
{
POSITION
(
c
->
buffer
->
in_pos
)
->
cursive_chain
=
c
->
buffer
->
in_pos
-
last_pos
;
POSITION
(
c
->
buffer
->
in_pos
)
->
y_offset
=
gpi
->
anchor_y
-
entry_y
;
c
->
buffer
->
positions
[
c
->
buffer
->
in_pos
].
cursive_chain
=
c
->
buffer
->
in_pos
-
last_pos
;
c
->
buffer
->
positions
[
c
->
buffer
->
in_pos
].
y_offset
=
gpi
->
anchor_y
-
entry_y
;
}
end:
...
...
src/hb-shape.cc
浏览文件 @
3109375b
...
...
@@ -158,8 +158,8 @@ hb_position_default (hb_font_t *font,
for
(
buffer
->
in_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
hb_glyph_metrics_t
metrics
;
hb_font_get_glyph_metrics
(
font
,
face
,
IN_CURGLYPH
(),
&
metrics
);
CURPOSITION
()
->
x_advance
=
metrics
.
x_advance
;
CURPOSITION
()
->
y_advance
=
metrics
.
y_advance
;
buffer
->
positions
[
buffer
->
in_pos
].
x_advance
=
metrics
.
x_advance
;
buffer
->
positions
[
buffer
->
in_pos
].
y_advance
=
metrics
.
y_advance
;
}
}
...
...
@@ -199,9 +199,9 @@ hb_truetype_kern (hb_font_t *font,
kern
=
hb_font_get_kerning
(
font
,
face
,
IN_GLYPH
(
buffer
->
in_pos
-
1
),
IN_CURGLYPH
());
kern1
=
kern
>>
1
;
kern2
=
kern
-
kern1
;
POSITION
(
buffer
->
in_pos
-
1
)
->
x_advance
+=
kern1
;
CURPOSITION
()
->
x_advance
+=
kern2
;
CURPOSITION
()
->
x_offset
+=
kern2
;
buffer
->
positions
[
buffer
->
in_pos
-
1
].
x_advance
+=
kern1
;
buffer
->
positions
[
buffer
->
in_pos
].
x_advance
+=
kern2
;
buffer
->
positions
[
buffer
->
in_pos
].
x_offset
+=
kern2
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录