Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
914ffaa4
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
914ffaa4
编写于
8月 02, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Indic] Move more repeated work into shape_plan
上级
a8c6da90
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
42 addition
and
21 deletion
+42
-21
src/hb-ot-shape-complex-indic.cc
src/hb-ot-shape-complex-indic.cc
+42
-21
未找到文件。
src/hb-ot-shape-complex-indic.cc
浏览文件 @
914ffaa4
...
@@ -210,12 +210,50 @@ struct indic_shape_plan_t
...
@@ -210,12 +210,50 @@ struct indic_shape_plan_t
pref
(
&
plan
->
map
,
HB_TAG
(
'p'
,
'r'
,
'e'
,
'f'
)),
pref
(
&
plan
->
map
,
HB_TAG
(
'p'
,
'r'
,
'e'
,
'f'
)),
blwf
(
&
plan
->
map
,
HB_TAG
(
'b'
,
'l'
,
'w'
,
'f'
)),
blwf
(
&
plan
->
map
,
HB_TAG
(
'b'
,
'l'
,
'w'
,
'f'
)),
pstf
(
&
plan
->
map
,
HB_TAG
(
'p'
,
's'
,
't'
,
'f'
)),
pstf
(
&
plan
->
map
,
HB_TAG
(
'p'
,
's'
,
't'
,
'f'
)),
is_old_spec
(
IS_OLD_INDIC_TAG
(
plan
->
map
.
get_chosen_script
(
0
)))
{}
is_old_spec
(
IS_OLD_INDIC_TAG
(
plan
->
map
.
get_chosen_script
(
0
))),
virama_glyph
((
hb_codepoint_t
)
-
1
)
{
switch
((
int
)
plan
->
props
.
script
)
{
case
HB_SCRIPT_DEVANAGARI
:
virama
=
0x094D
;
break
;
case
HB_SCRIPT_BENGALI
:
virama
=
0x09CD
;
break
;
case
HB_SCRIPT_GURMUKHI
:
virama
=
0x0A4D
;
break
;
case
HB_SCRIPT_GUJARATI
:
virama
=
0x0ACD
;
break
;
case
HB_SCRIPT_ORIYA
:
virama
=
0x0B4D
;
break
;
case
HB_SCRIPT_TAMIL
:
virama
=
0x0BCD
;
break
;
case
HB_SCRIPT_TELUGU
:
virama
=
0x0C4D
;
break
;
case
HB_SCRIPT_KANNADA
:
virama
=
0x0CCD
;
break
;
case
HB_SCRIPT_MALAYALAM
:
virama
=
0x0D4D
;
break
;
case
HB_SCRIPT_SINHALA
:
virama
=
0x0DCA
;
break
;
case
HB_SCRIPT_KHMER
:
virama
=
0x17D2
;
break
;
default:
virama
=
0
;
break
;
}
}
would_apply_feature_t
pref
;
would_apply_feature_t
pref
;
would_apply_feature_t
blwf
;
would_apply_feature_t
blwf
;
would_apply_feature_t
pstf
;
would_apply_feature_t
pstf
;
bool
is_old_spec
;
bool
is_old_spec
;
hb_codepoint_t
virama
;
hb_codepoint_t
virama_glyph
;
inline
bool
get_virama_glyph
(
hb_font_t
*
font
,
hb_codepoint_t
*
pglyph
)
const
{
hb_codepoint_t
glyph
=
virama_glyph
;
if
(
unlikely
(
virama_glyph
==
(
hb_codepoint_t
)
-
1
))
{
if
(
!
font
->
get_glyph
(
virama
,
0
,
&
glyph
))
glyph
=
0
;
/* Technically speaking, the spec says we should apply 'locl' to virama too.
* Maybe one day... */
/* Our get_glyph() function needs a font, so we can't get the virama glyph
* during shape planning... Instead, overwrite it here. It's safe. Don't worry! */
(
const_cast
<
indic_shape_plan_t
*>
(
this
))
->
virama_glyph
=
glyph
;
}
*
pglyph
=
glyph
;
return
glyph
!=
0
;
}
};
};
static
void
*
static
void
*
...
@@ -282,30 +320,12 @@ update_consonant_positions (const hb_ot_shape_plan_t *plan,
...
@@ -282,30 +320,12 @@ update_consonant_positions (const hb_ot_shape_plan_t *plan,
hb_buffer_t
*
buffer
,
hb_buffer_t
*
buffer
,
hb_font_t
*
font
)
hb_font_t
*
font
)
{
{
hb_codepoint_t
virama
;
switch
((
int
)
buffer
->
props
.
script
)
{
case
HB_SCRIPT_DEVANAGARI
:
virama
=
0x094D
;
break
;
case
HB_SCRIPT_BENGALI
:
virama
=
0x09CD
;
break
;
case
HB_SCRIPT_GURMUKHI
:
virama
=
0x0A4D
;
break
;
case
HB_SCRIPT_GUJARATI
:
virama
=
0x0ACD
;
break
;
case
HB_SCRIPT_ORIYA
:
virama
=
0x0B4D
;
break
;
case
HB_SCRIPT_TAMIL
:
virama
=
0x0BCD
;
break
;
case
HB_SCRIPT_TELUGU
:
virama
=
0x0C4D
;
break
;
case
HB_SCRIPT_KANNADA
:
virama
=
0x0CCD
;
break
;
case
HB_SCRIPT_MALAYALAM
:
virama
=
0x0D4D
;
break
;
case
HB_SCRIPT_SINHALA
:
virama
=
0x0DCA
;
break
;
case
HB_SCRIPT_KHMER
:
virama
=
0x17D2
;
break
;
default:
virama
=
0
;
break
;
}
const
indic_shape_plan_t
*
indic_plan
=
(
const
indic_shape_plan_t
*
)
plan
->
data
;
const
indic_shape_plan_t
*
indic_plan
=
(
const
indic_shape_plan_t
*
)
plan
->
data
;
unsigned
int
consonant_pos
=
indic_plan
->
is_old_spec
?
0
:
1
;
unsigned
int
consonant_pos
=
indic_plan
->
is_old_spec
?
0
:
1
;
hb_codepoint_t
glyphs
[
2
];
hb_codepoint_t
glyphs
[
2
];
if
(
virama
&&
font
->
get_glyph
(
virama
,
0
,
&
glyphs
[
1
-
consonant_pos
]))
if
(
indic_plan
->
get_virama_glyph
(
font
,
&
glyphs
[
1
-
consonant_pos
]))
{
{
/* Technically speaking, the spec says we should apply 'locl' to virama too.
* Maybe one day... */
hb_face_t
*
face
=
font
->
face
;
hb_face_t
*
face
=
font
->
face
;
unsigned
int
count
=
buffer
->
len
;
unsigned
int
count
=
buffer
->
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
...
@@ -324,6 +344,7 @@ static void
...
@@ -324,6 +344,7 @@ static void
initial_reordering_consonant_syllable
(
const
hb_ot_shape_plan_t
*
plan
,
hb_buffer_t
*
buffer
,
hb_mask_t
*
basic_mask_array
,
initial_reordering_consonant_syllable
(
const
hb_ot_shape_plan_t
*
plan
,
hb_buffer_t
*
buffer
,
hb_mask_t
*
basic_mask_array
,
unsigned
int
start
,
unsigned
int
end
)
unsigned
int
start
,
unsigned
int
end
)
{
{
const
indic_shape_plan_t
*
indic_plan
=
(
const
indic_shape_plan_t
*
)
plan
->
data
;
hb_glyph_info_t
*
info
=
buffer
->
info
;
hb_glyph_info_t
*
info
=
buffer
->
info
;
...
@@ -526,7 +547,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, hb_buffer
...
@@ -526,7 +547,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, hb_buffer
/* For old-style Indic script tags, move the first post-base Halant after
/* For old-style Indic script tags, move the first post-base Halant after
* last consonant. */
* last consonant. */
if
(
IS_OLD_INDIC_TAG
(
plan
->
map
.
get_chosen_script
(
0
))
)
{
if
(
indic_plan
->
is_old_spec
)
{
for
(
unsigned
int
i
=
base
+
1
;
i
<
end
;
i
++
)
for
(
unsigned
int
i
=
base
+
1
;
i
<
end
;
i
++
)
if
(
info
[
i
].
indic_category
()
==
OT_H
)
{
if
(
info
[
i
].
indic_category
()
==
OT_H
)
{
unsigned
int
j
;
unsigned
int
j
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录