Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
58cc233e
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看板
提交
58cc233e
编写于
11月 29, 2013
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[coretext] Cleanup
上级
c8213c61
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
11 deletion
+16
-11
src/hb-coretext.cc
src/hb-coretext.cc
+16
-11
未找到文件。
src/hb-coretext.cc
浏览文件 @
58cc233e
...
@@ -394,6 +394,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
...
@@ -394,6 +394,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
unsigned
int
num_features
)
unsigned
int
num_features
)
{
{
hb_face_t
*
face
=
font
->
face
;
hb_face_t
*
face
=
font
->
face
;
hb_coretext_shaper_face_data_t
*
face_data
=
HB_SHAPER_DATA_GET
(
face
);
hb_coretext_shaper_font_data_t
*
font_data
=
HB_SHAPER_DATA_GET
(
font
);
hb_coretext_shaper_font_data_t
*
font_data
=
HB_SHAPER_DATA_GET
(
font
);
/*
/*
...
@@ -648,7 +649,8 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
...
@@ -648,7 +649,8 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
const
CFRange
range_all
=
CFRangeMake
(
0
,
0
);
const
CFRange
range_all
=
CFRangeMake
(
0
,
0
);
for
(
unsigned
int
i
=
0
;
i
<
num_runs
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
num_runs
;
i
++
)
{
CTRunRef
run
=
(
CTRunRef
)
CFArrayGetValueAtIndex
(
glyph_runs
,
i
);
CTRunRef
run
=
(
CTRunRef
)
CFArrayGetValueAtIndex
(
glyph_runs
,
i
);
/* CoreText does automatic font fallback (AKA "cascading") for characters
/* CoreText does automatic font fallback (AKA "cascading") for characters
...
@@ -657,20 +659,25 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
...
@@ -657,20 +659,25 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
* one and fill in the buffer with .notdef glyphs instead of random glyph
* one and fill in the buffer with .notdef glyphs instead of random glyph
* indices from a different font.
* indices from a different font.
*/
*/
CFRange
range
=
CTRunGetStringRange
(
run
);
CFDictionaryRef
attributes
=
CTRunGetAttributes
(
run
);
CFDictionaryRef
attributes
=
CTRunGetAttributes
(
run
);
CTFontRef
run_ct_font
=
static_cast
<
CTFontRef
>
(
CFDictionaryGetValue
(
attributes
,
kCTFontAttributeName
));
CTFontRef
run_ct_font
=
static_cast
<
CTFontRef
>
(
CFDictionaryGetValue
(
attributes
,
kCTFontAttributeName
));
CGFontRef
run_cg_font
=
CTFontCopyGraphicsFont
(
run_ct_font
,
0
);
CGFontRef
run_cg_font
=
CTFontCopyGraphicsFont
(
run_ct_font
,
0
);
CGFontRef
cg_font
=
CTFontCopyGraphicsFont
(
font_data
->
ct_font
,
0
);
if
(
!
CFEqual
(
run_cg_font
,
face_data
->
cg_font
))
if
(
!
CFEqual
(
run_cg_font
,
cg_font
))
{
{
CFRelease
(
run_cg_font
);
CFRelease
(
run_cg_font
);
CFRelease
(
cg_font
);
for
(
CFIndex
j
=
0
;
j
<
range
.
length
;
j
++
)
{
CFRange
range
=
CTRunGetStringRange
(
run
);
buffer
->
ensure
(
buffer
->
len
+
range
.
length
);
if
(
buffer
->
in_error
)
FAIL
(
"Buffer resize failed"
);
hb_glyph_info_t
*
info
=
buffer
->
info
+
buffer
->
len
;
buffer
->
len
+=
range
.
length
;
for
(
CFIndex
j
=
0
;
j
<
range
.
length
;
j
++
)
{
CGGlyph
notdef
=
0
;
CGGlyph
notdef
=
0
;
double
advance
=
CTFontGetAdvancesForGlyphs
(
font_data
->
ct_font
,
kCTFontHorizontalOrientation
,
&
notdef
,
NULL
,
1
);
double
advance
=
CTFontGetAdvancesForGlyphs
(
font_data
->
ct_font
,
kCTFontHorizontalOrientation
,
&
notdef
,
NULL
,
1
);
hb_glyph_info_t
*
info
=
&
buffer
->
info
[
buffer
->
len
];
info
->
codepoint
=
notdef
;
info
->
codepoint
=
notdef
;
info
->
cluster
=
range
.
location
+
j
;
info
->
cluster
=
range
.
location
+
j
;
...
@@ -678,13 +685,11 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
...
@@ -678,13 +685,11 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
info
->
var1
.
u32
=
0
;
info
->
var1
.
u32
=
0
;
info
->
var2
.
u32
=
0
;
info
->
var2
.
u32
=
0
;
buffer
->
len
++
;
info
++
;
}
}
continue
;
continue
;
}
}
CFRelease
(
run_cg_font
);
CFRelease
(
run_cg_font
);
CFRelease
(
cg_font
);
unsigned
int
num_glyphs
=
CTRunGetGlyphCount
(
run
);
unsigned
int
num_glyphs
=
CTRunGetGlyphCount
(
run
);
if
(
num_glyphs
==
0
)
if
(
num_glyphs
==
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录