Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
f54cce3c
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
f54cce3c
编写于
11月 26, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[OTLayout] Implement 'size' feature
上级
2dc1141d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
70 addition
and
2 deletion
+70
-2
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+34
-2
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+31
-0
src/hb-ot-layout.h
src/hb-ot-layout.h
+5
-0
未找到文件。
src/hb-ot-layout-common-private.hh
浏览文件 @
f54cce3c
...
@@ -248,6 +248,33 @@ struct Script
...
@@ -248,6 +248,33 @@ struct Script
typedef
RecordListOf
<
Script
>
ScriptList
;
typedef
RecordListOf
<
Script
>
ScriptList
;
struct
FeatureParamsSize
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
}
USHORT
params
[
5
];
public:
DEFINE_SIZE_STATIC
(
10
);
};
struct
FeatureParams
{
/* Note: currently the only feature with params is 'size', so we hardcode
* the length of the table to that of the FeatureParamsSize. */
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
}
union
{
FeatureParamsSize
size
;
}
u
;
DEFINE_SIZE_STATIC
(
10
);
};
struct
Feature
struct
Feature
{
{
...
@@ -260,12 +287,17 @@ struct Feature
...
@@ -260,12 +287,17 @@ struct Feature
unsigned
int
*
lookup_tags
/* OUT */
)
const
unsigned
int
*
lookup_tags
/* OUT */
)
const
{
return
lookupIndex
.
get_indexes
(
start_index
,
lookup_count
,
lookup_tags
);
}
{
return
lookupIndex
.
get_indexes
(
start_index
,
lookup_count
,
lookup_tags
);
}
inline
const
FeatureParams
&
get_feature_params
(
void
)
const
{
return
this
+
featureParams
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
(
this
);
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
lookupIndex
.
sanitize
(
c
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
lookupIndex
.
sanitize
(
c
)
&&
featureParams
.
sanitize
(
c
,
this
));
}
}
Offset
featureParams
;
/* Offset to Feature Parameters table (if one
OffsetTo
<
FeatureParams
>
featureParams
;
/* Offset to Feature Parameters table (if one
* has been defined for the feature), relative
* has been defined for the feature), relative
* to the beginning of the Feature Table; = Null
* to the beginning of the Feature Table; = Null
* if not required */
* if not required */
...
...
src/hb-ot-layout.cc
浏览文件 @
f54cce3c
...
@@ -639,3 +639,34 @@ hb_ot_layout_position_finish (hb_font_t *font, hb_buffer_t *buffer, hb_bool_t ze
...
@@ -639,3 +639,34 @@ hb_ot_layout_position_finish (hb_font_t *font, hb_buffer_t *buffer, hb_bool_t ze
{
{
OT
::
GPOS
::
position_finish
(
font
,
buffer
,
zero_width_attached_marks
);
OT
::
GPOS
::
position_finish
(
font
,
buffer
,
zero_width_attached_marks
);
}
}
hb_bool_t
hb_ot_layout_position_get_size
(
hb_face_t
*
face
,
uint16_t
*
data
/* OUT, 5 items */
)
{
const
OT
::
GPOS
&
gpos
=
_get_gpos
(
face
);
unsigned
int
script_index
;
gpos
.
find_script_index
(
HB_OT_TAG_DEFAULT_SCRIPT
,
&
script_index
);
const
OT
::
LangSys
&
l
=
gpos
.
get_script
(
script_index
).
get_lang_sys
(
HB_OT_TAG_DEFAULT_LANGUAGE
);
unsigned
int
num_features
=
l
.
get_feature_count
();
for
(
unsigned
int
i
=
0
;
i
<
num_features
;
i
++
)
{
unsigned
int
f_index
=
l
.
get_feature_index
(
i
);
if
(
HB_TAG
(
's'
,
'i'
,
'z'
,
'e'
)
==
gpos
.
get_feature_tag
(
f_index
))
{
const
OT
::
Feature
&
f
=
gpos
.
get_feature
(
f_index
);
const
OT
::
FeatureParams
&
params
=
f
.
get_feature_params
();
for
(
unsigned
int
i
=
0
;
i
<
5
;
i
++
)
data
[
i
]
=
params
.
u
.
size
.
params
[
i
];
return
true
;
}
}
for
(
unsigned
int
i
=
0
;
i
<
5
;
i
++
)
data
[
i
]
=
0
;
return
false
;
}
src/hb-ot-layout.h
浏览文件 @
f54cce3c
...
@@ -277,6 +277,11 @@ Xhb_ot_layout_lookup_position (hb_font_t *font,
...
@@ -277,6 +277,11 @@ Xhb_ot_layout_lookup_position (hb_font_t *font,
hb_glyph_position_t
*
positions
/* IN / OUT */
);
hb_glyph_position_t
*
positions
/* IN / OUT */
);
#endif
#endif
/* Optical 'size' feature info. Returns true if found. */
hb_bool_t
hb_ot_layout_position_get_size
(
hb_face_t
*
face
,
uint16_t
*
data
/* OUT, 5 items */
);
HB_END_DECLS
HB_END_DECLS
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录