Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
cbea7d49
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看板
提交
cbea7d49
编写于
9月 11, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ot-font] Rename
上级
d8a67dac
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
37 deletion
+37
-37
src/hb-ot-font.cc
src/hb-ot-font.cc
+37
-37
未找到文件。
src/hb-ot-font.cc
浏览文件 @
cbea7d49
...
...
@@ -47,8 +47,8 @@ hb_ot_get_nominal_glyph (hb_font_t *font HB_UNUSED,
hb_codepoint_t
*
glyph
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_face_data_t
*
ot_f
ont
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
ot_f
ont
->
cmap
.
get_relaxed
()
->
get_nominal_glyph
(
unicode
,
glyph
);
const
hb_ot_face_data_t
*
ot_f
ace
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
ot_f
ace
->
cmap
.
get_relaxed
()
->
get_nominal_glyph
(
unicode
,
glyph
);
}
static
hb_bool_t
...
...
@@ -59,8 +59,8 @@ hb_ot_get_variation_glyph (hb_font_t *font HB_UNUSED,
hb_codepoint_t
*
glyph
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_face_data_t
*
ot_f
ont
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
ot_f
ont
->
cmap
.
get_relaxed
()
->
get_variation_glyph
(
unicode
,
variation_selector
,
glyph
);
const
hb_ot_face_data_t
*
ot_f
ace
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
ot_f
ace
->
cmap
.
get_relaxed
()
->
get_variation_glyph
(
unicode
,
variation_selector
,
glyph
);
}
static
hb_position_t
...
...
@@ -69,8 +69,8 @@ hb_ot_get_glyph_h_advance (hb_font_t *font,
hb_codepoint_t
glyph
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_face_data_t
*
ot_f
ont
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
font
->
em_scale_x
(
ot_f
ont
->
hmtx
.
get_relaxed
()
->
get_advance
(
glyph
,
font
));
const
hb_ot_face_data_t
*
ot_f
ace
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
font
->
em_scale_x
(
ot_f
ace
->
hmtx
.
get_relaxed
()
->
get_advance
(
glyph
,
font
));
}
static
void
...
...
@@ -82,8 +82,8 @@ hb_ot_get_glyph_h_advances (hb_font_t* font, void* font_data,
unsigned
advance_stride
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_face_data_t
*
ot_f
ont
=
(
const
hb_ot_face_data_t
*
)
font_data
;
const
OT
::
hmtx_accelerator_t
&
hmtx
=
*
ot_f
ont
->
hmtx
.
get_relaxed
();
const
hb_ot_face_data_t
*
ot_f
ace
=
(
const
hb_ot_face_data_t
*
)
font_data
;
const
OT
::
hmtx_accelerator_t
&
hmtx
=
*
ot_f
ace
->
hmtx
.
get_relaxed
();
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
...
...
@@ -99,8 +99,8 @@ hb_ot_get_glyph_v_advance (hb_font_t *font,
hb_codepoint_t
glyph
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_face_data_t
*
ot_f
ont
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
font
->
em_scale_y
(
-
(
int
)
ot_f
ont
->
vmtx
.
get_relaxed
()
->
get_advance
(
glyph
,
font
));
const
hb_ot_face_data_t
*
ot_f
ace
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
font
->
em_scale_y
(
-
(
int
)
ot_f
ace
->
vmtx
.
get_relaxed
()
->
get_advance
(
glyph
,
font
));
}
static
void
...
...
@@ -112,8 +112,8 @@ hb_ot_get_glyph_v_advances (hb_font_t* font, void* font_data,
unsigned
advance_stride
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_face_data_t
*
ot_f
ont
=
(
const
hb_ot_face_data_t
*
)
font_data
;
const
OT
::
vmtx_accelerator_t
&
vmtx
=
*
ot_f
ont
->
vmtx
.
get_relaxed
();
const
hb_ot_face_data_t
*
ot_f
ace
=
(
const
hb_ot_face_data_t
*
)
font_data
;
const
OT
::
vmtx_accelerator_t
&
vmtx
=
*
ot_f
ace
->
vmtx
.
get_relaxed
();
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
...
...
@@ -130,8 +130,8 @@ hb_ot_get_glyph_h_kerning (hb_font_t *font,
hb_codepoint_t
right_glyph
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_face_data_t
*
ot_f
ont
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
font
->
em_scale_x
(
ot_f
ont
->
kern
->
get_h_kerning
(
left_glyph
,
right_glyph
));
const
hb_ot_face_data_t
*
ot_f
ace
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
font
->
em_scale_x
(
ot_f
ace
->
kern
->
get_h_kerning
(
left_glyph
,
right_glyph
));
}
static
hb_bool_t
...
...
@@ -141,10 +141,10 @@ hb_ot_get_glyph_extents (hb_font_t *font,
hb_glyph_extents_t
*
extents
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_face_data_t
*
ot_f
ont
=
(
const
hb_ot_face_data_t
*
)
font_data
;
bool
ret
=
ot_f
ont
->
glyf
->
get_extents
(
glyph
,
extents
);
const
hb_ot_face_data_t
*
ot_f
ace
=
(
const
hb_ot_face_data_t
*
)
font_data
;
bool
ret
=
ot_f
ace
->
glyf
->
get_extents
(
glyph
,
extents
);
if
(
!
ret
)
ret
=
ot_f
ont
->
CBDT
->
get_extents
(
glyph
,
extents
);
ret
=
ot_f
ace
->
CBDT
->
get_extents
(
glyph
,
extents
);
// TODO Hook up side-bearings variations.
extents
->
x_bearing
=
font
->
em_scale_x
(
extents
->
x_bearing
);
extents
->
y_bearing
=
font
->
em_scale_y
(
extents
->
y_bearing
);
...
...
@@ -160,8 +160,8 @@ hb_ot_get_glyph_name (hb_font_t *font HB_UNUSED,
char
*
name
,
unsigned
int
size
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_face_data_t
*
ot_f
ont
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
ot_f
ont
->
post
->
get_glyph_name
(
glyph
,
name
,
size
);
const
hb_ot_face_data_t
*
ot_f
ace
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
ot_f
ace
->
post
->
get_glyph_name
(
glyph
,
name
,
size
);
}
static
hb_bool_t
...
...
@@ -171,8 +171,8 @@ hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED,
hb_codepoint_t
*
glyph
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_face_data_t
*
ot_f
ont
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
ot_f
ont
->
post
->
get_glyph_from_name
(
name
,
len
,
glyph
);
const
hb_ot_face_data_t
*
ot_f
ace
=
(
const
hb_ot_face_data_t
*
)
font_data
;
return
ot_f
ace
->
post
->
get_glyph_from_name
(
name
,
len
,
glyph
);
}
static
hb_bool_t
...
...
@@ -181,12 +181,12 @@ hb_ot_get_font_h_extents (hb_font_t *font,
hb_font_extents_t
*
metrics
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_face_data_t
*
ot_f
ont
=
(
const
hb_ot_face_data_t
*
)
font_data
;
metrics
->
ascender
=
font
->
em_scale_y
(
ot_f
ont
->
hmtx
.
get_relaxed
()
->
ascender
);
metrics
->
descender
=
font
->
em_scale_y
(
ot_f
ont
->
hmtx
.
get_relaxed
()
->
descender
);
metrics
->
line_gap
=
font
->
em_scale_y
(
ot_f
ont
->
hmtx
.
get_relaxed
()
->
line_gap
);
const
hb_ot_face_data_t
*
ot_f
ace
=
(
const
hb_ot_face_data_t
*
)
font_data
;
metrics
->
ascender
=
font
->
em_scale_y
(
ot_f
ace
->
hmtx
.
get_relaxed
()
->
ascender
);
metrics
->
descender
=
font
->
em_scale_y
(
ot_f
ace
->
hmtx
.
get_relaxed
()
->
descender
);
metrics
->
line_gap
=
font
->
em_scale_y
(
ot_f
ace
->
hmtx
.
get_relaxed
()
->
line_gap
);
// TODO Hook up variations.
return
ot_f
ont
->
hmtx
.
get_relaxed
()
->
has_font_extents
;
return
ot_f
ace
->
hmtx
.
get_relaxed
()
->
has_font_extents
;
}
static
hb_bool_t
...
...
@@ -195,19 +195,19 @@ hb_ot_get_font_v_extents (hb_font_t *font,
hb_font_extents_t
*
metrics
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_face_data_t
*
ot_f
ont
=
(
const
hb_ot_face_data_t
*
)
font_data
;
metrics
->
ascender
=
font
->
em_scale_x
(
ot_f
ont
->
vmtx
.
get_relaxed
()
->
ascender
);
metrics
->
descender
=
font
->
em_scale_x
(
ot_f
ont
->
vmtx
.
get_relaxed
()
->
descender
);
metrics
->
line_gap
=
font
->
em_scale_x
(
ot_f
ont
->
vmtx
.
get_relaxed
()
->
line_gap
);
const
hb_ot_face_data_t
*
ot_f
ace
=
(
const
hb_ot_face_data_t
*
)
font_data
;
metrics
->
ascender
=
font
->
em_scale_x
(
ot_f
ace
->
vmtx
.
get_relaxed
()
->
ascender
);
metrics
->
descender
=
font
->
em_scale_x
(
ot_f
ace
->
vmtx
.
get_relaxed
()
->
descender
);
metrics
->
line_gap
=
font
->
em_scale_x
(
ot_f
ace
->
vmtx
.
get_relaxed
()
->
line_gap
);
// TODO Hook up variations.
return
ot_f
ont
->
vmtx
.
get_relaxed
()
->
has_font_extents
;
return
ot_f
ace
->
vmtx
.
get_relaxed
()
->
has_font_extents
;
}
#ifdef HB_USE_ATEXIT
static
void
free_static_ot_funcs
(
void
);
#endif
static
struct
hb_ot_f
ont_funcs_lazy_loader_t
:
hb_font_funcs_lazy_loader_t
<
hb_ot_font
_funcs_lazy_loader_t
>
static
struct
hb_ot_f
ace_funcs_lazy_loader_t
:
hb_font_funcs_lazy_loader_t
<
hb_ot_face
_funcs_lazy_loader_t
>
{
static
inline
hb_font_funcs_t
*
create
(
void
)
{
...
...
@@ -264,15 +264,15 @@ void
hb_ot_font_set_funcs
(
hb_font_t
*
font
)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
font
->
face
)))
return
;
hb_ot_face_data_t
*
ot_f
ont
=
hb_ot_face_data
(
font
->
face
);
hb_ot_face_data_t
*
ot_f
ace
=
hb_ot_face_data
(
font
->
face
);
/* Load them lazies. We access them with get_relaxed() for performance. */
ot_f
ont
->
cmap
.
get
();
ot_f
ont
->
hmtx
.
get
();
ot_f
ont
->
vmtx
.
get
();
ot_f
ace
->
cmap
.
get
();
ot_f
ace
->
hmtx
.
get
();
ot_f
ace
->
vmtx
.
get
();
hb_font_set_funcs
(
font
,
_hb_ot_get_font_funcs
(),
ot_f
ont
,
ot_f
ace
,
nullptr
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录