Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
1b4a2cc0
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看板
提交
1b4a2cc0
编写于
4月 04, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[hb-view] Add --debug
Frees all allocated memory before exiting. Useful for valgrind run.
上级
b2da26d1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
0 deletion
+17
-0
src/hb-view.c
src/hb-view.c
+17
-0
未找到文件。
src/hb-view.c
浏览文件 @
1b4a2cc0
...
...
@@ -58,6 +58,7 @@ static const char *language = NULL;
static
const
char
*
script
=
NULL
;
static
hb_feature_t
*
features
=
NULL
;
static
unsigned
int
num_features
;
static
hb_bool_t
debug
=
FALSE
;
/* Ugh, global vars. Ugly, but does the job */
static
int
width
=
0
;
...
...
@@ -95,6 +96,7 @@ parse_opts (int argc, char **argv)
int
option_index
=
0
,
c
;
static
struct
option
long_options
[]
=
{
{
"background"
,
1
,
0
,
'B'
},
{
"debug"
,
0
,
&
debug
,
TRUE
},
{
"features"
,
1
,
0
,
'f'
},
{
"font-size"
,
1
,
0
,
's'
},
{
"foreground"
,
1
,
0
,
'F'
},
...
...
@@ -372,6 +374,7 @@ draw (void)
if
(
p
!=
end
)
{
glyphs
=
_hb_cr_text_glyphs
(
cr
,
p
,
end
-
p
,
&
num_glyphs
);
cairo_glyph_extents
(
cr
,
glyphs
,
num_glyphs
,
&
extents
);
y
+=
ceil
(
font_extents
.
ascent
);
...
...
@@ -381,6 +384,7 @@ draw (void)
cairo_show_glyphs
(
cr
,
glyphs
,
num_glyphs
);
cairo_restore
(
cr
);
y
+=
ceil
(
font_extents
.
height
-
ceil
(
font_extents
.
ascent
));
cairo_glyph_free
(
glyphs
);
}
...
...
@@ -419,5 +423,18 @@ main (int argc, char **argv)
exit
(
1
);
}
if
(
debug
)
{
free
(
features
);
cairo_pattern_destroy
(
fore_pattern
);
cairo_pattern_destroy
(
back_pattern
);
cairo_surface_destroy
(
surface
);
cairo_font_face_destroy
(
cairo_face
);
cairo_debug_reset_static_data
();
FT_Done_Face
(
ft_face
);
FT_Done_FreeType
(
ft_library
);
}
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录