Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
0babf761
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看板
未验证
提交
0babf761
编写于
10月 23, 2018
作者:
E
Ebrahim Byagowi
提交者:
GitHub
10月 23, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adopt dump-emoji with latest unreleased APIs changes (#1297)
上级
7997144b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
13 deletion
+11
-13
src/dump-emoji.cc
src/dump-emoji.cc
+11
-13
未找到文件。
src/dump-emoji.cc
浏览文件 @
0babf761
...
...
@@ -95,14 +95,13 @@ colr_cpal_rendering (hb_face_t *face, cairo_font_face_t *cairo_face)
unsigned
glyph_count
=
hb_face_get_glyph_count
(
face
);
for
(
hb_codepoint_t
gid
=
0
;
gid
<
glyph_count
;
++
gid
)
{
unsigned
int
num_layers
=
hb_ot_color_g
et_color_layers
(
face
,
gid
,
0
,
nullptr
,
nullptr
,
nullptr
);
unsigned
int
num_layers
=
hb_ot_color_g
lyph_get_layers
(
face
,
gid
,
0
,
nullptr
,
nullptr
);
if
(
!
num_layers
)
continue
;
hb_codepoint_t
*
layer_gids
=
(
hb_codepoint_t
*
)
calloc
(
num_layers
,
sizeof
(
hb_codepoint_t
));
unsigned
int
*
color_indices
=
(
unsigned
int
*
)
calloc
(
num_layers
,
sizeof
(
unsigned
int
));
hb_ot_color_layer_t
*
layers
=
(
hb_ot_color_layer_t
*
)
malloc
(
num_layers
*
sizeof
(
hb_ot_color_layer_t
));
hb_ot_color_g
et_color_layers
(
face
,
gid
,
0
,
&
num_layers
,
layer_gids
,
color_indice
s
);
hb_ot_color_g
lyph_get_layers
(
face
,
gid
,
0
,
&
num_layers
,
layer
s
);
if
(
num_layers
)
{
// Measure
...
...
@@ -115,7 +114,7 @@ colr_cpal_rendering (hb_face_t *face, cairo_font_face_t *cairo_face)
cairo_glyph_t
*
glyphs
=
(
cairo_glyph_t
*
)
calloc
(
num_layers
,
sizeof
(
cairo_glyph_t
));
for
(
unsigned
int
j
=
0
;
j
<
num_layers
;
++
j
)
glyphs
[
j
].
index
=
layer
_gids
[
j
]
;
glyphs
[
j
].
index
=
layer
s
[
j
].
glyph
;
cairo_glyph_extents
(
cr
,
glyphs
,
num_layers
,
&
extents
);
free
(
glyphs
);
cairo_surface_destroy
(
surface
);
...
...
@@ -129,16 +128,16 @@ colr_cpal_rendering (hb_face_t *face, cairo_font_face_t *cairo_face)
extents
.
y_bearing
-=
extents
.
height
/
20
;
// Render
unsigned
int
palette_count
=
hb_ot_color_
get_palette
_count
(
face
);
unsigned
int
palette_count
=
hb_ot_color_
palette_get
_count
(
face
);
for
(
unsigned
int
palette
=
0
;
palette
<
palette_count
;
palette
++
)
{
char
output_path
[
255
];
unsigned
int
num_colors
=
hb_ot_color_
get_palette
_colors
(
face
,
palette
,
0
,
nullptr
,
nullptr
);
unsigned
int
num_colors
=
hb_ot_color_
palette_get
_colors
(
face
,
palette
,
0
,
nullptr
,
nullptr
);
if
(
!
num_colors
)
continue
;
hb_color_t
*
colors
=
(
hb_color_t
*
)
calloc
(
num_colors
,
sizeof
(
hb_color_t
));
hb_ot_color_
get_palette
_colors
(
face
,
palette
,
0
,
&
num_colors
,
colors
);
hb_ot_color_
palette_get
_colors
(
face
,
palette
,
0
,
&
num_colors
,
colors
);
if
(
num_colors
)
{
// If we have more than one palette, use a simpler naming
...
...
@@ -155,8 +154,8 @@ colr_cpal_rendering (hb_face_t *face, cairo_font_face_t *cairo_face)
for
(
unsigned
int
layer
=
0
;
layer
<
num_layers
;
++
layer
)
{
hb_color_t
color
=
0x000000FF
;
if
(
color_indices
[
layer
]
!=
0xFFFF
)
color
=
colors
[
color_indices
[
layer
]
];
if
(
layers
[
layer
].
color_index
!=
0xFFFF
)
color
=
colors
[
layers
[
layer
].
color_index
];
cairo_set_source_rgba
(
cr
,
hb_color_get_red
(
color
)
/
255.
,
hb_color_get_green
(
color
)
/
255.
,
...
...
@@ -164,7 +163,7 @@ colr_cpal_rendering (hb_face_t *face, cairo_font_face_t *cairo_face)
hb_color_get_alpha
(
color
)
/
255.
);
cairo_glyph_t
glyph
;
glyph
.
index
=
layer
_gids
[
layer
]
;
glyph
.
index
=
layer
s
[
layer
].
glyph
;
glyph
.
x
=
-
extents
.
x_bearing
;
glyph
.
y
=
-
extents
.
y_bearing
;
cairo_show_glyphs
(
cr
,
&
glyph
,
1
);
...
...
@@ -177,8 +176,7 @@ colr_cpal_rendering (hb_face_t *face, cairo_font_face_t *cairo_face)
}
}
free
(
layer_gids
);
free
(
color_indices
);
free
(
layers
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录