Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
f9cd1014
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看板
提交
f9cd1014
编写于
7月 28, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Apply patch from Jonathan Kew
上级
2ebb89d6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
91 addition
and
38 deletion
+91
-38
src/hb-buffer.c
src/hb-buffer.c
+39
-36
src/hb-buffer.h
src/hb-buffer.h
+5
-1
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+31
-0
src/hb-ot-layout.h
src/hb-ot-layout.h
+15
-0
src/hb-private.h
src/hb-private.h
+1
-1
未找到文件。
src/hb-buffer.c
浏览文件 @
f9cd1014
...
@@ -52,41 +52,6 @@
...
@@ -52,41 +52,6 @@
/* Internal API */
/* Internal API */
static
void
hb_buffer_ensure
(
hb_buffer_t
*
buffer
,
unsigned
int
size
)
{
unsigned
int
new_allocated
=
buffer
->
allocated
;
if
(
size
>
new_allocated
)
{
while
(
size
>
new_allocated
)
new_allocated
+=
(
new_allocated
>>
1
)
+
8
;
if
(
buffer
->
positions
)
buffer
->
positions
=
realloc
(
buffer
->
positions
,
new_allocated
*
sizeof
(
buffer
->
positions
[
0
]));
buffer
->
in_string
=
realloc
(
buffer
->
in_string
,
new_allocated
*
sizeof
(
buffer
->
in_string
[
0
]));
if
(
buffer
->
out_string
!=
buffer
->
in_string
)
{
buffer
->
alt_string
=
realloc
(
buffer
->
alt_string
,
new_allocated
*
sizeof
(
buffer
->
alt_string
[
0
]));
buffer
->
out_string
=
buffer
->
alt_string
;
}
else
{
buffer
->
out_string
=
buffer
->
in_string
;
if
(
buffer
->
alt_string
)
{
free
(
buffer
->
alt_string
);
buffer
->
alt_string
=
NULL
;
}
}
buffer
->
allocated
=
new_allocated
;
}
}
static
void
static
void
hb_buffer_ensure_separate
(
hb_buffer_t
*
buffer
,
unsigned
int
size
)
hb_buffer_ensure_separate
(
hb_buffer_t
*
buffer
,
unsigned
int
size
)
{
{
...
@@ -104,7 +69,7 @@ hb_buffer_ensure_separate (hb_buffer_t *buffer, unsigned int size)
...
@@ -104,7 +69,7 @@ hb_buffer_ensure_separate (hb_buffer_t *buffer, unsigned int size)
/* Public API */
/* Public API */
hb_buffer_t
*
hb_buffer_t
*
hb_buffer_new
(
void
)
hb_buffer_new
(
unsigned
int
allocation_size
)
{
{
hb_buffer_t
*
buffer
;
hb_buffer_t
*
buffer
;
...
@@ -119,6 +84,9 @@ hb_buffer_new (void)
...
@@ -119,6 +84,9 @@ hb_buffer_new (void)
hb_buffer_clear
(
buffer
);
hb_buffer_clear
(
buffer
);
if
(
allocation_size
)
hb_buffer_ensure
(
buffer
,
allocation_size
);
return
buffer
;
return
buffer
;
}
}
...
@@ -142,6 +110,41 @@ hb_buffer_clear (hb_buffer_t *buffer)
...
@@ -142,6 +110,41 @@ hb_buffer_clear (hb_buffer_t *buffer)
buffer
->
max_lig_id
=
0
;
buffer
->
max_lig_id
=
0
;
}
}
void
hb_buffer_ensure
(
hb_buffer_t
*
buffer
,
unsigned
int
size
)
{
unsigned
int
new_allocated
=
buffer
->
allocated
;
if
(
size
>
new_allocated
)
{
while
(
size
>
new_allocated
)
new_allocated
+=
(
new_allocated
>>
1
)
+
8
;
if
(
buffer
->
positions
)
buffer
->
positions
=
realloc
(
buffer
->
positions
,
new_allocated
*
sizeof
(
buffer
->
positions
[
0
]));
if
(
buffer
->
out_string
!=
buffer
->
in_string
)
{
buffer
->
in_string
=
realloc
(
buffer
->
in_string
,
new_allocated
*
sizeof
(
buffer
->
in_string
[
0
]));
buffer
->
alt_string
=
realloc
(
buffer
->
alt_string
,
new_allocated
*
sizeof
(
buffer
->
alt_string
[
0
]));
buffer
->
out_string
=
buffer
->
alt_string
;
}
else
{
buffer
->
in_string
=
realloc
(
buffer
->
in_string
,
new_allocated
*
sizeof
(
buffer
->
in_string
[
0
]));
buffer
->
out_string
=
buffer
->
in_string
;
if
(
buffer
->
alt_string
)
{
free
(
buffer
->
alt_string
);
buffer
->
alt_string
=
NULL
;
}
}
buffer
->
allocated
=
new_allocated
;
}
}
void
void
hb_buffer_add_glyph
(
hb_buffer_t
*
buffer
,
hb_buffer_add_glyph
(
hb_buffer_t
*
buffer
,
hb_codepoint_t
glyph_index
,
hb_codepoint_t
glyph_index
,
...
...
src/hb-buffer.h
浏览文件 @
f9cd1014
...
@@ -76,7 +76,7 @@ typedef struct _hb_buffer_t {
...
@@ -76,7 +76,7 @@ typedef struct _hb_buffer_t {
}
hb_buffer_t
;
}
hb_buffer_t
;
hb_buffer_t
*
hb_buffer_t
*
hb_buffer_new
(
void
);
hb_buffer_new
(
unsigned
int
allocation_size
);
void
void
hb_buffer_free
(
hb_buffer_t
*
buffer
);
hb_buffer_free
(
hb_buffer_t
*
buffer
);
...
@@ -84,6 +84,10 @@ hb_buffer_free (hb_buffer_t *buffer);
...
@@ -84,6 +84,10 @@ hb_buffer_free (hb_buffer_t *buffer);
void
void
hb_buffer_clear
(
hb_buffer_t
*
buffer
);
hb_buffer_clear
(
hb_buffer_t
*
buffer
);
void
hb_buffer_ensure
(
hb_buffer_t
*
buffer
,
unsigned
int
size
);
void
void
hb_buffer_add_glyph
(
hb_buffer_t
*
buffer
,
hb_buffer_add_glyph
(
hb_buffer_t
*
buffer
,
hb_codepoint_t
glyph_index
,
hb_codepoint_t
glyph_index
,
...
...
src/hb-ot-layout.cc
浏览文件 @
f9cd1014
...
@@ -56,6 +56,18 @@ hb_ot_layout_create (void)
...
@@ -56,6 +56,18 @@ hb_ot_layout_create (void)
return
layout
;
return
layout
;
}
}
hb_bool_t
hb_ot_layout_has_substitution
(
hb_ot_layout_t
*
layout
)
{
return
layout
->
gsub
!=
&
Null
(
GSUB
);
}
hb_bool_t
hb_ot_layout_has_positioning
(
hb_ot_layout_t
*
layout
)
{
return
layout
->
gpos
!=
&
Null
(
GPOS
);
}
hb_ot_layout_t
*
hb_ot_layout_t
*
hb_ot_layout_create_for_data
(
const
char
*
font_data
,
hb_ot_layout_create_for_data
(
const
char
*
font_data
,
int
face_index
)
int
face_index
)
...
@@ -77,6 +89,25 @@ hb_ot_layout_create_for_data (const char *font_data,
...
@@ -77,6 +89,25 @@ hb_ot_layout_create_for_data (const char *font_data,
return
layout
;
return
layout
;
}
}
hb_ot_layout_t
*
hb_ot_layout_create_for_tables
(
const
char
*
gdef_data
,
const
char
*
gsub_data
,
const
char
*
gpos_data
)
{
hb_ot_layout_t
*
layout
;
if
(
HB_UNLIKELY
(
gdef_data
==
NULL
&&
gsub_data
==
NULL
&&
gpos_data
==
NULL
))
return
hb_ot_layout_create
();
layout
=
(
hb_ot_layout_t
*
)
calloc
(
1
,
sizeof
(
hb_ot_layout_t
));
layout
->
gdef
=
&
GDEF
::
get_for_data
(
gdef_data
);
layout
->
gsub
=
&
GSUB
::
get_for_data
(
gsub_data
);
layout
->
gpos
=
&
GPOS
::
get_for_data
(
gpos_data
);
return
layout
;
}
void
void
hb_ot_layout_destroy
(
hb_ot_layout_t
*
layout
)
hb_ot_layout_destroy
(
hb_ot_layout_t
*
layout
)
{
{
...
...
src/hb-ot-layout.h
浏览文件 @
f9cd1014
...
@@ -45,6 +45,11 @@ hb_ot_layout_t *
...
@@ -45,6 +45,11 @@ hb_ot_layout_t *
hb_ot_layout_create_for_data
(
const
char
*
font_data
,
hb_ot_layout_create_for_data
(
const
char
*
font_data
,
int
face_index
);
int
face_index
);
hb_ot_layout_t
*
hb_ot_layout_create_for_tables
(
const
char
*
gdef_data
,
const
char
*
gsub_data
,
const
char
*
gpos_data
);
void
void
hb_ot_layout_destroy
(
hb_ot_layout_t
*
layout
);
hb_ot_layout_destroy
(
hb_ot_layout_t
*
layout
);
...
@@ -231,12 +236,22 @@ hb_ot_layout_feature_get_lookup_index (hb_ot_layout_t *layout,
...
@@ -231,12 +236,22 @@ hb_ot_layout_feature_get_lookup_index (hb_ot_layout_t *layout,
* GSUB
* GSUB
*/
*/
hb_bool_t
hb_ot_layout_has_substitution
(
hb_ot_layout_t
*
layout
);
hb_bool_t
hb_bool_t
hb_ot_layout_substitute_lookup
(
hb_ot_layout_t
*
layout
,
hb_ot_layout_substitute_lookup
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
,
hb_buffer_t
*
buffer
,
unsigned
int
lookup_index
,
unsigned
int
lookup_index
,
hb_ot_layout_feature_mask_t
mask
);
hb_ot_layout_feature_mask_t
mask
);
/*
* GPOS
*/
hb_bool_t
hb_ot_layout_has_positioning
(
hb_ot_layout_t
*
layout
);
hb_bool_t
hb_bool_t
hb_ot_layout_position_lookup
(
hb_ot_layout_t
*
layout
,
hb_ot_layout_position_lookup
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
,
hb_buffer_t
*
buffer
,
...
...
src/hb-private.h
浏览文件 @
f9cd1014
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#ifndef HB_PRIVATE_H
#ifndef HB_PRIVATE_H
#define HB_PRIVATE_H
#define HB_PRIVATE_H
#include
<hb-common.h>
#include
"hb-common.h"
#include <glib.h>
#include <glib.h>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录