Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
19098185
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看板
提交
19098185
编写于
5月 17, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cosmetic
上级
2c3f51a1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
74 addition
and
76 deletion
+74
-76
src/hb-font.cc
src/hb-font.cc
+57
-57
src/hb-ft.cc
src/hb-ft.cc
+17
-19
未找到文件。
src/hb-font.cc
浏览文件 @
19098185
...
...
@@ -60,19 +60,19 @@ static hb_bool_t
hb_font_get_glyph_h_advance_nil
(
hb_font_t
*
font
HB_UNUSED
,
void
*
font_data
HB_UNUSED
,
hb_codepoint_t
glyph
,
hb_position_t
*
x
_advance
,
hb_position_t
*
y
_advance
,
hb_position_t
*
x
,
hb_position_t
*
y
,
void
*
user_data
HB_UNUSED
)
{
if
(
font
->
parent
)
{
hb_bool_t
ret
=
hb_font_get_glyph_h_advance
(
font
->
parent
,
glyph
,
x
_advance
,
y_advance
);
font
->
parent_scale_distance
(
x
_advance
,
y_advance
);
x
,
y
);
font
->
parent_scale_distance
(
x
,
y
);
return
ret
;
}
*
x
_advance
=
*
y_advance
=
0
;
*
x
=
*
y
=
0
;
return
FALSE
;
}
...
...
@@ -80,19 +80,19 @@ static hb_bool_t
hb_font_get_glyph_v_advance_nil
(
hb_font_t
*
font
HB_UNUSED
,
void
*
font_data
HB_UNUSED
,
hb_codepoint_t
glyph
,
hb_position_t
*
x
_advance
,
hb_position_t
*
y
_advance
,
hb_position_t
*
x
,
hb_position_t
*
y
,
void
*
user_data
HB_UNUSED
)
{
if
(
font
->
parent
)
{
hb_bool_t
ret
=
hb_font_get_glyph_v_advance
(
font
->
parent
,
glyph
,
x
_advance
,
y_advance
);
font
->
parent_scale_distance
(
x
_advance
,
y_advance
);
x
,
y
);
font
->
parent_scale_distance
(
x
,
y
);
return
ret
;
}
*
x
_advance
=
*
y_advance
=
0
;
*
x
=
*
y
=
0
;
return
FALSE
;
}
...
...
@@ -100,19 +100,19 @@ static hb_bool_t
hb_font_get_glyph_h_origin_nil
(
hb_font_t
*
font
HB_UNUSED
,
void
*
font_data
HB_UNUSED
,
hb_codepoint_t
glyph
,
hb_position_t
*
x
_origin
,
hb_position_t
*
y
_origin
,
hb_position_t
*
x
,
hb_position_t
*
y
,
void
*
user_data
HB_UNUSED
)
{
if
(
font
->
parent
)
{
hb_bool_t
ret
=
hb_font_get_glyph_h_origin
(
font
->
parent
,
glyph
,
x
_origin
,
y_origin
);
font
->
parent_scale_distance
(
x
_origin
,
y_origin
);
x
,
y
);
font
->
parent_scale_distance
(
x
,
y
);
return
ret
;
}
*
x
_origin
=
*
y_origin
=
0
;
*
x
=
*
y
=
0
;
return
FALSE
;
}
...
...
@@ -120,19 +120,19 @@ static hb_bool_t
hb_font_get_glyph_v_origin_nil
(
hb_font_t
*
font
HB_UNUSED
,
void
*
font_data
HB_UNUSED
,
hb_codepoint_t
glyph
,
hb_position_t
*
x
_origin
,
hb_position_t
*
y
_origin
,
hb_position_t
*
x
,
hb_position_t
*
y
,
void
*
user_data
HB_UNUSED
)
{
if
(
font
->
parent
)
{
hb_bool_t
ret
=
hb_font_get_glyph_v_origin
(
font
->
parent
,
glyph
,
x
_origin
,
y_origin
);
font
->
parent_scale_distance
(
x
_origin
,
y_origin
);
x
,
y
);
font
->
parent_scale_distance
(
x
,
y
);
return
ret
;
}
*
x
_origin
=
*
y_origin
=
0
;
*
x
=
*
y
=
0
;
return
FALSE
;
}
...
...
@@ -141,19 +141,19 @@ hb_font_get_glyph_h_kerning_nil (hb_font_t *font HB_UNUSED,
void
*
font_data
HB_UNUSED
,
hb_codepoint_t
left_glyph
,
hb_codepoint_t
right_glyph
,
hb_position_t
*
x
_kern
,
hb_position_t
*
y
_kern
,
hb_position_t
*
x
,
hb_position_t
*
y
,
void
*
user_data
HB_UNUSED
)
{
if
(
font
->
parent
)
{
hb_bool_t
ret
=
hb_font_get_glyph_h_kerning
(
font
->
parent
,
left_glyph
,
right_glyph
,
x
_kern
,
y_kern
);
font
->
parent_scale_distance
(
x
_kern
,
y_kern
);
x
,
y
);
font
->
parent_scale_distance
(
x
,
y
);
return
ret
;
}
*
x
_kern
=
*
y_kern
=
0
;
*
x
=
*
y
=
0
;
return
FALSE
;
}
...
...
@@ -162,19 +162,19 @@ hb_font_get_glyph_v_kerning_nil (hb_font_t *font HB_UNUSED,
void
*
font_data
HB_UNUSED
,
hb_codepoint_t
top_glyph
,
hb_codepoint_t
bottom_glyph
,
hb_position_t
*
x
_kern
,
hb_position_t
*
y
_kern
,
hb_position_t
*
x
,
hb_position_t
*
y
,
void
*
user_data
HB_UNUSED
)
{
if
(
font
->
parent
)
{
hb_bool_t
ret
=
hb_font_get_glyph_v_kerning
(
font
->
parent
,
top_glyph
,
bottom_glyph
,
x
_kern
,
y_kern
);
font
->
parent_scale_distance
(
x
_kern
,
y_kern
);
x
,
y
);
font
->
parent_scale_distance
(
x
,
y
);
return
ret
;
}
*
x
_kern
=
*
y_kern
=
0
;
*
x
=
*
y
=
0
;
return
FALSE
;
}
...
...
@@ -347,68 +347,68 @@ hb_font_get_glyph (hb_font_t *font,
hb_bool_t
hb_font_get_glyph_h_advance
(
hb_font_t
*
font
,
hb_codepoint_t
glyph
,
hb_position_t
*
x
_advance
,
hb_position_t
*
y_advance
)
hb_position_t
*
x
,
hb_position_t
*
y
)
{
*
x
_advance
=
*
y_advance
=
0
;
*
x
=
*
y
=
0
;
return
font
->
klass
->
get
.
glyph_h_advance
(
font
,
font
->
user_data
,
glyph
,
x
_advance
,
y_advance
,
glyph
,
x
,
y
,
font
->
klass
->
user_data
.
glyph_h_advance
);
}
hb_bool_t
hb_font_get_glyph_v_advance
(
hb_font_t
*
font
,
hb_codepoint_t
glyph
,
hb_position_t
*
x
_advance
,
hb_position_t
*
y_advance
)
hb_position_t
*
x
,
hb_position_t
*
y
)
{
*
x
_advance
=
*
y_advance
=
0
;
*
x
=
*
y
=
0
;
return
font
->
klass
->
get
.
glyph_v_advance
(
font
,
font
->
user_data
,
glyph
,
x
_advance
,
y_advance
,
glyph
,
x
,
y
,
font
->
klass
->
user_data
.
glyph_v_advance
);
}
hb_bool_t
hb_font_get_glyph_h_origin
(
hb_font_t
*
font
,
hb_codepoint_t
glyph
,
hb_position_t
*
x
_origin
,
hb_position_t
*
y_origin
)
hb_position_t
*
x
,
hb_position_t
*
y
)
{
*
x
_origin
=
*
y_origin
=
0
;
*
x
=
*
y
=
0
;
return
font
->
klass
->
get
.
glyph_h_origin
(
font
,
font
->
user_data
,
glyph
,
x
_origin
,
y_origin
,
glyph
,
x
,
y
,
font
->
klass
->
user_data
.
glyph_h_origin
);
}
hb_bool_t
hb_font_get_glyph_v_origin
(
hb_font_t
*
font
,
hb_codepoint_t
glyph
,
hb_position_t
*
x
_origin
,
hb_position_t
*
y_origin
)
hb_position_t
*
x
,
hb_position_t
*
y
)
{
*
x
_origin
=
*
y_origin
=
0
;
*
x
=
*
y
=
0
;
return
font
->
klass
->
get
.
glyph_v_origin
(
font
,
font
->
user_data
,
glyph
,
x
_origin
,
y_origin
,
glyph
,
x
,
y
,
font
->
klass
->
user_data
.
glyph_v_origin
);
}
hb_bool_t
hb_font_get_glyph_h_kerning
(
hb_font_t
*
font
,
hb_codepoint_t
left_glyph
,
hb_codepoint_t
right_glyph
,
hb_position_t
*
x
_kern
,
hb_position_t
*
y_kern
)
hb_position_t
*
x
,
hb_position_t
*
y
)
{
*
x
_kern
=
*
y_kern
=
0
;
*
x
=
*
y
=
0
;
return
font
->
klass
->
get
.
glyph_h_kerning
(
font
,
font
->
user_data
,
left_glyph
,
right_glyph
,
x
_kern
,
y_kern
,
x
,
y
,
font
->
klass
->
user_data
.
glyph_h_kerning
);
}
hb_bool_t
hb_font_get_glyph_v_kerning
(
hb_font_t
*
font
,
hb_codepoint_t
left_glyph
,
hb_codepoint_t
right_glyph
,
hb_position_t
*
x
_kern
,
hb_position_t
*
y_kern
)
hb_position_t
*
x
,
hb_position_t
*
y
)
{
*
x
_kern
=
*
y_kern
=
0
;
*
x
=
*
y
=
0
;
return
font
->
klass
->
get
.
glyph_v_kerning
(
font
,
font
->
user_data
,
left_glyph
,
right_glyph
,
x
_kern
,
y_kern
,
x
,
y
,
font
->
klass
->
user_data
.
glyph_v_kerning
);
}
...
...
@@ -443,15 +443,15 @@ void
hb_font_get_glyph_advance_for_direction
(
hb_font_t
*
font
,
hb_codepoint_t
glyph
,
hb_direction_t
direction
,
hb_position_t
*
x
_advance
,
hb_position_t
*
y_advance
)
hb_position_t
*
x
,
hb_position_t
*
y
)
{
if
(
HB_DIRECTION_IS_VERTICAL
(
direction
))
{
hb_bool_t
ret
=
hb_font_get_glyph_v_advance
(
font
,
glyph
,
x
_advance
,
y_advance
);
hb_bool_t
ret
=
hb_font_get_glyph_v_advance
(
font
,
glyph
,
x
,
y
);
if
(
!
ret
)
{
/* TODO return font_extents.ascent + font_extents.descent? */
}
}
else
{
hb_font_get_glyph_h_advance
(
font
,
glyph
,
x
_advance
,
y_advance
);
hb_font_get_glyph_h_advance
(
font
,
glyph
,
x
,
y
);
}
}
...
...
@@ -459,15 +459,15 @@ void
hb_font_get_glyph_origin_for_direction
(
hb_font_t
*
font
,
hb_codepoint_t
glyph
,
hb_direction_t
direction
,
hb_position_t
*
x
_origin
,
hb_position_t
*
y_origin
)
hb_position_t
*
x
,
hb_position_t
*
y
)
{
if
(
HB_DIRECTION_IS_VERTICAL
(
direction
))
{
hb_bool_t
ret
=
hb_font_get_glyph_v_origin
(
font
,
glyph
,
x
_origin
,
y_origin
);
hb_bool_t
ret
=
hb_font_get_glyph_v_origin
(
font
,
glyph
,
x
,
y
);
if
(
!
ret
)
{
/* TODO return h_origin/2. and font_extents.ascent */
}
}
else
{
hb_font_get_glyph_h_origin
(
font
,
glyph
,
x
_origin
,
y_origin
);
hb_font_get_glyph_h_origin
(
font
,
glyph
,
x
,
y
);
}
}
...
...
@@ -475,17 +475,17 @@ void
hb_font_get_glyph_kerning_for_direction
(
hb_font_t
*
font
,
hb_codepoint_t
first_glyph
,
hb_codepoint_t
second_glyph
,
hb_direction_t
direction
,
hb_position_t
*
x
_kern
,
hb_position_t
*
y_kern
)
hb_position_t
*
x
,
hb_position_t
*
y
)
{
switch
(
direction
)
{
case
HB_DIRECTION_LTR
:
case
HB_DIRECTION_RTL
:
hb_font_get_glyph_h_kerning
(
font
,
first_glyph
,
second_glyph
,
x
_kern
,
y_kern
);
hb_font_get_glyph_h_kerning
(
font
,
first_glyph
,
second_glyph
,
x
,
y
);
break
;
case
HB_DIRECTION_TTB
:
case
HB_DIRECTION_BTT
:
hb_font_get_glyph_v_kerning
(
font
,
first_glyph
,
second_glyph
,
x
_kern
,
y_kern
);
hb_font_get_glyph_v_kerning
(
font
,
first_glyph
,
second_glyph
,
x
,
y
);
break
;
case
HB_DIRECTION_INVALID
:
...
...
src/hb-ft.cc
浏览文件 @
19098185
...
...
@@ -82,8 +82,8 @@ static hb_bool_t
hb_ft_get_glyph_h_advance
(
hb_font_t
*
font
HB_UNUSED
,
void
*
font_data
,
hb_codepoint_t
glyph
,
hb_position_t
*
x
_advance
,
hb_position_t
*
y
_advance
,
hb_position_t
*
x
,
hb_position_t
*
y
,
void
*
user_data
HB_UNUSED
)
{
FT_Face
ft_face
=
(
FT_Face
)
font_data
;
...
...
@@ -92,7 +92,7 @@ hb_ft_get_glyph_h_advance (hb_font_t *font HB_UNUSED,
if
(
unlikely
(
FT_Load_Glyph
(
ft_face
,
glyph
,
load_flags
)))
return
FALSE
;
*
x
_advance
=
ft_face
->
glyph
->
metrics
.
horiAdvance
;
*
x
=
ft_face
->
glyph
->
metrics
.
horiAdvance
;
return
TRUE
;
}
...
...
@@ -100,8 +100,8 @@ static hb_bool_t
hb_ft_get_glyph_v_advance
(
hb_font_t
*
font
HB_UNUSED
,
void
*
font_data
,
hb_codepoint_t
glyph
,
hb_position_t
*
x
_advance
,
hb_position_t
*
y
_advance
,
hb_position_t
*
x
,
hb_position_t
*
y
,
void
*
user_data
HB_UNUSED
)
{
FT_Face
ft_face
=
(
FT_Face
)
font_data
;
...
...
@@ -110,7 +110,7 @@ hb_ft_get_glyph_v_advance (hb_font_t *font HB_UNUSED,
if
(
unlikely
(
FT_Load_Glyph
(
ft_face
,
glyph
,
load_flags
)))
return
FALSE
;
*
y
_advance
=
-
ft_face
->
glyph
->
metrics
.
vertAdvance
;
*
y
=
-
ft_face
->
glyph
->
metrics
.
vertAdvance
;
return
TRUE
;
}
...
...
@@ -118,8 +118,8 @@ static hb_bool_t
hb_ft_get_glyph_h_origin
(
hb_font_t
*
font
HB_UNUSED
,
void
*
font_data
HB_UNUSED
,
hb_codepoint_t
glyph
HB_UNUSED
,
hb_position_t
*
x
_origin
HB_UNUSED
,
hb_position_t
*
y
_origin
HB_UNUSED
,
hb_position_t
*
x
HB_UNUSED
,
hb_position_t
*
y
HB_UNUSED
,
void
*
user_data
HB_UNUSED
)
{
/* We always work in the horizontal coordinates. */
...
...
@@ -130,8 +130,8 @@ static hb_bool_t
hb_ft_get_glyph_v_origin
(
hb_font_t
*
font
HB_UNUSED
,
void
*
font_data
,
hb_codepoint_t
glyph
,
hb_position_t
*
x
_origin
,
hb_position_t
*
y
_origin
,
hb_position_t
*
x
,
hb_position_t
*
y
,
void
*
user_data
HB_UNUSED
)
{
FT_Face
ft_face
=
(
FT_Face
)
font_data
;
...
...
@@ -140,7 +140,7 @@ hb_ft_get_glyph_v_origin (hb_font_t *font HB_UNUSED,
if
(
unlikely
(
FT_Load_Glyph
(
ft_face
,
glyph
,
load_flags
)))
return
FALSE
;
/* XXX */
*
y
_origin
=
ft_face
->
glyph
->
metrics
.
vertAdvance
;
/* XXX */
*
y
=
ft_face
->
glyph
->
metrics
.
vertAdvance
;
return
TRUE
;
}
...
...
@@ -149,8 +149,8 @@ hb_ft_get_glyph_h_kerning (hb_font_t *font HB_UNUSED,
void
*
font_data
,
hb_codepoint_t
left_glyph
,
hb_codepoint_t
right_glyph
,
hb_position_t
*
x
_kern
,
hb_position_t
*
y
_kern
,
hb_position_t
*
x
,
hb_position_t
*
y
,
void
*
user_data
HB_UNUSED
)
{
FT_Face
ft_face
=
(
FT_Face
)
font_data
;
...
...
@@ -159,8 +159,8 @@ hb_ft_get_glyph_h_kerning (hb_font_t *font HB_UNUSED,
if
(
FT_Get_Kerning
(
ft_face
,
left_glyph
,
right_glyph
,
FT_KERNING_DEFAULT
,
&
kerning
))
return
FALSE
;
*
x
_kern
=
kerning
.
x
;
*
y
_kern
=
kerning
.
y
;
*
x
=
kerning
.
x
;
*
y
=
kerning
.
y
;
return
TRUE
;
}
...
...
@@ -169,8 +169,8 @@ hb_ft_get_glyph_v_kerning (hb_font_t *font HB_UNUSED,
void
*
font_data
HB_UNUSED
,
hb_codepoint_t
top_glyph
HB_UNUSED
,
hb_codepoint_t
bottom_glyph
HB_UNUSED
,
hb_position_t
*
x
_kern
HB_UNUSED
,
hb_position_t
*
y
_kern
HB_UNUSED
,
hb_position_t
*
x
HB_UNUSED
,
hb_position_t
*
y
HB_UNUSED
,
void
*
user_data
HB_UNUSED
)
{
/* FreeType API doesn't support vertical kerning */
...
...
@@ -187,8 +187,6 @@ hb_ft_get_glyph_extents (hb_font_t *font HB_UNUSED,
FT_Face
ft_face
=
(
FT_Face
)
font_data
;
int
load_flags
=
FT_LOAD_DEFAULT
;
/* TODO: load_flags, embolden, etc, shape/transform */
if
(
unlikely
(
FT_Load_Glyph
(
ft_face
,
glyph
,
load_flags
)))
return
FALSE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录