Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
11e51993
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看板
提交
11e51993
编写于
9月 19, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[util] Move font-size into view-options
上级
0fe29601
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
7 deletion
+6
-7
util/options.cc
util/options.cc
+1
-1
util/options.hh
util/options.hh
+3
-4
util/view-cairo.cc
util/view-cairo.cc
+2
-2
未找到文件。
util/options.cc
浏览文件 @
11e51993
...
...
@@ -336,6 +336,7 @@ view_options_t::add_options (option_parser_t *parser)
{
"foreground"
,
0
,
0
,
G_OPTION_ARG_STRING
,
&
this
->
fore
,
"Set foreground color (default: "
DEFAULT_FORE
")"
,
"red/#rrggbb/#rrggbbaa"
},
{
"line-space"
,
0
,
0
,
G_OPTION_ARG_DOUBLE
,
&
this
->
line_space
,
"Set space between lines (default: 0)"
,
"units"
},
{
"margin"
,
0
,
0
,
G_OPTION_ARG_CALLBACK
,
(
gpointer
)
&
parse_margin
,
"Margin around output (default: "
G_STRINGIFY
(
DEFAULT_MARGIN
)
")"
,
"one to four numbers"
},
{
"font-size"
,
0
,
0
,
G_OPTION_ARG_DOUBLE
,
&
this
->
font_size
,
"Font size (default: "
G_STRINGIFY
(
DEFAULT_FONT_SIZE
)
")"
,
"size"
},
{
NULL
}
};
parser
->
add_group
(
entries
,
...
...
@@ -371,7 +372,6 @@ font_options_t::add_options (option_parser_t *parser)
{
{
"font-file"
,
0
,
0
,
G_OPTION_ARG_STRING
,
&
this
->
font_file
,
"Font file-name"
,
"filename"
},
{
"face-index"
,
0
,
0
,
G_OPTION_ARG_INT
,
&
this
->
face_index
,
"Face index (default: 0)"
,
"index"
},
{
"font-size"
,
0
,
0
,
G_OPTION_ARG_DOUBLE
,
&
this
->
font_size
,
"Font size (default: "
G_STRINGIFY
(
DEFAULT_FONT_SIZE
)
")"
,
"size"
},
{
NULL
}
};
parser
->
add_group
(
entries
,
...
...
util/options.hh
浏览文件 @
11e51993
...
...
@@ -77,6 +77,7 @@ struct option_parser_t
#define DEFAULT_MARGIN 18
#define DEFAULT_FORE "#000000"
#define DEFAULT_BACK "#FFFFFF"
#define DEFAULT_FONT_SIZE 36
struct
view_options_t
:
option_group_t
{
...
...
@@ -86,6 +87,7 @@ struct view_options_t : option_group_t
back
=
DEFAULT_BACK
;
line_space
=
0
;
margin
.
t
=
margin
.
r
=
margin
.
b
=
margin
.
l
=
DEFAULT_MARGIN
;
font_size
=
DEFAULT_FONT_SIZE
;
add_options
(
parser
);
}
...
...
@@ -99,6 +101,7 @@ struct view_options_t : option_group_t
struct
margin_t
{
double
t
,
r
,
b
,
l
;
}
margin
;
double
font_size
;
};
...
...
@@ -142,14 +145,11 @@ struct shape_options_t : option_group_t
};
#define DEFAULT_FONT_SIZE 36
struct
font_options_t
:
option_group_t
{
font_options_t
(
option_parser_t
*
parser
)
{
font_file
=
NULL
;
face_index
=
0
;
font_size
=
DEFAULT_FONT_SIZE
;
font
=
NULL
;
...
...
@@ -165,7 +165,6 @@ struct font_options_t : option_group_t
const
char
*
font_file
;
int
face_index
;
double
font_size
;
private:
mutable
hb_font_t
*
font
;
...
...
util/view-cairo.cc
浏览文件 @
11e51993
...
...
@@ -80,7 +80,7 @@ void
view_cairo_t
::
init
(
const
font_options_t
*
font_opts
)
{
lines
=
g_array_new
(
FALSE
,
FALSE
,
sizeof
(
line_t
));
scale
=
double
(
font_
opts
->
font_
size
)
/
hb_face_get_upem
(
hb_font_get_face
(
font_opts
->
get_font
()));
scale
=
double
(
font_size
)
/
hb_face_get_upem
(
hb_font_get_face
(
font_opts
->
get_font
()));
}
void
...
...
@@ -217,7 +217,7 @@ view_cairo_t::create_scaled_font (const font_options_t *font_opts)
cairo_matrix_init_identity
(
&
ctm
);
cairo_matrix_init_scale
(
&
font_matrix
,
font_
opts
->
font_size
,
font_opts
->
font_size
);
font_
size
,
font_size
);
font_options
=
cairo_font_options_create
();
cairo_font_options_set_hint_style
(
font_options
,
CAIRO_HINT_STYLE_NONE
);
cairo_font_options_set_hint_metrics
(
font_options
,
CAIRO_HINT_METRICS_OFF
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录