Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
ca54a126
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看板
提交
ca54a126
编写于
5月 14, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor
上级
910a33fe
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
34 deletion
+26
-34
src/hb-shape.cc
src/hb-shape.cc
+26
-34
未找到文件。
src/hb-shape.cc
浏览文件 @
ca54a126
...
@@ -46,12 +46,10 @@ is_variation_selector (hb_codepoint_t unicode)
...
@@ -46,12 +46,10 @@ is_variation_selector (hb_codepoint_t unicode)
static
void
static
void
hb_form_clusters
(
hb_buffer_t
*
buffer
)
hb_form_clusters
(
hb_buffer_t
*
buffer
)
{
{
unsigned
int
count
;
unsigned
int
count
=
buffer
->
len
;
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
count
=
buffer
->
len
;
if
(
buffer
->
unicode
->
get_general_category
(
buffer
->
info
[
i
].
codepoint
)
==
HB_CATEGORY_NON_SPACING_MARK
)
for
(
buffer
->
i
=
1
;
buffer
->
i
<
count
;
buffer
->
i
++
)
buffer
->
info
[
i
].
cluster
=
buffer
->
info
[
i
-
1
].
cluster
;
if
(
buffer
->
unicode
->
get_general_category
(
buffer
->
info
[
buffer
->
i
].
codepoint
)
==
HB_CATEGORY_NON_SPACING_MARK
)
buffer
->
info
[
buffer
->
i
].
cluster
=
buffer
->
info
[
buffer
->
i
-
1
].
cluster
;
}
}
static
hb_direction_t
static
hb_direction_t
...
@@ -76,15 +74,14 @@ hb_ensure_native_direction (hb_buffer_t *buffer)
...
@@ -76,15 +74,14 @@ hb_ensure_native_direction (hb_buffer_t *buffer)
static
void
static
void
hb_mirror_chars
(
hb_buffer_t
*
buffer
)
hb_mirror_chars
(
hb_buffer_t
*
buffer
)
{
{
unsigned
int
count
;
hb_unicode_get_mirroring_func_t
get_mirroring
=
buffer
->
unicode
->
get_mirroring
;
hb_unicode_get_mirroring_func_t
get_mirroring
=
buffer
->
unicode
->
get_mirroring
;
if
(
HB_DIRECTION_IS_FORWARD
(
buffer
->
direction
))
if
(
HB_DIRECTION_IS_FORWARD
(
buffer
->
direction
))
return
;
return
;
count
=
buffer
->
len
;
unsigned
int
count
=
buffer
->
len
;
for
(
buffer
->
i
=
0
;
buffer
->
i
<
count
;
buffer
->
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
buffer
->
info
[
buffer
->
i
].
codepoint
=
get_mirroring
(
buffer
->
info
[
buffer
->
i
].
codepoint
);
buffer
->
info
[
i
].
codepoint
=
get_mirroring
(
buffer
->
info
[
i
].
codepoint
);
}
}
}
}
...
@@ -93,20 +90,19 @@ hb_map_glyphs (hb_font_t *font,
...
@@ -93,20 +90,19 @@ hb_map_glyphs (hb_font_t *font,
hb_face_t
*
face
,
hb_face_t
*
face
,
hb_buffer_t
*
buffer
)
hb_buffer_t
*
buffer
)
{
{
unsigned
int
count
;
if
(
unlikely
(
!
buffer
->
len
))
if
(
unlikely
(
!
buffer
->
len
))
return
;
return
;
count
=
buffer
->
len
-
1
;
for
(
buffer
->
i
=
0
;
buffer
->
i
<
count
;
buffer
->
i
++
)
{
unsigned
int
count
=
buffer
->
len
-
1
;
if
(
unlikely
(
is_variation_selector
(
buffer
->
info
[
buffer
->
i
+
1
].
codepoint
)))
{
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
buffer
->
info
[
buffer
->
i
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
buffer
->
i
].
codepoint
,
buffer
->
info
[
buffer
->
i
+
1
].
codepoint
);
if
(
unlikely
(
is_variation_selector
(
buffer
->
info
[
i
+
1
].
codepoint
)))
{
buffer
->
i
++
;
buffer
->
info
[
i
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
i
].
codepoint
,
buffer
->
info
[
i
+
1
].
codepoint
);
i
++
;
}
else
{
}
else
{
buffer
->
info
[
buffer
->
i
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
buffer
->
i
].
codepoint
,
0
);
buffer
->
info
[
i
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
i
].
codepoint
,
0
);
}
}
}
}
buffer
->
info
[
buffer
->
i
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
buffer
->
i
].
codepoint
,
0
);
buffer
->
info
[
count
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
count
].
codepoint
,
0
);
}
}
static
void
static
void
...
@@ -150,16 +146,14 @@ hb_position_default (hb_font_t *font,
...
@@ -150,16 +146,14 @@ hb_position_default (hb_font_t *font,
hb_feature_t
*
features
HB_UNUSED
,
hb_feature_t
*
features
HB_UNUSED
,
unsigned
int
num_features
HB_UNUSED
)
unsigned
int
num_features
HB_UNUSED
)
{
{
unsigned
int
count
;
hb_buffer_clear_positions
(
buffer
);
hb_buffer_clear_positions
(
buffer
);
count
=
buffer
->
len
;
unsigned
int
count
=
buffer
->
len
;
for
(
buffer
->
i
=
0
;
buffer
->
i
<
count
;
buffer
->
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
hb_glyph_metrics_t
metrics
;
hb_glyph_metrics_t
metrics
;
hb_font_get_glyph_metrics
(
font
,
face
,
buffer
->
info
[
buffer
->
i
].
codepoint
,
&
metrics
);
hb_font_get_glyph_metrics
(
font
,
face
,
buffer
->
info
[
i
].
codepoint
,
&
metrics
);
buffer
->
pos
[
buffer
->
i
].
x_advance
=
metrics
.
x_advance
;
buffer
->
pos
[
i
].
x_advance
=
metrics
.
x_advance
;
buffer
->
pos
[
buffer
->
i
].
y_advance
=
metrics
.
y_advance
;
buffer
->
pos
[
i
].
y_advance
=
metrics
.
y_advance
;
}
}
}
}
...
@@ -190,18 +184,16 @@ hb_truetype_kern (hb_font_t *font,
...
@@ -190,18 +184,16 @@ hb_truetype_kern (hb_font_t *font,
hb_feature_t
*
features
HB_UNUSED
,
hb_feature_t
*
features
HB_UNUSED
,
unsigned
int
num_features
HB_UNUSED
)
unsigned
int
num_features
HB_UNUSED
)
{
{
unsigned
int
count
;
/* TODO Check for kern=0 */
/* TODO Check for kern=0 */
count
=
buffer
->
len
;
unsigned
int
count
=
buffer
->
len
;
for
(
buffer
->
i
=
1
;
buffer
->
i
<
count
;
buffer
->
i
++
)
{
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
{
hb_position_t
kern
,
kern1
,
kern2
;
hb_position_t
kern
,
kern1
,
kern2
;
kern
=
hb_font_get_kerning
(
font
,
face
,
buffer
->
info
[
buffer
->
i
-
1
].
codepoint
,
buffer
->
info
[
buffer
->
i
].
codepoint
);
kern
=
hb_font_get_kerning
(
font
,
face
,
buffer
->
info
[
i
-
1
].
codepoint
,
buffer
->
info
[
i
].
codepoint
);
kern1
=
kern
>>
1
;
kern1
=
kern
>>
1
;
kern2
=
kern
-
kern1
;
kern2
=
kern
-
kern1
;
buffer
->
pos
[
buffer
->
i
-
1
].
x_advance
+=
kern1
;
buffer
->
pos
[
i
-
1
].
x_advance
+=
kern1
;
buffer
->
pos
[
buffer
->
i
].
x_advance
+=
kern2
;
buffer
->
pos
[
i
].
x_advance
+=
kern2
;
buffer
->
pos
[
buffer
->
i
].
x_offset
+=
kern2
;
buffer
->
pos
[
i
].
x_offset
+=
kern2
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录