Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
06558d2a
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看板
提交
06558d2a
编写于
4月 19, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Round instead of trunc
上级
0e206de9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
11 deletion
+11
-11
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+10
-10
src/hb-private.h
src/hb-private.h
+1
-1
未找到文件。
src/hb-ot-layout-gpos-private.hh
浏览文件 @
06558d2a
...
@@ -103,10 +103,10 @@ struct ValueRecord {
...
@@ -103,10 +103,10 @@ struct ValueRecord {
x_scale
=
context
->
font
->
x_scale
;
x_scale
=
context
->
font
->
x_scale
;
y_scale
=
context
->
font
->
y_scale
;
y_scale
=
context
->
font
->
y_scale
;
/* design units -> fractional pixel */
/* design units -> fractional pixel */
if
(
format
&
xPlacement
)
glyph_pos
->
x_offset
+=
_hb_16dot16_mul_
trunc
(
x_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
xPlacement
)
glyph_pos
->
x_offset
+=
_hb_16dot16_mul_
round
(
x_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
yPlacement
)
glyph_pos
->
y_offset
+=
_hb_16dot16_mul_
trunc
(
y_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
yPlacement
)
glyph_pos
->
y_offset
+=
_hb_16dot16_mul_
round
(
y_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
xAdvance
)
glyph_pos
->
x_advance
+=
_hb_16dot16_mul_
trunc
(
x_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
xAdvance
)
glyph_pos
->
x_advance
+=
_hb_16dot16_mul_
round
(
x_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
yAdvance
)
glyph_pos
->
y_advance
+=
_hb_16dot16_mul_
trunc
(
y_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
yAdvance
)
glyph_pos
->
y_advance
+=
_hb_16dot16_mul_
round
(
y_scale
,
*
(
SHORT
*
)
values
++
);
x_ppem
=
context
->
font
->
x_ppem
;
x_ppem
=
context
->
font
->
x_ppem
;
y_ppem
=
context
->
font
->
y_ppem
;
y_ppem
=
context
->
font
->
y_ppem
;
...
@@ -136,8 +136,8 @@ struct AnchorFormat1
...
@@ -136,8 +136,8 @@ struct AnchorFormat1
inline
void
get_anchor
(
hb_ot_layout_context_t
*
context
,
hb_codepoint_t
glyph_id
HB_GNUC_UNUSED
,
inline
void
get_anchor
(
hb_ot_layout_context_t
*
context
,
hb_codepoint_t
glyph_id
HB_GNUC_UNUSED
,
hb_position_t
*
x
,
hb_position_t
*
y
)
const
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
{
*
x
=
_hb_16dot16_mul_
trunc
(
context
->
font
->
x_scale
,
xCoordinate
);
*
x
=
_hb_16dot16_mul_
round
(
context
->
font
->
x_scale
,
xCoordinate
);
*
y
=
_hb_16dot16_mul_
trunc
(
context
->
font
->
y_scale
,
yCoordinate
);
*
y
=
_hb_16dot16_mul_
round
(
context
->
font
->
y_scale
,
yCoordinate
);
}
}
inline
bool
sanitize
(
SANITIZE_ARG_DEF
)
{
inline
bool
sanitize
(
SANITIZE_ARG_DEF
)
{
...
@@ -162,8 +162,8 @@ struct AnchorFormat2
...
@@ -162,8 +162,8 @@ struct AnchorFormat2
{
{
/* TODO Contour
/* TODO Contour
* NOTE only adjust directions with nonzero ppem */
* NOTE only adjust directions with nonzero ppem */
*
x
=
_hb_16dot16_mul_
trunc
(
context
->
font
->
x_scale
,
xCoordinate
);
*
x
=
_hb_16dot16_mul_
round
(
context
->
font
->
x_scale
,
xCoordinate
);
*
y
=
_hb_16dot16_mul_
trunc
(
context
->
font
->
y_scale
,
yCoordinate
);
*
y
=
_hb_16dot16_mul_
round
(
context
->
font
->
y_scale
,
yCoordinate
);
}
}
inline
bool
sanitize
(
SANITIZE_ARG_DEF
)
{
inline
bool
sanitize
(
SANITIZE_ARG_DEF
)
{
...
@@ -187,8 +187,8 @@ struct AnchorFormat3
...
@@ -187,8 +187,8 @@ struct AnchorFormat3
inline
void
get_anchor
(
hb_ot_layout_context_t
*
context
,
hb_codepoint_t
glyph_id
HB_GNUC_UNUSED
,
inline
void
get_anchor
(
hb_ot_layout_context_t
*
context
,
hb_codepoint_t
glyph_id
HB_GNUC_UNUSED
,
hb_position_t
*
x
,
hb_position_t
*
y
)
const
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
{
*
x
=
_hb_16dot16_mul_
trunc
(
context
->
font
->
x_scale
,
xCoordinate
);
*
x
=
_hb_16dot16_mul_
round
(
context
->
font
->
x_scale
,
xCoordinate
);
*
y
=
_hb_16dot16_mul_
trunc
(
context
->
font
->
y_scale
,
yCoordinate
);
*
y
=
_hb_16dot16_mul_
round
(
context
->
font
->
y_scale
,
yCoordinate
);
/* pixel -> fractional pixel */
/* pixel -> fractional pixel */
if
(
context
->
font
->
x_ppem
)
if
(
context
->
font
->
x_ppem
)
...
...
src/hb-private.h
浏览文件 @
06558d2a
...
@@ -235,7 +235,7 @@ _hb_popcount32 (uint32_t mask)
...
@@ -235,7 +235,7 @@ _hb_popcount32 (uint32_t mask)
/* Multiplies a 16dot16 value by another value, then truncates the result */
/* Multiplies a 16dot16 value by another value, then truncates the result */
#define _hb_16dot16_mul_
trunc(A,B) ((int64_t) (A) * (B
) / 0x10000)
#define _hb_16dot16_mul_
round(A,B) (((int64_t) (A) * (B) + 0x8000
) / 0x10000)
#include "hb-object-private.h"
#include "hb-object-private.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录