Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
851784f8
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看板
提交
851784f8
编写于
11月 14, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve shaper selection
上级
f3584d3a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
39 addition
and
14 deletion
+39
-14
src/hb-ot-map-private.hh
src/hb-ot-map-private.hh
+4
-4
src/hb-ot-map.cc
src/hb-ot-map.cc
+4
-2
src/hb-ot-shape-complex-indic.cc
src/hb-ot-shape-complex-indic.cc
+1
-1
src/hb-ot-shape-complex-private.hh
src/hb-ot-shape-complex-private.hh
+8
-5
src/hb-ot-shape-complex-thai.cc
src/hb-ot-shape-complex-thai.cc
+22
-2
未找到文件。
src/hb-ot-map-private.hh
浏览文件 @
851784f8
...
@@ -115,9 +115,6 @@ struct hb_ot_map_t
...
@@ -115,9 +115,6 @@ struct hb_ot_map_t
*
lookup_count
=
end
-
start
;
*
lookup_count
=
end
-
start
;
}
}
inline
hb_tag_t
get_chosen_script
(
unsigned
int
table_index
)
const
{
return
chosen_script
[
table_index
];
}
HB_INTERNAL
void
substitute_closure
(
const
struct
hb_ot_shape_plan_t
*
plan
,
hb_face_t
*
face
,
hb_set_t
*
glyphs
)
const
;
HB_INTERNAL
void
substitute_closure
(
const
struct
hb_ot_shape_plan_t
*
plan
,
hb_face_t
*
face
,
hb_set_t
*
glyphs
)
const
;
HB_INTERNAL
void
substitute
(
const
struct
hb_ot_shape_plan_t
*
plan
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
)
const
;
HB_INTERNAL
void
substitute
(
const
struct
hb_ot_shape_plan_t
*
plan
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
)
const
;
HB_INTERNAL
void
position
(
const
struct
hb_ot_shape_plan_t
*
plan
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
)
const
;
HB_INTERNAL
void
position
(
const
struct
hb_ot_shape_plan_t
*
plan
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
)
const
;
...
@@ -130,6 +127,9 @@ struct hb_ot_map_t
...
@@ -130,6 +127,9 @@ struct hb_ot_map_t
pauses
[
1
].
finish
();
pauses
[
1
].
finish
();
}
}
public:
hb_tag_t
chosen_script
[
2
];
bool
found_script
[
2
];
private:
private:
...
@@ -140,7 +140,6 @@ struct hb_ot_map_t
...
@@ -140,7 +140,6 @@ struct hb_ot_map_t
hb_mask_t
global_mask
;
hb_mask_t
global_mask
;
hb_tag_t
chosen_script
[
2
];
hb_prealloced_array_t
<
feature_map_t
,
8
>
features
;
hb_prealloced_array_t
<
feature_map_t
,
8
>
features
;
hb_prealloced_array_t
<
lookup_map_t
,
32
>
lookups
[
2
];
/* GSUB/GPOS */
hb_prealloced_array_t
<
lookup_map_t
,
32
>
lookups
[
2
];
/* GSUB/GPOS */
hb_prealloced_array_t
<
pause_map_t
,
1
>
pauses
[
2
];
/* GSUB/GPOS */
hb_prealloced_array_t
<
pause_map_t
,
1
>
pauses
[
2
];
/* GSUB/GPOS */
...
@@ -200,6 +199,7 @@ struct hb_ot_map_builder_t
...
@@ -200,6 +199,7 @@ struct hb_ot_map_builder_t
hb_segment_properties_t
props
;
hb_segment_properties_t
props
;
hb_tag_t
chosen_script
[
2
];
hb_tag_t
chosen_script
[
2
];
bool
found_script
[
2
];
unsigned
int
script_index
[
2
],
language_index
[
2
];
unsigned
int
script_index
[
2
],
language_index
[
2
];
private:
private:
...
...
src/hb-ot-map.cc
浏览文件 @
851784f8
...
@@ -79,7 +79,7 @@ hb_ot_map_builder_t::hb_ot_map_builder_t (hb_face_t *face_,
...
@@ -79,7 +79,7 @@ hb_ot_map_builder_t::hb_ot_map_builder_t (hb_face_t *face_,
for
(
unsigned
int
table_index
=
0
;
table_index
<
2
;
table_index
++
)
{
for
(
unsigned
int
table_index
=
0
;
table_index
<
2
;
table_index
++
)
{
hb_tag_t
table_tag
=
table_tags
[
table_index
];
hb_tag_t
table_tag
=
table_tags
[
table_index
];
hb_ot_layout_table_choose_script
(
face
,
table_tag
,
script_tags
,
&
script_index
[
table_index
],
&
chosen_script
[
table_index
]);
found_script
[
table_index
]
=
hb_ot_layout_table_choose_script
(
face
,
table_tag
,
script_tags
,
&
script_index
[
table_index
],
&
chosen_script
[
table_index
]);
hb_ot_layout_script_find_language
(
face
,
table_tag
,
script_index
[
table_index
],
language_tag
,
&
language_index
[
table_index
]);
hb_ot_layout_script_find_language
(
face
,
table_tag
,
script_index
[
table_index
],
language_tag
,
&
language_index
[
table_index
]);
}
}
}
}
...
@@ -161,8 +161,10 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
...
@@ -161,8 +161,10 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
{
{
m
.
global_mask
=
1
;
m
.
global_mask
=
1
;
for
(
unsigned
int
table_index
=
0
;
table_index
<
2
;
table_index
++
)
for
(
unsigned
int
table_index
=
0
;
table_index
<
2
;
table_index
++
)
{
m
.
chosen_script
[
table_index
]
=
chosen_script
[
table_index
];
m
.
chosen_script
[
table_index
]
=
chosen_script
[
table_index
];
m
.
found_script
[
table_index
]
=
found_script
[
table_index
];
}
if
(
!
feature_infos
.
len
)
if
(
!
feature_infos
.
len
)
return
;
return
;
...
...
src/hb-ot-shape-complex-indic.cc
浏览文件 @
851784f8
...
@@ -329,7 +329,7 @@ data_create_indic (const hb_ot_shape_plan_t *plan)
...
@@ -329,7 +329,7 @@ data_create_indic (const hb_ot_shape_plan_t *plan)
break
;
break
;
}
}
indic_plan
->
is_old_spec
=
indic_plan
->
config
->
has_old_spec
&&
((
plan
->
map
.
get_chosen_script
(
0
)
&
0x000000FF
)
!=
'2'
);
indic_plan
->
is_old_spec
=
indic_plan
->
config
->
has_old_spec
&&
((
plan
->
map
.
chosen_script
[
0
]
&
0x000000FF
)
!=
'2'
);
indic_plan
->
virama_glyph
=
(
hb_codepoint_t
)
-
1
;
indic_plan
->
virama_glyph
=
(
hb_codepoint_t
)
-
1
;
indic_plan
->
rphf
.
init
(
&
plan
->
map
,
HB_TAG
(
'r'
,
'p'
,
'h'
,
'f'
));
indic_plan
->
rphf
.
init
(
&
plan
->
map
,
HB_TAG
(
'r'
,
'p'
,
'h'
,
'f'
));
...
...
src/hb-ot-shape-complex-private.hh
浏览文件 @
851784f8
...
@@ -278,15 +278,18 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
...
@@ -278,15 +278,18 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
case
HB_SCRIPT_TAKRI
:
case
HB_SCRIPT_TAKRI
:
/* Only use Indic shaper if the font has Indic tables. */
/* Only use Indic shaper if the font has Indic tables. */
if
(
planner
->
map
.
chosen_script
[
0
]
==
HB_OT_TAG_DEFAULT_SCRIPT
)
if
(
planner
->
map
.
found_script
[
0
])
return
&
_hb_ot_complex_shaper_default
;
else
return
&
_hb_ot_complex_shaper_indic
;
return
&
_hb_ot_complex_shaper_indic
;
else
return
&
_hb_ot_complex_shaper_default
;
case
HB_SCRIPT_KHMER
:
case
HB_SCRIPT_KHMER
:
/* If the font has 'liga', let the generic shaper do it. */
/* If the font has 'liga', let the generic shaper do it. */
if
(
planner
->
map
.
chosen_script
[
0
]
==
HB_OT_TAG_DEFAULT_SCRIPT
||
if
(
!
planner
->
map
.
found_script
[
0
]
||
hb_ot_layout_language_find_feature
(
planner
->
face
,
HB_OT_TAG_GSUB
,
planner
->
map
.
script_index
[
0
],
planner
->
map
.
language_index
[
0
],
HB_TAG
(
'l'
,
'i'
,
'g'
,
'a'
),
NULL
))
hb_ot_layout_language_find_feature
(
planner
->
face
,
HB_OT_TAG_GSUB
,
planner
->
map
.
script_index
[
0
],
planner
->
map
.
language_index
[
0
],
HB_TAG
(
'l'
,
'i'
,
'g'
,
'a'
),
NULL
))
return
&
_hb_ot_complex_shaper_default
;
return
&
_hb_ot_complex_shaper_default
;
else
else
return
&
_hb_ot_complex_shaper_indic
;
return
&
_hb_ot_complex_shaper_indic
;
...
...
src/hb-ot-shape-complex-thai.cc
浏览文件 @
851784f8
...
@@ -30,10 +30,26 @@
...
@@ -30,10 +30,26 @@
/* Thai / Lao shaper */
/* Thai / Lao shaper */
static
void
static
void
preprocess_text_thai
(
const
hb_ot_shape_plan_t
*
plan
HB_UNUSED
,
do_thai_pua_shaping
(
const
hb_ot_shape_plan_t
*
plan
,
hb_buffer_t
*
buffer
,
hb_font_t
*
font
)
{
}
static
void
preprocess_text_thai
(
const
hb_ot_shape_plan_t
*
plan
,
hb_buffer_t
*
buffer
,
hb_buffer_t
*
buffer
,
hb_font_t
*
font
HB_UNUSED
)
hb_font_t
*
font
)
{
{
/* This function implements the shaping logic documented here:
*
* http://linux.thai.net/~thep/th-otf/shaping.html
*
* The first shaping rule listed there is needed even if the font has Thai
* OpenType tables. The rest do fallback positioning based on PUA codepoints.
* We implement that only if there exist no Thai GSUB in the font.
*/
/* The following is NOT specified in the MS OT Thai spec, however, it seems
/* The following is NOT specified in the MS OT Thai spec, however, it seems
* to be what Uniscribe and other engines implement. According to Eric Muller:
* to be what Uniscribe and other engines implement. According to Eric Muller:
*
*
...
@@ -122,6 +138,10 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan HB_UNUSED,
...
@@ -122,6 +138,10 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan HB_UNUSED,
}
}
}
}
buffer
->
swap_buffers
();
buffer
->
swap_buffers
();
/* If font has Thai GSUB, we are done. */
if
(
plan
->
props
.
script
==
HB_SCRIPT_THAI
&&
!
plan
->
map
.
found_script
[
0
])
do_thai_pua_shaping
(
plan
,
buffer
,
font
);
}
}
const
hb_ot_complex_shaper_t
_hb_ot_complex_shaper_thai
=
const
hb_ot_complex_shaper_t
_hb_ot_complex_shaper_thai
=
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录