Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
baa329c6
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看板
提交
baa329c6
编写于
3月 18, 2016
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[GX] Add compact VariationDevice implementation
Add compact format that uses signed bytes instead of shorts.
上级
71b06fd3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
11 deletion
+25
-11
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+1
-0
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+24
-11
未找到文件。
src/hb-open-type-private.hh
浏览文件 @
baa329c6
...
@@ -653,6 +653,7 @@ struct IntType
...
@@ -653,6 +653,7 @@ struct IntType
typedef
IntType
<
int8_t
,
1
>
CHAR
;
/* 8-bit signed integer. */
typedef
IntType
<
int8_t
,
1
>
CHAR
;
/* 8-bit signed integer. */
typedef
IntType
<
uint8_t
,
1
>
BYTE
;
/* 8-bit unsigned integer. */
typedef
IntType
<
uint8_t
,
1
>
BYTE
;
/* 8-bit unsigned integer. */
typedef
IntType
<
int8_t
,
1
>
INT8
;
/* 8-bit signed integer. */
typedef
IntType
<
uint16_t
,
2
>
USHORT
;
/* 16-bit unsigned integer. */
typedef
IntType
<
uint16_t
,
2
>
USHORT
;
/* 16-bit unsigned integer. */
typedef
IntType
<
int16_t
,
2
>
SHORT
;
/* 16-bit signed integer. */
typedef
IntType
<
int16_t
,
2
>
SHORT
;
/* 16-bit signed integer. */
typedef
IntType
<
uint32_t
,
4
>
ULONG
;
/* 32-bit unsigned integer. */
typedef
IntType
<
uint32_t
,
4
>
ULONG
;
/* 32-bit unsigned integer. */
...
...
src/hb-ot-layout-common-private.hh
浏览文件 @
baa329c6
...
@@ -1419,6 +1419,9 @@ struct VariationDevice
...
@@ -1419,6 +1419,9 @@ struct VariationDevice
{
{
friend
struct
Device
;
friend
struct
Device
;
static
const
unsigned
short
FORMAT_BYTES
=
0x0100
;
static
const
unsigned
short
FORMAT_SHORTS
=
0x0101
;
private:
private:
inline
hb_position_t
get_x_delta
(
hb_font_t
*
font
)
const
inline
hb_position_t
get_x_delta
(
hb_font_t
*
font
)
const
...
@@ -1431,29 +1434,39 @@ struct VariationDevice
...
@@ -1431,29 +1434,39 @@ struct VariationDevice
{
{
TRACE_SANITIZE
(
this
);
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
)
&&
return_trace
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
&
deltaValue
,
SHORT
::
static_size
,
deltaCount
));
c
->
check_array
(
&
deltaValue
,
get_item_size
()
,
deltaCount
));
}
}
private:
private:
inline
unsigned
int
get_item_size
(
void
)
const
{
return
deltaFormat
==
FORMAT_BYTES
?
1
:
2
;
}
inline
float
get_delta
(
int
*
coords
,
unsigned
int
coord_count
)
const
inline
float
get_delta
(
int
*
coords
,
unsigned
int
coord_count
)
const
{
{
float
v
=
0
;
float
v
=
0
;
const
VariationMap
&
map
=
this
+
variationMap
;
const
VariationMap
&
map
=
this
+
variationMap
;
unsigned
int
count
=
MIN
((
unsigned
int
)
deltaCount
,
map
.
get_len
());
unsigned
int
count
=
MIN
((
unsigned
int
)
deltaCount
,
map
.
get_len
());
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
get_item_size
()
==
1
)
v
+=
deltaValue
[
i
]
*
map
[
i
].
evaluate
(
coords
,
coord_count
);
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
v
+=
deltaValue
.
bytesZ
[
i
]
*
map
[
i
].
evaluate
(
coords
,
coord_count
);
else
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
v
+=
deltaValue
.
shortsZ
[
i
]
*
map
[
i
].
evaluate
(
coords
,
coord_count
);
return
v
;
return
v
;
}
}
protected:
protected:
OffsetTo
<
VariationMap
>
OffsetTo
<
VariationMap
>
variationMap
;
/* Offset to variation mapping for this table. */
variationMap
;
/* Offset to variation mapping for this table. */
USHORT
deltaCount
;
/* Number of deltas in this table. */
USHORT
deltaCount
;
/* Number of deltas in this table. */
USHORT
deltaFormat
;
/* Format identifier for this table: 0x10 */
USHORT
deltaFormat
;
/* Format identifier for this table: 0x0100 or 0x0101 */
SHORT
deltaValue
[
VAR
];
/* Deltas as signed values in design space. */
union
{
INT8
bytesZ
[
VAR
];
/* Deltas as signed bytes in design space; format=0x0100 */
SHORT
shortsZ
[
VAR
];
/* Deltas as signed shorts in design space; format=0x0101 */
}
deltaValue
;
public:
public:
DEFINE_SIZE_ARRAY
(
6
,
deltaValue
);
DEFINE_SIZE_ARRAY
(
6
,
deltaValue
.
shortsZ
);
};
};
struct
Device
struct
Device
...
@@ -1464,7 +1477,7 @@ struct Device
...
@@ -1464,7 +1477,7 @@ struct Device
{
{
case
1
:
case
2
:
case
3
:
case
1
:
case
2
:
case
3
:
return
u
.
hinting
.
get_x_delta
(
font
);
return
u
.
hinting
.
get_x_delta
(
font
);
case
0x10
:
case
VariationDevice
::
FORMAT_BYTES
:
case
VariationDevice
::
FORMAT_SHORTS
:
return
u
.
variation
.
get_x_delta
(
font
);
return
u
.
variation
.
get_x_delta
(
font
);
default:
default:
return
0
;
return
0
;
...
@@ -1476,7 +1489,7 @@ struct Device
...
@@ -1476,7 +1489,7 @@ struct Device
{
{
case
1
:
case
2
:
case
3
:
case
1
:
case
2
:
case
3
:
return
u
.
hinting
.
get_x_delta
(
font
);
return
u
.
hinting
.
get_x_delta
(
font
);
case
0x10
:
case
VariationDevice
::
FORMAT_BYTES
:
case
VariationDevice
::
FORMAT_SHORTS
:
return
u
.
variation
.
get_x_delta
(
font
);
return
u
.
variation
.
get_x_delta
(
font
);
default:
default:
return
0
;
return
0
;
...
@@ -1490,7 +1503,7 @@ struct Device
...
@@ -1490,7 +1503,7 @@ struct Device
switch
(
u
.
b
.
format
)
{
switch
(
u
.
b
.
format
)
{
case
1
:
case
2
:
case
3
:
case
1
:
case
2
:
case
3
:
return_trace
(
u
.
hinting
.
sanitize
(
c
));
return_trace
(
u
.
hinting
.
sanitize
(
c
));
case
0x10
:
case
VariationDevice
::
FORMAT_BYTES
:
case
VariationDevice
::
FORMAT_SHORTS
:
return_trace
(
u
.
variation
.
sanitize
(
c
));
return_trace
(
u
.
variation
.
sanitize
(
c
));
default:
default:
return_trace
(
true
);
return_trace
(
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录