Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
9eda74c9
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,发现更多精彩内容 >>
提交
9eda74c9
编写于
12月 04, 2016
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[cbdt] Move some more code around
上级
654f9ab0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
49 addition
and
30 deletion
+49
-30
src/hb-ot-cbdt-table.hh
src/hb-ot-cbdt-table.hh
+42
-19
src/hb-ot-font.cc
src/hb-ot-font.cc
+7
-11
未找到文件。
src/hb-ot-cbdt-table.hh
浏览文件 @
9eda74c9
...
...
@@ -80,9 +80,11 @@ struct SBitLineMetrics
DEFINE_SIZE_STATIC
(
12
);
};
/*
* Index Subtables.
*/
struct
IndexSubtableHeader
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
...
...
@@ -202,19 +204,6 @@ struct IndexSubtableRecord
DEFINE_SIZE_STATIC
(
8
);
};
/*
* Glyph Bitmap Data Formats.
*/
struct
GlyphBitmapDataFormat17
{
SmallGlyphMetrics
glyphMetrics
;
ULONG
dataLen
;
BYTE
dataZ
[
VAR
];
DEFINE_SIZE_ARRAY
(
9
,
dataZ
);
};
struct
IndexSubtableArray
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
unsigned
int
count
)
const
...
...
@@ -251,6 +240,8 @@ struct IndexSubtableArray
struct
BitmapSizeTable
{
friend
struct
CBLC
;
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
)
const
{
TRACE_SANITIZE
(
this
);
...
...
@@ -261,6 +252,12 @@ struct BitmapSizeTable
vertical
.
sanitize
(
c
));
}
const
IndexSubtableRecord
*
find_table
(
hb_codepoint_t
glyph
,
const
void
*
base
)
const
{
return
(
base
+
indexSubtableArrayOffset
).
find_table
(
glyph
,
numberOfIndexSubtables
);
}
protected:
OffsetTo
<
IndexSubtableArray
,
ULONG
>
indexSubtableArrayOffset
;
ULONG
indexTablesSize
;
ULONG
numberOfIndexSubtables
;
...
...
@@ -274,9 +271,25 @@ struct BitmapSizeTable
BYTE
bitDepth
;
CHAR
flags
;
public:
DEFINE_SIZE_STATIC
(
48
);
};
/*
* Glyph Bitmap Data Formats.
*/
struct
GlyphBitmapDataFormat17
{
SmallGlyphMetrics
glyphMetrics
;
ULONG
dataLen
;
BYTE
dataZ
[
VAR
];
DEFINE_SIZE_ARRAY
(
9
,
dataZ
);
};
/*
* CBLC -- Color Bitmap Location Table
*/
...
...
@@ -296,18 +309,28 @@ struct CBLC
}
public:
const
BitmapSizeTable
*
find_table
(
hb_codepoint_t
glyph
)
const
const
IndexSubtableRecord
*
find_table
(
hb_codepoint_t
glyph
,
unsigned
int
*
x_ppem
,
unsigned
int
*
y_ppem
)
const
{
// TODO: Make it possible to select strike.
/* TODO: Make it possible to select strike. */
const
BitmapSizeTable
*
sizeTable
=
&
Null
(
BitmapSizeTable
);
unsigned
int
count
=
sizeTables
.
len
;
for
(
uint32_t
i
=
0
;
i
<
count
;
++
i
)
{
for
(
uint32_t
i
=
0
;
i
<
count
;
++
i
)
{
unsigned
int
startGlyphIndex
=
sizeTables
.
array
[
i
].
startGlyphIndex
;
unsigned
int
endGlyphIndex
=
sizeTables
.
array
[
i
].
endGlyphIndex
;
if
(
startGlyphIndex
<=
glyph
&&
glyph
<=
endGlyphIndex
)
{
return
&
sizeTables
[
i
];
if
(
startGlyphIndex
<=
glyph
&&
glyph
<=
endGlyphIndex
)
{
sizeTable
=
&
sizeTables
[
i
];
break
;
}
}
return
NULL
;
*
x_ppem
=
sizeTable
->
ppemX
;
*
y_ppem
=
sizeTable
->
ppemY
;
return
sizeTable
->
find_table
(
glyph
,
this
);
}
protected:
...
...
src/hb-ot-font.cc
浏览文件 @
9eda74c9
...
...
@@ -244,17 +244,13 @@ struct hb_ot_face_cbdt_accelerator_t
inline
bool
get_extents
(
hb_codepoint_t
glyph
,
hb_glyph_extents_t
*
extents
)
const
{
unsigned
int
x_ppem
=
upem
,
y_ppem
=
upem
;
/* TODO Use font ppem if available. */
if
(
cblc
==
NULL
)
{
return
false
;
// Not a color bitmap font.
}
const
OT
::
BitmapSizeTable
*
sizeTable
=
this
->
cblc
->
find_table
(
glyph
);
if
(
sizeTable
==
NULL
)
{
return
false
;
}
const
OT
::
IndexSubtableArray
&
subtables
=
this
->
cblc
+
sizeTable
->
indexSubtableArrayOffset
;
const
OT
::
IndexSubtableRecord
*
subtable_record
=
subtables
.
find_table
(
glyph
,
sizeTable
->
numberOfIndexSubtables
);
const
OT
::
IndexSubtableRecord
*
subtable_record
=
this
->
cblc
->
find_table
(
glyph
,
&
x_ppem
,
&
y_ppem
);
if
(
subtable_record
==
NULL
)
{
return
false
;
}
...
...
@@ -286,10 +282,10 @@ struct hb_ot_face_cbdt_accelerator_t
}
/* Convert to the font units. */
extents
->
x_bearing
*=
upem
/
(
float
)
(
sizeTable
->
ppemX
)
;
extents
->
y_bearing
*=
upem
/
(
float
)
(
sizeTable
->
ppemY
)
;
extents
->
width
*=
upem
/
(
float
)
(
sizeTable
->
ppemX
)
;
extents
->
height
*=
upem
/
(
float
)
(
sizeTable
->
ppemY
)
;
extents
->
x_bearing
*=
upem
/
(
float
)
x_ppem
;
extents
->
y_bearing
*=
upem
/
(
float
)
y_ppem
;
extents
->
width
*=
upem
/
(
float
)
x_ppem
;
extents
->
height
*=
upem
/
(
float
)
y_ppem
;
return
true
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录