Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
a4fca9f0
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看板
提交
a4fca9f0
编写于
1月 23, 2017
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[var] Implement DeltaSetIndexMap and advance delta fetching
Not hooked up to hb-ot-font yet.
上级
7b399f73
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
61 addition
and
3 deletion
+61
-3
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+8
-0
src/hb-ot-var-hvar-table.hh
src/hb-ot-var-hvar-table.hh
+53
-3
未找到文件。
src/hb-ot-layout-common-private.hh
浏览文件 @
a4fca9f0
...
...
@@ -1323,6 +1323,14 @@ struct VariationStore
this
+
regions
);
}
inline
float
get_delta
(
unsigned
int
index
,
int
*
coords
,
unsigned
int
coord_count
)
const
{
unsigned
int
outer
=
index
>>
16
;
unsigned
int
inner
=
index
&
0xFFFF
;
return
get_delta
(
outer
,
inner
,
coords
,
coord_count
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
...
...
src/hb-ot-var-hvar-table.hh
浏览文件 @
a4fca9f0
...
...
@@ -39,12 +39,52 @@ struct DeltaSetIndexMap
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
this
,
1
,
12
));
c
->
check_array
(
mapData
,
get_width
(),
mapCount
));
}
USHORT
x
;
unsigned
int
map
(
unsigned
int
v
)
const
/* Returns 16.16 outer.inner. */
{
/* If count is zero, pass value unchanged. This takes
* care of direct mapping for advance map. */
if
(
!
mapCount
)
return
v
;
if
(
v
>=
mapCount
)
v
=
mapCount
-
1
;
unsigned
int
u
=
0
;
{
/* Fetch it. */
unsigned
int
w
=
get_width
();
const
BYTE
*
p
=
mapData
+
w
*
v
;
for
(;
w
;
w
--
)
u
=
(
u
<<
8
)
+
*
p
++
;
}
{
/* Repack it. */
unsigned
int
n
=
get_inner_bitcount
();
unsigned
int
outer
=
u
>>
n
;
unsigned
int
inner
=
u
&
((
1
<<
n
)
-
1
);
u
=
(
outer
<<
16
)
|
inner
;
}
return
u
;
}
protected:
inline
bool
get_width
(
void
)
const
{
return
((
format
>>
4
)
&
3
)
+
1
;
}
inline
bool
get_inner_bitcount
(
void
)
const
{
return
(
format
&
0xF
)
+
1
;
}
protected:
USHORT
format
;
/* A packed field that describes the compressed
* representation of delta-set indices. */
USHORT
mapCount
;
/* The number of mapping entries. */
BYTE
mapData
[
VAR
];
/* The delta-set index mapping data. */
public:
DEFINE_SIZE_
STATIC
(
2
);
DEFINE_SIZE_
ARRAY
(
4
,
mapData
);
};
...
...
@@ -72,6 +112,16 @@ struct HVARVVAR
rsbMap
.
sanitize
(
c
,
this
));
}
inline
float
get_advance_delta
(
hb_codepoint_t
glyph
,
int
*
coords
,
unsigned
int
coord_count
)
const
{
unsigned
int
varidx
=
(
this
+
advMap
).
map
(
glyph
);
return
(
this
+
varStore
).
get_delta
(
varidx
,
coords
,
coord_count
);
}
inline
bool
has_sidebearing_deltas
(
void
)
const
{
return
lsbMap
&&
rsbMap
;
}
protected:
FixedVersion
<>
version
;
/* Version of the metrics variation table
* initially set to 0x00010000u */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录