Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
fb0f3e37
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,发现更多精彩内容 >>
提交
fb0f3e37
编写于
3月 11, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[sbix] Clean up
上级
218fa716
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
33 deletion
+37
-33
src/hb-ot-color-sbix-table.hh
src/hb-ot-color-sbix-table.hh
+37
-33
未找到文件。
src/hb-ot-color-sbix-table.hh
浏览文件 @
fb0f3e37
...
...
@@ -34,33 +34,43 @@ namespace OT {
struct
SBIXGlyph
{
friend
struct
sbix
;
protected:
HBINT16
originOffsetX
;
HBINT16
originOffsetY
;
unsigned
char
tag
[
4
];
HBUINT8
data
[
VAR
];
HBINT16
xOffset
;
/* The horizontal (x-axis) offset from the left
* edge of the graphic to the glyph’s origin.
* That is, the x-coordinate of the point on the
* baseline at the left edge of the glyph. */
HBINT16
yOffset
;
/* The vertical (y-axis) offset from the bottom
* edge of the graphic to the glyph’s origin.
* That is, the y-coordinate of the point on the
* baseline at the left edge of the glyph. */
Tag
graphicType
;
/* Indicates the format of the embedded graphic
* data: one of 'jpg ', 'png ' or 'tiff', or the
* special format 'dupe'. */
HBUINT8
data
[
VAR
];
/* The actual embedded graphic data. The total
* length is inferred from sequential entries in
* the glyphDataOffsets array and the fixed size
* (8 bytes) of the preceding fields. */
public:
DEFINE_SIZE_
STATIC
(
9
);
DEFINE_SIZE_
ARRAY
(
8
,
data
);
};
struct
ImageTabl
e
struct
SBIXStrik
e
{
friend
struct
sbix
;
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
imageOffsetsZ
,
sizeof
(
HBUINT32
),
c
->
num_glyphs
)
&&
c
->
check_range
(
this
,
imageOffsetsZ
[
c
->
num_glyphs
]));
c
->
check_array
(
imageOffsetsZ
,
sizeof
(
HBUINT32
),
1
+
c
->
num_glyphs
));
}
HBUINT16
ppem
;
/* The PPEM size for which this strike was designed. */
HBUINT16
resolution
;
/* The device pixel density (in PPI) for which this
* strike was designed. (E.g., 96 PPI, 192 PPI.) */
protected:
HBUINT16
ppem
;
HBUINT16
resolution
;
LOffsetTo
<
SBIXGlyph
>
imageOffsetsZ
[
VAR
];
// VAR=maxp.numGlyphs + 1
/* Offset from the beginning of the strike data header
* to bitmap data for an individual glyph ID. */
public:
DEFINE_SIZE_STATIC
(
8
);
};
...
...
@@ -87,40 +97,34 @@ struct sbix
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
if
(
!
(
c
->
check_struct
(
this
)
&&
imageTables
.
sanitize
(
c
,
this
)))
return_trace
(
false
);
for
(
unsigned
int
i
=
0
;
i
<
imageTables
.
len
;
++
i
)
if
(
!
(
imageTables
[
i
].
sanitize
(
c
,
this
)))
return_trace
(
false
);
// dump (c->num_glyphs, 8);
return_trace
(
true
);
return_trace
(
c
->
check_struct
(
this
)
&&
strikes
.
sanitize
(
c
,
this
));
}
// inline void dump (unsigned int num_glyphs, unsigned int group) const
// {
// const
ImageTable &imageTable = imageTabl
es[group](this);
// const
SBIXStrike &strike = strik
es[group](this);
// for (unsigned int i = 0; i < num_glyphs; ++i)
// if (
imageTable.imageOffsetsZ[i + 1] - imageTabl
e.imageOffsetsZ[i] > 0)
// if (
strike.imageOffsetsZ[i + 1] - strik
e.imageOffsetsZ[i] > 0)
// {
// const SBIXGlyph &sbixGlyph =
imageTable.imageOffsetsZ[i]((const void *) &imageTabl
e);
// const SBIXGlyph &sbixGlyph =
strike.imageOffsetsZ[i]((const void *) &strik
e);
// char outName[255];
// sprintf (outName, "out/%d-%d.png", group, i);
// FILE *f = fopen (outName, "wb");
// fwrite (sbixGlyph.data, 1,
//
imageTable.imageOffsetsZ[i + 1] - imageTabl
e.imageOffsetsZ[i] - 8, f);
//
strike.imageOffsetsZ[i + 1] - strik
e.imageOffsetsZ[i] - 8, f);
// fclose (f);
// }
// }
protected:
HBUINT16
version
;
HBUINT16
flags
;
ArrayOf
<
LOffsetTo
<
ImageTable
>
,
HBUINT32
>
imageTables
;
HBUINT16
version
;
/* Table version number — set to 1 */
HBUINT16
flags
;
/* Bit 0: Set to 1. Bit 1: Draw outlines.
* Bits 2 to 15: reserved (set to 0). */
ArrayOf
<
LOffsetTo
<
SBIXStrike
>
,
HBUINT32
>
strikes
;
/* Offsets from the beginning of the 'sbix'
* table to data for each individual bitmap strike. */
public:
DEFINE_SIZE_ARRAY
(
8
,
imageTabl
es
);
DEFINE_SIZE_ARRAY
(
8
,
strik
es
);
};
}
/* namespace OT */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录