Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
9bef3611
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看板
提交
9bef3611
编写于
11月 05, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename [xy]_pos to [xy]_offset since we don't accumulate positions
上级
2daa47e9
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
32 addition
and
48 deletion
+32
-48
src/hb-buffer-private.h
src/hb-buffer-private.h
+2
-2
src/hb-buffer.h
src/hb-buffer.h
+2
-2
src/hb-font.h
src/hb-font.h
+2
-2
src/hb-ft.c
src/hb-ft.c
+5
-5
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+12
-28
src/hb-shape.c
src/hb-shape.c
+7
-7
src/hb-shape.h
src/hb-shape.h
+2
-2
未找到文件。
src/hb-buffer-private.h
浏览文件 @
9bef3611
...
...
@@ -47,10 +47,10 @@ typedef struct _hb_internal_glyph_info_t {
}
hb_internal_glyph_info_t
;
typedef
struct
_hb_internal_glyph_position_t
{
hb_position_t
x_pos
;
hb_position_t
y_pos
;
hb_position_t
x_advance
;
hb_position_t
y_advance
;
hb_position_t
x_offset
;
hb_position_t
y_offset
;
uint32_t
new_advance
:
1
;
/* if set, the advance width values are
absolute, i.e., they won't be
added to the original glyph's value
...
...
src/hb-buffer.h
浏览文件 @
9bef3611
...
...
@@ -52,10 +52,10 @@ typedef struct _hb_glyph_info_t {
}
hb_glyph_info_t
;
typedef
struct
_hb_glyph_position_t
{
hb_position_t
x_pos
;
hb_position_t
y_pos
;
hb_position_t
x_advance
;
hb_position_t
y_advance
;
hb_position_t
x_offset
;
hb_position_t
y_offset
;
/* XXX these should all be replaced by "uint32_t internal" */
uint32_t
new_advance
:
1
;
/* if set, the advance width values are
absolute, i.e., they won't be
...
...
src/hb-font.h
浏览文件 @
9bef3611
...
...
@@ -94,10 +94,10 @@ hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs);
typedef
struct
_hb_glyph_metrics_t
{
hb_position_t
x_pos
;
hb_position_t
y_pos
;
hb_position_t
x_advance
;
hb_position_t
y_advance
;
hb_position_t
x_offset
;
hb_position_t
y_offset
;
hb_position_t
width
;
hb_position_t
height
;
}
hb_glyph_metrics_t
;
...
...
src/hb-ft.c
浏览文件 @
9bef3611
...
...
@@ -82,18 +82,18 @@ hb_ft_get_glyph_metrics (hb_font_t *font, hb_face_t *face, const void *user_data
/* TODO: load_flags, embolden, etc */
metrics
->
x_pos
=
metrics
->
y_pos
=
0
;
metrics
->
x_advance
=
metrics
->
y_advance
=
0
;
metrics
->
x_offset
=
metrics
->
y_offset
=
0
;
metrics
->
width
=
metrics
->
height
=
0
;
if
(
HB_LIKELY
(
!
FT_Load_Glyph
(
ft_face
,
glyph
,
load_flags
)))
{
/* TODO: A few negations should be in order here, not sure. */
metrics
->
x_pos
=
ft_face
->
glyph
->
metrics
.
horiBearingX
;
metrics
->
y_pos
=
ft_face
->
glyph
->
metrics
.
horiBearingY
;
metrics
->
width
=
ft_face
->
glyph
->
metrics
.
width
;
metrics
->
height
=
ft_face
->
glyph
->
metrics
.
height
;
metrics
->
x_advance
=
ft_face
->
glyph
->
advance
.
x
;
metrics
->
y_advance
=
ft_face
->
glyph
->
advance
.
y
;
metrics
->
x_offset
=
ft_face
->
glyph
->
metrics
.
horiBearingX
;
metrics
->
y_offset
=
ft_face
->
glyph
->
metrics
.
horiBearingY
;
metrics
->
width
=
ft_face
->
glyph
->
metrics
.
width
;
metrics
->
height
=
ft_face
->
glyph
->
metrics
.
height
;
}
}
...
...
src/hb-ot-layout-gpos-private.hh
浏览文件 @
9bef3611
...
...
@@ -103,41 +103,25 @@ struct ValueRecord {
x_scale
=
context
->
font
->
x_scale
;
y_scale
=
context
->
font
->
y_scale
;
/* design units -> fractional pixel */
if
(
format
&
xPlacement
)
glyph_pos
->
x_pos
+=
_hb_16dot16_mul_trunc
(
x_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
yPlacement
)
glyph_pos
->
y_pos
+=
_hb_16dot16_mul_trunc
(
y_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
xAdvance
)
glyph_pos
->
x_advance
+=
_hb_16dot16_mul_trunc
(
x_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
yAdvance
)
glyph_pos
->
y_advance
+=
_hb_16dot16_mul_trunc
(
y_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
xPlacement
)
glyph_pos
->
x_offset
+=
_hb_16dot16_mul_trunc
(
x_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
yPlacement
)
glyph_pos
->
y_offset
+=
_hb_16dot16_mul_trunc
(
y_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
xAdvance
)
glyph_pos
->
x_advance
+=
_hb_16dot16_mul_trunc
(
x_scale
,
*
(
SHORT
*
)
values
++
);
if
(
format
&
yAdvance
)
glyph_pos
->
y_advance
+=
_hb_16dot16_mul_trunc
(
y_scale
,
*
(
SHORT
*
)
values
++
);
x_ppem
=
context
->
font
->
x_ppem
;
y_ppem
=
context
->
font
->
y_ppem
;
/* pixel -> fractional pixel */
if
(
format
&
xPlaDevice
)
{
if
(
x_ppem
)
glyph_pos
->
x_pos
+=
(
base
+*
(
OffsetTo
<
Device
>*
)
values
++
).
get_delta
(
x_ppem
)
<<
6
;
else
values
++
;
if
(
x_ppem
)
glyph_pos
->
x_offset
+=
(
base
+*
(
OffsetTo
<
Device
>*
)
values
++
).
get_delta
(
x_ppem
)
<<
6
;
else
values
++
;
}
if
(
format
&
yPlaDevice
)
{
if
(
y_ppem
)
glyph_pos
->
y_pos
+=
(
base
+*
(
OffsetTo
<
Device
>*
)
values
++
).
get_delta
(
y_ppem
)
<<
6
;
else
values
++
;
if
(
y_ppem
)
glyph_pos
->
y_offset
+=
(
base
+*
(
OffsetTo
<
Device
>*
)
values
++
).
get_delta
(
y_ppem
)
<<
6
;
else
values
++
;
}
if
(
format
&
xAdvDevice
)
{
if
(
x_ppem
)
glyph_pos
->
x_advance
+=
(
base
+*
(
OffsetTo
<
Device
>*
)
values
++
).
get_delta
(
x_ppem
)
<<
6
;
else
values
++
;
if
(
x_ppem
)
glyph_pos
->
x_advance
+=
(
base
+*
(
OffsetTo
<
Device
>*
)
values
++
).
get_delta
(
x_ppem
)
<<
6
;
else
values
++
;
}
if
(
format
&
yAdvDevice
)
{
if
(
y_ppem
)
glyph_pos
->
y_advance
+=
(
base
+*
(
OffsetTo
<
Device
>*
)
values
++
).
get_delta
(
y_ppem
)
<<
6
;
else
values
++
;
if
(
y_ppem
)
glyph_pos
->
y_advance
+=
(
base
+*
(
OffsetTo
<
Device
>*
)
values
++
).
get_delta
(
y_ppem
)
<<
6
;
else
values
++
;
}
}
};
...
...
@@ -330,10 +314,10 @@ struct MarkArray
glyph_anchor
.
get_anchor
(
context
,
IN_GLYPH
(
glyph_pos
),
&
base_x
,
&
base_y
);
hb_internal_glyph_position_t
*
o
=
POSITION
(
buffer
->
in_pos
);
o
->
x_pos
=
base_x
-
mark_x
;
o
->
y_pos
=
base_y
-
mark_y
;
o
->
x_advance
=
0
;
o
->
y_advance
=
0
;
o
->
x_offset
=
base_x
-
mark_x
;
o
->
y_offset
=
base_y
-
mark_y
;
o
->
back
=
buffer
->
in_pos
-
glyph_pos
;
buffer
->
in_pos
++
;
...
...
@@ -868,12 +852,12 @@ struct CursivePosFormat1
if
(
lookup_flag
&
LookupFlag
::
RightToLeft
)
{
POSITION
(
last_pos
)
->
cursive_chain
=
last_pos
-
buffer
->
in_pos
;
POSITION
(
last_pos
)
->
y_
pos
=
entry_y
-
gpi
->
anchor_y
;
POSITION
(
last_pos
)
->
y_
offset
=
entry_y
-
gpi
->
anchor_y
;
}
else
{
POSITION
(
buffer
->
in_pos
)
->
cursive_chain
=
buffer
->
in_pos
-
last_pos
;
POSITION
(
buffer
->
in_pos
)
->
y_
pos
=
gpi
->
anchor_y
-
entry_y
;
POSITION
(
buffer
->
in_pos
)
->
y_
offset
=
gpi
->
anchor_y
-
entry_y
;
}
end:
...
...
src/hb-shape.c
浏览文件 @
9bef3611
...
...
@@ -38,8 +38,8 @@ is_variation_selector (hb_codepoint_t unicode)
}
static
void
map_glyphs
(
hb_f
ace_t
*
face
,
hb_f
ont_t
*
font
,
map_glyphs
(
hb_f
ont_t
*
font
,
hb_f
ace_t
*
face
,
hb_buffer_t
*
buffer
)
{
unsigned
int
count
;
...
...
@@ -48,19 +48,19 @@ map_glyphs (hb_face_t *face,
for
(
buffer
->
in_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
if
(
HB_UNLIKELY
(
is_variation_selector
(
IN_NEXTGLYPH
())))
{
IN_CURGLYPH
()
=
hb_font_get_glyph
(
f
ace
,
font
,
IN_CURGLYPH
(),
IN_NEXTGLYPH
());
IN_CURGLYPH
()
=
hb_font_get_glyph
(
f
ont
,
face
,
IN_CURGLYPH
(),
IN_NEXTGLYPH
());
buffer
->
in_pos
++
;
}
else
{
IN_CURGLYPH
()
=
hb_font_get_glyph
(
f
ace
,
font
,
IN_CURGLYPH
(),
0
);
IN_CURGLYPH
()
=
hb_font_get_glyph
(
f
ont
,
face
,
IN_CURGLYPH
(),
0
);
}
}
IN_CURGLYPH
()
=
hb_font_get_glyph
(
f
ace
,
font
,
IN_CURGLYPH
(),
0
);
IN_CURGLYPH
()
=
hb_font_get_glyph
(
f
ont
,
face
,
IN_CURGLYPH
(),
0
);
}
void
hb_shape
(
hb_f
ace_t
*
face
,
hb_f
ont_t
*
font
,
hb_shape
(
hb_f
ont_t
*
font
,
hb_f
ace_t
*
face
,
hb_buffer_t
*
buffer
,
hb_feature_t
*
features
,
unsigned
int
num_features
)
...
...
src/hb-shape.h
浏览文件 @
9bef3611
...
...
@@ -41,8 +41,8 @@ typedef struct _hb_feature_t {
}
hb_feature_t
;
void
hb_shape
(
hb_f
ace_t
*
face
,
hb_f
ont_t
*
font
,
hb_shape
(
hb_f
ont_t
*
font
,
hb_f
ace_t
*
face
,
hb_buffer_t
*
buffer
,
hb_feature_t
*
features
,
unsigned
int
num_features
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录