Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
3821978b
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
3821978b
编写于
2月 28, 2018
作者:
E
Ebrahim Byagowi
提交者:
GitHub
2月 28, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #847 from ebraminio/colr
[colr] Implement
上级
77227462
f671f7f0
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
122 addition
and
18 deletion
+122
-18
src/Makefile.sources
src/Makefile.sources
+1
-0
src/hb-ot-color.cc
src/hb-ot-color.cc
+9
-0
src/hb-ot-color.h
src/hb-ot-color.h
+0
-9
src/hb-ot-colr-table.hh
src/hb-ot-colr-table.hh
+98
-0
src/hb-ot-cpal-table.hh
src/hb-ot-cpal-table.hh
+3
-3
src/hb-ot-layout-private.hh
src/hb-ot-layout-private.hh
+4
-2
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+7
-4
未找到文件。
src/Makefile.sources
浏览文件 @
3821978b
...
...
@@ -97,6 +97,7 @@ HB_OT_sources = \
hb-ot-layout-jstf-table.hh
\
hb-ot-layout-private.hh
\
hb-ot-color.cc
\
hb-ot-colr-table.hh
\
hb-ot-cpal-table.hh
\
hb-ot-map.cc
\
hb-ot-map-private.hh
\
...
...
src/hb-ot-color.cc
浏览文件 @
3821978b
...
...
@@ -26,6 +26,7 @@
*/
#include "hb-open-type-private.hh"
#include "hb-ot-colr-table.hh"
#include "hb-ot-cpal-table.hh"
#include "hb-ot.h"
...
...
@@ -40,6 +41,14 @@ HB_MARK_AS_FLAG_T (hb_ot_color_palette_flags_t)
//HB_SHAPER_DATA_ENSURE_DECLARE(ot, face) Hmm?
static inline const OT::COLR&
_get_colr (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return OT::Null(OT::COLR);
hb_ot_layout_t * layout = hb_ot_layout_from_face (face);
return *(layout->colr.get ());
}
static inline const OT::CPAL&
_get_cpal (hb_face_t *face)
{
...
...
src/hb-ot-color.h
浏览文件 @
3821978b
...
...
@@ -37,15 +37,6 @@
HB_BEGIN_DECLS
/**
* HB_OT_TAG_CPAL:
* a four-letter tag for identifying the CPAL table with color palettes
*
* Since: REPLACEME
*/
#define HB_OT_TAG_CPAL HB_TAG('C','P','A','L')
/**
* hb_ot_color_t:
* @red: the intensity of the red channel
...
...
src/hb-ot-colr-table.hh
0 → 100644
浏览文件 @
3821978b
/*
* Copyright © 2018 Ebrahim Byagowi
*
* This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
#ifndef HB_OT_COLR_TABLE_HH
#define HB_OT_COLR_TABLE_HH
#include "hb-open-type-private.hh"
/*
* Color Palette
* http://www.microsoft.com/typography/otspec/colr.htm
*/
#define HB_OT_TAG_COLR HB_TAG('C','O','L','R')
namespace
OT
{
struct
LayerRecord
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
true
);
}
HBUINT16
gID
;
/* Glyph ID of layer glyph */
HBUINT16
paletteIndex
;
/* Index value to use with a selected color palette */
public:
DEFINE_SIZE_STATIC
(
4
);
};
struct
BaseGlyphRecord
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
unsigned
int
palettes
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
));
}
HBUINT16
gID
;
/* Glyph ID of reference glyph */
OffsetTo
<
LayerRecord
>
firstLayerIndex
;
/* Index to the layer record */
HBUINT16
numLayers
;
/* Number of color layers associated with this glyph */
public:
DEFINE_SIZE_STATIC
(
6
);
};
struct
COLR
{
static
const
hb_tag_t
tableTag
=
HB_OT_TAG_COLR
;
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
)
&&
c
->
check_array
((
const
void
*
)
&
baseGlyphRecords
,
sizeof
(
BaseGlyphRecord
),
numBaseGlyphRecords
)
&&
c
->
check_array
((
const
void
*
)
&
layerRecordsOffset
,
sizeof
(
LayerRecord
),
numLayerRecords
));
}
protected:
HBUINT16
version
;
/* Table version number */
HBUINT16
numBaseGlyphRecords
;
/* Number of Base Glyph Records */
LOffsetTo
<
BaseGlyphRecord
>
baseGlyphRecords
;
/* Offset to Base Glyph records. */
LOffsetTo
<
LayerRecord
>
layerRecordsOffset
;
/* Offset to Layer Records */
HBUINT16
numLayerRecords
;
/* Number of Layer Records */
public:
DEFINE_SIZE_STATIC
(
14
);
};
}
/* namespace OT */
#endif
/* HB_OT_COLR_TABLE_HH */
src/hb-ot-cpal-table.hh
浏览文件 @
3821978b
...
...
@@ -30,9 +30,6 @@
#include "hb-open-type-private.hh"
namespace
OT
{
/*
* Color Palette
* http://www.microsoft.com/typography/otspec/cpal.htm
...
...
@@ -40,6 +37,9 @@ namespace OT {
#define HB_OT_TAG_CPAL HB_TAG('C','P','A','L')
namespace
OT
{
struct
ColorRecord
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
...
...
src/hb-ot-layout-private.hh
浏览文件 @
3821978b
...
...
@@ -123,10 +123,11 @@ hb_ot_layout_position_finish_offsets (hb_font_t *font,
namespace
OT
{
struct
BASE
;
struct
COLR
;
struct
CPAL
;
struct
GDEF
;
struct
GSUB
;
struct
GPOS
;
struct
CPAL
;
struct
MATH
;
struct
fvar
;
struct
avar
;
...
...
@@ -172,8 +173,9 @@ struct hb_ot_layout_t
/* TODO Move the following out of this struct. */
OT
::
hb_lazy_table_loader_t
<
struct
OT
::
BASE
>
base
;
OT
::
hb_lazy_table_loader_t
<
struct
OT
::
MATH
>
math
;
OT
::
hb_lazy_table_loader_t
<
struct
OT
::
COLR
>
colr
;
OT
::
hb_lazy_table_loader_t
<
struct
OT
::
CPAL
>
cpal
;
OT
::
hb_lazy_table_loader_t
<
struct
OT
::
MATH
>
math
;
OT
::
hb_lazy_table_loader_t
<
struct
OT
::
fvar
>
fvar
;
OT
::
hb_lazy_table_loader_t
<
struct
OT
::
avar
>
avar
;
OT
::
hb_lazy_table_loader_t
<
struct
AAT
::
ankr
>
ankr
;
...
...
src/hb-ot-layout.cc
浏览文件 @
3821978b
...
...
@@ -37,6 +37,7 @@
#include "hb-ot-layout-gpos-table.hh"
#include "hb-ot-layout-jstf-table.hh" // Just so we compile it; unused otherwise.
#include "hb-ot-name-table.hh" // Just so we compile it; unused otherwise.
#include "hb-ot-colr-table.hh"
#include "hb-ot-cpal-table.hh"
#include "hb-ot-map-private.hh"
...
...
@@ -63,9 +64,10 @@ _hb_ot_layout_create (hb_face_t *face)
layout
->
gpos_blob
=
OT
::
Sanitizer
<
OT
::
GPOS
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_GPOS
));
layout
->
gpos
=
OT
::
Sanitizer
<
OT
::
GPOS
>::
lock_instance
(
layout
->
gpos_blob
);
layout
->
math
.
init
(
face
);
layout
->
cpal
.
init
(
face
);
layout
->
base
.
init
(
face
);
layout
->
colr
.
init
(
face
);
layout
->
cpal
.
init
(
face
);
layout
->
math
.
init
(
face
);
layout
->
fvar
.
init
(
face
);
layout
->
avar
.
init
(
face
);
layout
->
ankr
.
init
(
face
);
...
...
@@ -218,9 +220,10 @@ _hb_ot_layout_destroy (hb_ot_layout_t *layout)
hb_blob_destroy
(
layout
->
gsub_blob
);
hb_blob_destroy
(
layout
->
gpos_blob
);
layout
->
math
.
fini
();
layout
->
cpal
.
fini
();
layout
->
base
.
fini
();
layout
->
colr
.
fini
();
layout
->
cpal
.
fini
();
layout
->
math
.
fini
();
layout
->
fvar
.
fini
();
layout
->
avar
.
fini
();
layout
->
ankr
.
fini
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录