Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
327546e6
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看板
提交
327546e6
编写于
10月 23, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[name] Hook up ltag table
上级
dc9a5f88
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
41 addition
and
8 deletion
+41
-8
src/hb-aat-layout.cc
src/hb-aat-layout.cc
+14
-1
src/hb-aat-layout.hh
src/hb-aat-layout.hh
+5
-0
src/hb-aat-ltag-table.hh
src/hb-aat-ltag-table.hh
+15
-2
src/hb-ot-face.hh
src/hb-ot-face.hh
+2
-1
src/hb-ot-name-table.hh
src/hb-ot-name-table.hh
+5
-4
未找到文件。
src/hb-aat-layout.cc
浏览文件 @
327546e6
...
...
@@ -34,7 +34,7 @@
#include "hb-aat-layout-kerx-table.hh"
#include "hb-aat-layout-morx-table.hh"
#include "hb-aat-layout-trak-table.hh"
#include "hb-aat-ltag-table.hh"
// Just so we compile it; unused otherwise.
#include "hb-aat-ltag-table.hh"
/* Table data courtesy of Apple. Converted from mnemonics to integers
...
...
@@ -181,6 +181,12 @@ _get_trak (hb_face_t *face)
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
Null
(
AAT
::
trak
);
return
*
(
hb_ot_face_data
(
face
)
->
trak
.
get
());
}
static
inline
const
AAT
::
ltag
&
_get_ltag
(
hb_face_t
*
face
)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
Null
(
AAT
::
ltag
);
return
*
(
hb_ot_face_data
(
face
)
->
ltag
.
get
());
}
void
...
...
@@ -248,3 +254,10 @@ hb_aat_layout_track (hb_ot_shape_plan_t *plan,
AAT
::
hb_aat_apply_context_t
c
(
plan
,
font
,
buffer
);
trak
.
apply
(
&
c
);
}
hb_language_t
_hb_aat_language_get
(
hb_face_t
*
face
,
unsigned
int
i
)
{
return
_get_ltag
(
face
).
get_language
(
i
);
}
src/hb-aat-layout.hh
浏览文件 @
327546e6
...
...
@@ -80,4 +80,9 @@ hb_aat_layout_track (hb_ot_shape_plan_t *plan,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
);
HB_INTERNAL
hb_language_t
_hb_aat_language_get
(
hb_face_t
*
face
,
unsigned
int
i
);
#endif
/* HB_AAT_LAYOUT_HH */
src/hb-aat-ltag-table.hh
浏览文件 @
327546e6
...
...
@@ -25,7 +25,7 @@
#ifndef HB_AAT_LTAG_TABLE_HH
#define HB_AAT_LTAG_TABLE_HH
#include "hb-
aat-layout-common
.hh"
#include "hb-
open-type
.hh"
/*
* ltag -- Language Tag
...
...
@@ -36,9 +36,13 @@
namespace
AAT
{
using
namespace
OT
;
struct
FTStringRange
{
friend
struct
ltag
;
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
)
const
{
TRACE_SANITIZE
(
this
);
...
...
@@ -58,10 +62,19 @@ struct ltag
{
static
const
hb_tag_t
tableTag
=
HB_AAT_TAG_ltag
;
inline
hb_language_t
get_language
(
unsigned
int
i
)
const
{
const
FTStringRange
&
range
=
tagRanges
[
i
];
return
hb_language_from_string
((
const
char
*
)
(
this
+
range
.
tag
).
arrayZ
,
range
.
length
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
likely
(
c
->
check_struct
(
this
)
&&
tagRanges
.
sanitize
(
c
,
this
)));
return_trace
(
likely
(
c
->
check_struct
(
this
)
&&
version
>=
1
&&
tagRanges
.
sanitize
(
c
,
this
)));
}
protected:
...
...
src/hb-ot-face.hh
浏览文件 @
327546e6
...
...
@@ -66,10 +66,11 @@
HB_OT_ACCELERATOR(OT, hmtx) \
HB_OT_ACCELERATOR(OT, vmtx) \
HB_OT_ACCELERATOR(OT, post) \
HB_OT_ACCELERATOR(OT, name) \
HB_OT_ACCELERATOR(OT, kern) \
HB_OT_ACCELERATOR(OT, glyf) \
HB_OT_TABLE(OT, VORG) \
HB_OT_ACCELERATOR(OT, name) \
HB_OT_TABLE(AAT, ltag) \
/* OpenType color fonts. */
\
HB_OT_TABLE(OT, COLR) \
HB_OT_TABLE(OT, CPAL) \
...
...
src/hb-ot-name-table.hh
浏览文件 @
327546e6
...
...
@@ -29,6 +29,7 @@
#include "hb-open-type.hh"
#include "hb-ot-name-language.hh"
#include "hb-aat-layout.hh"
namespace
OT
{
...
...
@@ -48,7 +49,7 @@ namespace OT {
struct
NameRecord
{
inline
hb_language_t
language
(
void
)
const
inline
hb_language_t
language
(
hb_face_t
*
face
)
const
{
unsigned
int
p
=
platformID
;
unsigned
int
l
=
languageID
;
...
...
@@ -59,8 +60,8 @@ struct NameRecord
if
(
p
==
1
)
return
_hb_ot_name_language_for_mac_code
(
l
);
//
if (p == 0)
/* TODO use 'ltag' table? */
if
(
p
==
0
)
return
_hb_aat_language_get
(
face
,
l
);
return
HB_LANGUAGE_INVALID
;
}
...
...
@@ -194,7 +195,7 @@ struct name
hb_ot_name_entry_t
*
entry
=
this
->
names
.
push
();
entry
->
name_id
=
all_names
[
i
].
nameID
;
entry
->
language
=
all_names
[
i
].
language
();
entry
->
language
=
all_names
[
i
].
language
(
face
);
entry
->
entry_score
=
all_names
[
i
].
score
();
entry
->
entry_index
=
i
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录