Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
39a97494
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看板
提交
39a97494
编写于
8月 11, 2017
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
New API: hb_buffer_append()
上级
d2052278
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
57 addition
and
1 deletion
+57
-1
src/hb-buffer.cc
src/hb-buffer.cc
+51
-1
src/hb-buffer.h
src/hb-buffer.h
+6
-0
未找到文件。
src/hb-buffer.cc
浏览文件 @
39a97494
...
@@ -1711,6 +1711,55 @@ hb_buffer_add_codepoints (hb_buffer_t *buffer,
...
@@ -1711,6 +1711,55 @@ hb_buffer_add_codepoints (hb_buffer_t *buffer,
}
}
/**
* hb_buffer_append:
* @buffer: an #hb_buffer_t.
* @source: source #hb_buffer_t.
* @start: start index into source buffer to copy. Use 0 to copy from start of buffer.
* @end: end index into source buffer to copy. Use (unsigned int) -1 to copy to end of buffer.
*
* Append (part of) contents of another buffer to this buffer.
*
* Since: 1.5.0
**/
HB_EXTERN
void
hb_buffer_append
(
hb_buffer_t
*
buffer
,
hb_buffer_t
*
source
,
unsigned
int
start
,
unsigned
int
end
)
{
assert
(
!
buffer
->
have_output
&&
!
source
->
have_output
);
assert
(
buffer
->
have_positions
==
source
->
have_positions
);
assert
(
buffer
->
content_type
==
source
->
content_type
||
!
buffer
->
len
||
!
source
->
len
);
if
(
end
>
source
->
len
)
end
=
source
->
len
;
if
(
start
>
end
)
start
=
end
;
if
(
start
==
end
)
return
;
if
(
!
buffer
->
len
)
buffer
->
content_type
=
source
->
content_type
;
if
(
buffer
->
len
+
(
end
-
start
)
>
buffer
->
len
)
/* Overflows. */
{
buffer
->
in_error
=
true
;
return
;
}
unsigned
int
orig_len
=
buffer
->
len
;
hb_buffer_set_length
(
buffer
,
buffer
->
len
+
(
end
-
start
));
if
(
buffer
->
in_error
)
return
;
memcpy
(
buffer
->
info
+
orig_len
,
source
->
info
+
start
,
(
end
-
start
)
*
sizeof
(
buffer
->
info
[
0
]));
if
(
buffer
->
have_positions
)
memcpy
(
buffer
->
pos
+
orig_len
,
source
->
pos
+
start
,
(
end
-
start
)
*
sizeof
(
buffer
->
pos
[
0
]));
}
static
int
static
int
compare_info_codepoint
(
const
hb_glyph_info_t
*
pa
,
compare_info_codepoint
(
const
hb_glyph_info_t
*
pa
,
const
hb_glyph_info_t
*
pb
)
const
hb_glyph_info_t
*
pb
)
...
@@ -1781,7 +1830,8 @@ void
...
@@ -1781,7 +1830,8 @@ void
hb_buffer_normalize_glyphs
(
hb_buffer_t
*
buffer
)
hb_buffer_normalize_glyphs
(
hb_buffer_t
*
buffer
)
{
{
assert
(
buffer
->
have_positions
);
assert
(
buffer
->
have_positions
);
assert
(
buffer
->
content_type
==
HB_BUFFER_CONTENT_TYPE_GLYPHS
);
assert
(
buffer
->
content_type
==
HB_BUFFER_CONTENT_TYPE_GLYPHS
||
(
!
buffer
->
len
&&
buffer
->
content_type
==
HB_BUFFER_CONTENT_TYPE_INVALID
));
bool
backward
=
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
);
bool
backward
=
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
);
...
...
src/hb-buffer.h
浏览文件 @
39a97494
...
@@ -169,6 +169,7 @@ HB_EXTERN void *
...
@@ -169,6 +169,7 @@ HB_EXTERN void *
hb_buffer_get_user_data
(
hb_buffer_t
*
buffer
,
hb_buffer_get_user_data
(
hb_buffer_t
*
buffer
,
hb_user_data_key_t
*
key
);
hb_user_data_key_t
*
key
);
/**
/**
* hb_buffer_content_type_t:
* hb_buffer_content_type_t:
* @HB_BUFFER_CONTENT_TYPE_INVALID: Initial value for new buffer.
* @HB_BUFFER_CONTENT_TYPE_INVALID: Initial value for new buffer.
...
@@ -365,6 +366,11 @@ hb_buffer_add_codepoints (hb_buffer_t *buffer,
...
@@ -365,6 +366,11 @@ hb_buffer_add_codepoints (hb_buffer_t *buffer,
unsigned
int
item_offset
,
unsigned
int
item_offset
,
int
item_length
);
int
item_length
);
HB_EXTERN
void
hb_buffer_append
(
hb_buffer_t
*
buffer
,
hb_buffer_t
*
source
,
unsigned
int
start
,
unsigned
int
end
);
HB_EXTERN
hb_bool_t
HB_EXTERN
hb_bool_t
hb_buffer_set_length
(
hb_buffer_t
*
buffer
,
hb_buffer_set_length
(
hb_buffer_t
*
buffer
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录