Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
83de3a60
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看板
提交
83de3a60
编写于
6月 18, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[config] Don't compile color API if HB_NO_COLOR
Part of
https://github.com/harfbuzz/harfbuzz/issues/1652
上级
350f98ea
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
47 deletion
+17
-47
src/hb-ot-color.cc
src/hb-ot-color.cc
+9
-46
src/test-ot-color.cc
src/test-ot-color.cc
+8
-1
未找到文件。
src/hb-ot-color.cc
浏览文件 @
83de3a60
...
@@ -25,20 +25,21 @@
...
@@ -25,20 +25,21 @@
* Google Author(s): Sascha Brawer, Behdad Esfahbod
* Google Author(s): Sascha Brawer, Behdad Esfahbod
*/
*/
#include "hb-open-type.hh"
#include "hb.hh"
#ifndef HB_NO_COLOR
#include "hb-ot.h"
#include "hb-ot-color-cbdt-table.hh"
#include "hb-ot-color-cbdt-table.hh"
#include "hb-ot-color-colr-table.hh"
#include "hb-ot-color-colr-table.hh"
#include "hb-ot-color-cpal-table.hh"
#include "hb-ot-color-cpal-table.hh"
#include "hb-ot-color-sbix-table.hh"
#include "hb-ot-color-sbix-table.hh"
#include "hb-ot-color-svg-table.hh"
#include "hb-ot-color-svg-table.hh"
#include "hb-ot-face.hh"
#include "hb-ot.h"
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include "hb-ot-layout.hh"
/**
/**
* SECTION:hb-ot-color
* SECTION:hb-ot-color
...
@@ -70,9 +71,6 @@
...
@@ -70,9 +71,6 @@
hb_bool_t
hb_bool_t
hb_ot_color_has_palettes
(
hb_face_t
*
face
)
hb_ot_color_has_palettes
(
hb_face_t
*
face
)
{
{
#ifdef HB_NO_COLOR
return
false
;
#endif
return
face
->
table
.
CPAL
->
has_data
();
return
face
->
table
.
CPAL
->
has_data
();
}
}
...
@@ -89,9 +87,6 @@ hb_ot_color_has_palettes (hb_face_t *face)
...
@@ -89,9 +87,6 @@ hb_ot_color_has_palettes (hb_face_t *face)
unsigned
int
unsigned
int
hb_ot_color_palette_get_count
(
hb_face_t
*
face
)
hb_ot_color_palette_get_count
(
hb_face_t
*
face
)
{
{
#ifdef HB_NO_COLOR
return
0
;
#endif
return
face
->
table
.
CPAL
->
get_palette_count
();
return
face
->
table
.
CPAL
->
get_palette_count
();
}
}
...
@@ -115,9 +110,6 @@ hb_ot_name_id_t
...
@@ -115,9 +110,6 @@ hb_ot_name_id_t
hb_ot_color_palette_get_name_id
(
hb_face_t
*
face
,
hb_ot_color_palette_get_name_id
(
hb_face_t
*
face
,
unsigned
int
palette_index
)
unsigned
int
palette_index
)
{
{
#ifdef HB_NO_COLOR
return
HB_OT_NAME_ID_INVALID
;
#endif
return
face
->
table
.
CPAL
->
get_palette_name_id
(
palette_index
);
return
face
->
table
.
CPAL
->
get_palette_name_id
(
palette_index
);
}
}
...
@@ -140,9 +132,6 @@ hb_ot_name_id_t
...
@@ -140,9 +132,6 @@ hb_ot_name_id_t
hb_ot_color_palette_color_get_name_id
(
hb_face_t
*
face
,
hb_ot_color_palette_color_get_name_id
(
hb_face_t
*
face
,
unsigned
int
color_index
)
unsigned
int
color_index
)
{
{
#ifdef HB_NO_COLOR
return
HB_OT_NAME_ID_INVALID
;
#endif
return
face
->
table
.
CPAL
->
get_color_name_id
(
color_index
);
return
face
->
table
.
CPAL
->
get_color_name_id
(
color_index
);
}
}
...
@@ -161,9 +150,6 @@ hb_ot_color_palette_flags_t
...
@@ -161,9 +150,6 @@ hb_ot_color_palette_flags_t
hb_ot_color_palette_get_flags
(
hb_face_t
*
face
,
hb_ot_color_palette_get_flags
(
hb_face_t
*
face
,
unsigned
int
palette_index
)
unsigned
int
palette_index
)
{
{
#ifdef HB_NO_COLOR
return
HB_OT_COLOR_PALETTE_FLAG_DEFAULT
;
#endif
return
face
->
table
.
CPAL
->
get_palette_flags
(
palette_index
);
return
face
->
table
.
CPAL
->
get_palette_flags
(
palette_index
);
}
}
...
@@ -195,11 +181,6 @@ hb_ot_color_palette_get_colors (hb_face_t *face,
...
@@ -195,11 +181,6 @@ hb_ot_color_palette_get_colors (hb_face_t *face,
unsigned
int
*
colors_count
/* IN/OUT. May be NULL. */
,
unsigned
int
*
colors_count
/* IN/OUT. May be NULL. */
,
hb_color_t
*
colors
/* OUT. May be NULL. */
)
hb_color_t
*
colors
/* OUT. May be NULL. */
)
{
{
#ifdef HB_NO_COLOR
if
(
colors_count
)
*
colors_count
=
0
;
return
0
;
#endif
return
face
->
table
.
CPAL
->
get_palette_colors
(
palette_index
,
start_offset
,
colors_count
,
colors
);
return
face
->
table
.
CPAL
->
get_palette_colors
(
palette_index
,
start_offset
,
colors_count
,
colors
);
}
}
...
@@ -221,9 +202,6 @@ hb_ot_color_palette_get_colors (hb_face_t *face,
...
@@ -221,9 +202,6 @@ hb_ot_color_palette_get_colors (hb_face_t *face,
hb_bool_t
hb_bool_t
hb_ot_color_has_layers
(
hb_face_t
*
face
)
hb_ot_color_has_layers
(
hb_face_t
*
face
)
{
{
#ifdef HB_NO_COLOR
return
false
;
#endif
return
face
->
table
.
COLR
->
has_data
();
return
face
->
table
.
COLR
->
has_data
();
}
}
...
@@ -250,11 +228,6 @@ hb_ot_color_glyph_get_layers (hb_face_t *face,
...
@@ -250,11 +228,6 @@ hb_ot_color_glyph_get_layers (hb_face_t *face,
unsigned
int
*
layer_count
,
/* IN/OUT. May be NULL. */
unsigned
int
*
layer_count
,
/* IN/OUT. May be NULL. */
hb_ot_color_layer_t
*
layers
/* OUT. May be NULL. */
)
hb_ot_color_layer_t
*
layers
/* OUT. May be NULL. */
)
{
{
#ifdef HB_NO_COLOR
if
(
layer_count
)
*
layer_count
=
0
;
return
0
;
#endif
return
face
->
table
.
COLR
->
get_glyph_layers
(
glyph
,
start_offset
,
layer_count
,
layers
);
return
face
->
table
.
COLR
->
get_glyph_layers
(
glyph
,
start_offset
,
layer_count
,
layers
);
}
}
...
@@ -276,9 +249,6 @@ hb_ot_color_glyph_get_layers (hb_face_t *face,
...
@@ -276,9 +249,6 @@ hb_ot_color_glyph_get_layers (hb_face_t *face,
hb_bool_t
hb_bool_t
hb_ot_color_has_svg
(
hb_face_t
*
face
)
hb_ot_color_has_svg
(
hb_face_t
*
face
)
{
{
#ifdef HB_NO_COLOR
return
false
;
#endif
return
face
->
table
.
SVG
->
has_data
();
return
face
->
table
.
SVG
->
has_data
();
}
}
...
@@ -296,9 +266,6 @@ hb_ot_color_has_svg (hb_face_t *face)
...
@@ -296,9 +266,6 @@ hb_ot_color_has_svg (hb_face_t *face)
hb_blob_t
*
hb_blob_t
*
hb_ot_color_glyph_reference_svg
(
hb_face_t
*
face
,
hb_codepoint_t
glyph
)
hb_ot_color_glyph_reference_svg
(
hb_face_t
*
face
,
hb_codepoint_t
glyph
)
{
{
#ifdef HB_NO_COLOR
return
hb_blob_get_empty
();
#endif
return
face
->
table
.
SVG
->
reference_blob_for_glyph
(
glyph
);
return
face
->
table
.
SVG
->
reference_blob_for_glyph
(
glyph
);
}
}
...
@@ -320,9 +287,6 @@ hb_ot_color_glyph_reference_svg (hb_face_t *face, hb_codepoint_t glyph)
...
@@ -320,9 +287,6 @@ hb_ot_color_glyph_reference_svg (hb_face_t *face, hb_codepoint_t glyph)
hb_bool_t
hb_bool_t
hb_ot_color_has_png
(
hb_face_t
*
face
)
hb_ot_color_has_png
(
hb_face_t
*
face
)
{
{
#ifdef HB_NO_COLOR
return
false
;
#endif
return
face
->
table
.
CBDT
->
has_data
()
||
face
->
table
.
sbix
->
has_data
();
return
face
->
table
.
CBDT
->
has_data
()
||
face
->
table
.
sbix
->
has_data
();
}
}
...
@@ -342,10 +306,6 @@ hb_ot_color_has_png (hb_face_t *face)
...
@@ -342,10 +306,6 @@ hb_ot_color_has_png (hb_face_t *face)
hb_blob_t
*
hb_blob_t
*
hb_ot_color_glyph_reference_png
(
hb_font_t
*
font
,
hb_codepoint_t
glyph
)
hb_ot_color_glyph_reference_png
(
hb_font_t
*
font
,
hb_codepoint_t
glyph
)
{
{
#ifdef HB_NO_COLOR
return
hb_blob_get_empty
();
#endif
hb_blob_t
*
blob
=
hb_blob_get_empty
();
hb_blob_t
*
blob
=
hb_blob_get_empty
();
if
(
font
->
face
->
table
.
sbix
->
has_data
())
if
(
font
->
face
->
table
.
sbix
->
has_data
())
...
@@ -356,3 +316,6 @@ hb_ot_color_glyph_reference_png (hb_font_t *font, hb_codepoint_t glyph)
...
@@ -356,3 +316,6 @@ hb_ot_color_glyph_reference_png (hb_font_t *font, hb_codepoint_t glyph)
return
blob
;
return
blob
;
}
}
#endif
src/test-ot-color.cc
浏览文件 @
83de3a60
...
@@ -23,7 +23,10 @@
...
@@ -23,7 +23,10 @@
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
*/
#include "hb.h"
#include "hb.hh"
#ifndef HB_NO_COLOR
#include "hb-ot.h"
#include "hb-ot.h"
#include "hb-ft.h"
#include "hb-ft.h"
...
@@ -334,3 +337,7 @@ main (int argc, char **argv)
...
@@ -334,3 +337,7 @@ main (int argc, char **argv)
return
0
;
return
0
;
}
}
#else
int
main
(
int
argc
,
char
**
argv
)
{
return
0
;
}
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录