Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
7951279b
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7951279b
编写于
11月 03, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implement nil font functions
上级
8fb3d1aa
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
91 addition
and
26 deletion
+91
-26
TODO
TODO
+1
-0
src/hb-font-private.h
src/hb-font-private.h
+4
-4
src/hb-font.cc
src/hb-font.cc
+68
-4
src/hb-font.h
src/hb-font.h
+4
-5
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+4
-3
src/hb-ot-layout-gsub-private.hh
src/hb-ot-layout-gsub-private.hh
+1
-1
src/hb-private.h
src/hb-private.h
+9
-9
未找到文件。
TODO
浏览文件 @
7951279b
- cmap14 support in get_glyph callback
- Use size_t in sanitize?
- Buffer error handling?
- Better define HB_INTERNAL
hb-ot:
- Fix ot query APIs
...
...
src/hb-font-private.h
浏览文件 @
7951279b
...
...
@@ -44,10 +44,10 @@ struct _hb_font_funcs_t {
hb_bool_t
immutable
;
hb_font_get_glyph_func_t
glyph_func
;
hb_font_get_contour_point_func_t
contour_point_func
;
hb_font_get_glyph_metrics_func_t
glyph_metrics_func
;
hb_font_get_kerning_func_t
kerning_func
;
hb_font_get_glyph_func_t
get_glyph
;
hb_font_get_contour_point_func_t
get_contour_point
;
hb_font_get_glyph_metrics_func_t
get_glyph_metrics
;
hb_font_get_kerning_func_t
get_kerning
;
};
HB_INTERNAL
hb_font_funcs_t
...
...
src/hb-font.cc
浏览文件 @
7951279b
...
...
@@ -32,19 +32,43 @@
#include "hb-ot-layout-private.h"
#include <string.h>
/*
* hb_font_funcs_t
*/
static
hb_codepoint_t
hb_font_get_glyph_nil
(
hb_font_t
*
font
,
hb_face_t
*
face
,
const
void
*
user_data
,
hb_codepoint_t
unicode
,
hb_codepoint_t
variant_selector
)
{
return
unicode
;
}
static
hb_bool_t
hb_font_get_contour_point_nil
(
hb_font_t
*
font
,
hb_face_t
*
face
,
const
void
*
user_data
,
unsigned
int
point_index
,
hb_codepoint_t
glyph
,
hb_position_t
*
x
,
hb_position_t
*
y
)
{
return
false
;
}
static
void
hb_font_get_glyph_metrics_nil
(
hb_font_t
*
font
,
hb_face_t
*
face
,
const
void
*
user_data
,
hb_codepoint_t
glyph
,
hb_glyph_metrics_t
*
metrics
)
{
memset
(
metrics
,
0
,
sizeof
(
*
metrics
));
}
static
hb_position_t
hb_font_get_kerning_nil
(
hb_font_t
*
font
,
hb_face_t
*
face
,
const
void
*
user_data
,
hb_codepoint_t
first_glyph
,
hb_codepoint_t
second_glyph
)
{
return
0
;
}
hb_font_funcs_t
_hb_font_funcs_nil
=
{
HB_REFERENCE_COUNT_INVALID
,
/* ref_count */
TRUE
,
/* immutable */
NULL
,
/* glyph_func */
NULL
,
/* contour_point_func */
NULL
,
/* glyph_metrics_func */
NULL
/* kerning_func */
hb_font_get_glyph_nil
,
hb_font_get_contour_point_nil
,
hb_font_get_glyph_metrics_nil
,
hb_font_get_kerning_nil
};
hb_font_funcs_t
*
...
...
@@ -105,6 +129,46 @@ hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs)
}
void
hb_font_funcs_set_glyph_func
(
hb_font_funcs_t
*
ffuncs
,
hb_font_get_glyph_func_t
glyph_func
)
{
if
(
ffuncs
->
immutable
)
return
;
ffuncs
->
get_glyph
=
glyph_func
?
glyph_func
:
hb_font_get_glyph_nil
;
}
void
hb_font_funcs_set_contour_point_func
(
hb_font_funcs_t
*
ffuncs
,
hb_font_get_contour_point_func_t
contour_point_func
)
{
if
(
ffuncs
->
immutable
)
return
;
ffuncs
->
get_contour_point
=
contour_point_func
?
contour_point_func
:
hb_font_get_contour_point_nil
;
}
void
hb_font_funcs_set_glyph_metrics_func
(
hb_font_funcs_t
*
ffuncs
,
hb_font_get_glyph_metrics_func_t
glyph_metrics_func
)
{
if
(
ffuncs
->
immutable
)
return
;
ffuncs
->
get_glyph_metrics
=
glyph_metrics_func
?
glyph_metrics_func
:
hb_font_get_glyph_metrics_nil
;
}
void
hb_font_funcs_set_kerning_func
(
hb_font_funcs_t
*
ffuncs
,
hb_font_get_kerning_func_t
kerning_func
)
{
if
(
ffuncs
->
immutable
)
return
;
ffuncs
->
get_kerning
=
kerning_func
?
kerning_func
:
hb_font_get_kerning_nil
;
}
/*
* hb_face_t
...
...
src/hb-font.h
浏览文件 @
7951279b
...
...
@@ -92,16 +92,15 @@ hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs);
/* funcs */
typedef
struct
_hb_glyph_metrics_t
hb_glyph_metrics_t
;
struct
_hb_glyph_metrics_t
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
;
typedef
hb_codepoint_t
(
*
hb_font_get_glyph_func_t
)
(
hb_font_t
*
font
,
hb_face_t
*
face
,
const
void
*
user_data
,
hb_codepoint_t
unicode
,
hb_codepoint_t
variant_selector
);
...
...
src/hb-ot-layout-gpos-private.hh
浏览文件 @
7951279b
...
...
@@ -176,7 +176,8 @@ struct AnchorFormat2
inline
void
get_anchor
(
hb_ot_layout_context_t
*
context
,
hb_codepoint_t
glyph_id
,
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
/* TODO Contour */
/* TODO Contour
* NOTE only adjust directions with nonzero ppem */
*
x
=
_hb_16dot16_mul_trunc
(
context
->
font
->
x_scale
,
xCoordinate
);
*
y
=
_hb_16dot16_mul_trunc
(
context
->
font
->
y_scale
,
yCoordinate
);
}
...
...
@@ -856,12 +857,12 @@ struct CursivePosFormat1
if
(
buffer
->
direction
==
HB_DIRECTION_RTL
)
{
POSITION
(
buffer
->
in_pos
)
->
x_advance
=
entry_x
-
gpi
->
anchor_x
;
POSITION
(
buffer
->
in_pos
)
->
new_advance
=
TRUE
;
POSITION
(
buffer
->
in_pos
)
->
new_advance
=
true
;
}
else
{
POSITION
(
last_pos
)
->
x_advance
=
gpi
->
anchor_x
-
entry_x
;
POSITION
(
last_pos
)
->
new_advance
=
TRUE
;
POSITION
(
last_pos
)
->
new_advance
=
true
;
}
if
(
lookup_flag
&
LookupFlag
::
RightToLeft
)
...
...
src/hb-ot-layout-gsub-private.hh
浏览文件 @
7951279b
...
...
@@ -372,7 +372,7 @@ struct Ligature
}
if
(
!
(
property
&
HB_OT_LAYOUT_GLYPH_CLASS_MARK
))
is_mark
=
FALSE
;
is_mark
=
false
;
if
(
HB_LIKELY
(
IN_GLYPH
(
j
)
!=
component
[
i
]))
return
false
;
...
...
src/hb-private.h
浏览文件 @
7951279b
...
...
@@ -151,15 +151,15 @@ typedef int hb_mutex_t;
ASSERT_STATIC (sizeof (_type) == (_size) + VAR * sizeof (_var_type1) + VAR * sizeof (_var_type2))
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
#define _HB_BOOLEAN_EXPR(expr)
\
__extension__ ({
\
int _cairo_boolean_var_;
\
if (expr)
\
_cairo_boolean_var_ = 1;
\
else
\
_cairo_boolean_var_ = 0;
\
_cairo_boolean_var_;
\
})
#define _HB_BOOLEAN_EXPR(expr) \
__extension__ ({
\
int _hb_boolean_var_;
\
if (expr)
\
_hb_boolean_var_ = 1;
\
else
\
_hb_boolean_var_ = 0;
\
_hb_boolean_var_;
\
})
#define HB_LIKELY(expr) (__builtin_expect (_HB_BOOLEAN_EXPR(expr), 1))
#define HB_UNLIKELY(expr) (__builtin_expect (_HB_BOOLEAN_EXPR(expr), 0))
#else
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录