Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
266b3441
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
266b3441
编写于
5月 03, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor to keep hb-object-private.h and hb-open-type.h separate
Needed to be able to include <Windows.h> from hb-object-private.h.
上级
d4141a44
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
63 addition
and
44 deletion
+63
-44
src/hb-font.cc
src/hb-font.cc
+5
-14
src/hb-ot-layout-private.hh
src/hb-ot-layout-private.hh
+34
-26
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+24
-4
未找到文件。
src/hb-font.cc
浏览文件 @
266b3441
...
@@ -26,12 +26,12 @@
...
@@ -26,12 +26,12 @@
#include "hb-private.hh"
#include "hb-private.hh"
#include "hb-ot-layout-private.hh"
#include "hb-font-private.hh"
#include "hb-font-private.hh"
#include "hb-blob-private.hh"
#include "hb-blob-private.hh"
#include "hb-open-file-private.hh"
#include "hb-open-file-private.hh"
#include "hb-ot-layout-private.hh"
#include <string.h>
#include <string.h>
HB_BEGIN_DECLS
HB_BEGIN_DECLS
...
@@ -293,9 +293,6 @@ static hb_face_t _hb_face_nil = {
...
@@ -293,9 +293,6 @@ static hb_face_t _hb_face_nil = {
NULL
,
/* user_data */
NULL
,
/* user_data */
NULL
,
/* destroy */
NULL
,
/* destroy */
NULL
,
/* head_blob */
NULL
,
/* head_table */
NULL
/* ot_layout */
NULL
/* ot_layout */
};
};
...
@@ -317,10 +314,7 @@ hb_face_create_for_tables (hb_get_table_func_t get_table,
...
@@ -317,10 +314,7 @@ hb_face_create_for_tables (hb_get_table_func_t get_table,
face
->
user_data
=
user_data
;
face
->
user_data
=
user_data
;
face
->
destroy
=
destroy
;
face
->
destroy
=
destroy
;
face
->
ot_layout
=
_hb_ot_layout_new
(
face
);
face
->
ot_layout
=
_hb_ot_layout_create
(
face
);
face
->
head_blob
=
Sanitizer
<
head
>::
sanitize
(
hb_face_reference_table
(
face
,
HB_OT_TAG_head
));
face
->
head_table
=
Sanitizer
<
head
>::
lock_instance
(
face
->
head_blob
);
return
face
;
return
face
;
}
}
...
@@ -399,10 +393,7 @@ hb_face_destroy (hb_face_t *face)
...
@@ -399,10 +393,7 @@ hb_face_destroy (hb_face_t *face)
{
{
if
(
!
hb_object_destroy
(
face
))
return
;
if
(
!
hb_object_destroy
(
face
))
return
;
_hb_ot_layout_free
(
face
->
ot_layout
);
_hb_ot_layout_destroy
(
face
->
ot_layout
);
hb_blob_unlock
(
face
->
head_blob
);
hb_blob_destroy
(
face
->
head_blob
);
if
(
face
->
destroy
)
if
(
face
->
destroy
)
face
->
destroy
(
face
->
user_data
);
face
->
destroy
(
face
->
user_data
);
...
@@ -446,7 +437,7 @@ hb_face_reference_table (hb_face_t *face,
...
@@ -446,7 +437,7 @@ hb_face_reference_table (hb_face_t *face,
unsigned
int
unsigned
int
hb_face_get_upem
(
hb_face_t
*
face
)
hb_face_get_upem
(
hb_face_t
*
face
)
{
{
return
(
face
->
head_table
?
face
->
head_table
:
&
Null
(
head
))
->
get_upem
(
);
return
_hb_ot_layout_get_upem
(
face
);
}
}
...
...
src/hb-ot-layout-private.hh
浏览文件 @
266b3441
...
@@ -30,7 +30,6 @@
...
@@ -30,7 +30,6 @@
#include "hb-private.hh"
#include "hb-private.hh"
#include "hb-ot-layout.h"
#include "hb-ot-layout.h"
#include "hb-ot-head-private.hh"
#include "hb-font-private.hh"
#include "hb-font-private.hh"
#include "hb-buffer-private.hh"
#include "hb-buffer-private.hh"
...
@@ -38,10 +37,13 @@
...
@@ -38,10 +37,13 @@
HB_BEGIN_DECLS
HB_BEGIN_DECLS
/*
* GDEF
*/
/* buffer var allocations */
/* buffer var allocations */
#define props_cache() var1.u16[1]
/* glyph_props cache */
#define props_cache() var1.u16[1]
/* glyph_props cache */
/* XXX cleanup */
/* XXX cleanup */
typedef
enum
{
typedef
enum
{
HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED
=
0x0001
,
HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED
=
0x0001
,
...
@@ -52,6 +54,31 @@ typedef enum {
...
@@ -52,6 +54,31 @@ typedef enum {
}
hb_ot_layout_glyph_class_t
;
}
hb_ot_layout_glyph_class_t
;
HB_INTERNAL
unsigned
int
_hb_ot_layout_get_glyph_property
(
hb_face_t
*
face
,
hb_glyph_info_t
*
info
);
HB_INTERNAL
hb_bool_t
_hb_ot_layout_check_glyph_property
(
hb_face_t
*
face
,
hb_glyph_info_t
*
ginfo
,
unsigned
int
lookup_props
,
unsigned
int
*
property_out
);
HB_INTERNAL
hb_bool_t
_hb_ot_layout_skip_mark
(
hb_face_t
*
face
,
hb_glyph_info_t
*
ginfo
,
unsigned
int
lookup_props
,
unsigned
int
*
property_out
);
/*
* head
*/
HB_INTERNAL
unsigned
int
_hb_ot_layout_get_upem
(
hb_face_t
*
face
);
/*
/*
* hb_ot_layout_t
* hb_ot_layout_t
*/
*/
...
@@ -61,10 +88,12 @@ struct hb_ot_layout_t
...
@@ -61,10 +88,12 @@ struct hb_ot_layout_t
hb_blob_t
*
gdef_blob
;
hb_blob_t
*
gdef_blob
;
hb_blob_t
*
gsub_blob
;
hb_blob_t
*
gsub_blob
;
hb_blob_t
*
gpos_blob
;
hb_blob_t
*
gpos_blob
;
hb_blob_t
*
head_blob
;
const
struct
GDEF
*
gdef
;
const
struct
GDEF
*
gdef
;
const
struct
GSUB
*
gsub
;
const
struct
GSUB
*
gsub
;
const
struct
GPOS
*
gpos
;
const
struct
GPOS
*
gpos
;
const
struct
head
*
head
;
};
};
struct
hb_ot_layout_context_t
struct
hb_ot_layout_context_t
...
@@ -77,36 +106,15 @@ struct hb_ot_layout_context_t
...
@@ -77,36 +106,15 @@ struct hb_ot_layout_context_t
inline
hb_position_t
scale_y
(
int16_t
v
)
{
return
scale
(
v
,
this
->
font
->
y_scale
);
}
inline
hb_position_t
scale_y
(
int16_t
v
)
{
return
scale
(
v
,
this
->
font
->
y_scale
);
}
private:
private:
inline
hb_position_t
scale
(
int16_t
v
,
int
scale
)
{
return
v
*
(
int64_t
)
scale
/
this
->
face
->
head_table
->
get_upem
(
);
}
inline
hb_position_t
scale
(
int16_t
v
,
int
scale
)
{
return
v
*
(
int64_t
)
scale
/
_hb_ot_layout_get_upem
(
this
->
face
);
}
};
};
HB_INTERNAL
hb_ot_layout_t
*
HB_INTERNAL
hb_ot_layout_t
*
_hb_ot_layout_
new
(
hb_face_t
*
face
);
_hb_ot_layout_
create
(
hb_face_t
*
face
);
HB_INTERNAL
void
HB_INTERNAL
void
_hb_ot_layout_free
(
hb_ot_layout_t
*
layout
);
_hb_ot_layout_destroy
(
hb_ot_layout_t
*
layout
);
/*
* GDEF
*/
HB_INTERNAL
unsigned
int
_hb_ot_layout_get_glyph_property
(
hb_face_t
*
face
,
hb_glyph_info_t
*
info
);
HB_INTERNAL
hb_bool_t
_hb_ot_layout_check_glyph_property
(
hb_face_t
*
face
,
hb_glyph_info_t
*
ginfo
,
unsigned
int
lookup_props
,
unsigned
int
*
property_out
);
HB_INTERNAL
hb_bool_t
_hb_ot_layout_skip_mark
(
hb_face_t
*
face
,
hb_glyph_info_t
*
ginfo
,
unsigned
int
lookup_props
,
unsigned
int
*
property_out
);
HB_END_DECLS
HB_END_DECLS
...
...
src/hb-ot-layout.cc
浏览文件 @
266b3441
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include "hb-ot-layout-gdef-private.hh"
#include "hb-ot-layout-gdef-private.hh"
#include "hb-ot-layout-gsub-private.hh"
#include "hb-ot-layout-gsub-private.hh"
#include "hb-ot-layout-gpos-private.hh"
#include "hb-ot-layout-gpos-private.hh"
#include "hb-ot-head-private.hh"
#include <stdlib.h>
#include <stdlib.h>
...
@@ -42,7 +43,7 @@ HB_BEGIN_DECLS
...
@@ -42,7 +43,7 @@ HB_BEGIN_DECLS
hb_ot_layout_t
*
hb_ot_layout_t
*
_hb_ot_layout_
new
(
hb_face_t
*
face
)
_hb_ot_layout_
create
(
hb_face_t
*
face
)
{
{
/* Remove this object altogether */
/* Remove this object altogether */
hb_ot_layout_t
*
layout
=
(
hb_ot_layout_t
*
)
calloc
(
1
,
sizeof
(
hb_ot_layout_t
));
hb_ot_layout_t
*
layout
=
(
hb_ot_layout_t
*
)
calloc
(
1
,
sizeof
(
hb_ot_layout_t
));
...
@@ -56,19 +57,24 @@ _hb_ot_layout_new (hb_face_t *face)
...
@@ -56,19 +57,24 @@ _hb_ot_layout_new (hb_face_t *face)
layout
->
gpos_blob
=
Sanitizer
<
GPOS
>::
sanitize
(
hb_face_reference_table
(
face
,
HB_OT_TAG_GPOS
));
layout
->
gpos_blob
=
Sanitizer
<
GPOS
>::
sanitize
(
hb_face_reference_table
(
face
,
HB_OT_TAG_GPOS
));
layout
->
gpos
=
Sanitizer
<
GPOS
>::
lock_instance
(
layout
->
gpos_blob
);
layout
->
gpos
=
Sanitizer
<
GPOS
>::
lock_instance
(
layout
->
gpos_blob
);
layout
->
head_blob
=
Sanitizer
<
head
>::
sanitize
(
hb_face_reference_table
(
face
,
HB_OT_TAG_head
));
layout
->
head
=
Sanitizer
<
head
>::
lock_instance
(
layout
->
head_blob
);
return
layout
;
return
layout
;
}
}
void
void
_hb_ot_layout_
free
(
hb_ot_layout_t
*
layout
)
_hb_ot_layout_
destroy
(
hb_ot_layout_t
*
layout
)
{
{
hb_blob_unlock
(
layout
->
gdef_blob
);
hb_blob_unlock
(
layout
->
gdef_blob
);
hb_blob_unlock
(
layout
->
gsub_blob
);
hb_blob_unlock
(
layout
->
gsub_blob
);
hb_blob_unlock
(
layout
->
gpos_blob
);
hb_blob_unlock
(
layout
->
gpos_blob
);
hb_blob_unlock
(
layout
->
head_blob
);
hb_blob_destroy
(
layout
->
gdef_blob
);
hb_blob_destroy
(
layout
->
gdef_blob
);
hb_blob_destroy
(
layout
->
gsub_blob
);
hb_blob_destroy
(
layout
->
gsub_blob
);
hb_blob_destroy
(
layout
->
gpos_blob
);
hb_blob_destroy
(
layout
->
gpos_blob
);
hb_blob_destroy
(
layout
->
head_blob
);
free
(
layout
);
free
(
layout
);
}
}
...
@@ -78,18 +84,21 @@ _get_gdef (hb_face_t *face)
...
@@ -78,18 +84,21 @@ _get_gdef (hb_face_t *face)
{
{
return
likely
(
face
->
ot_layout
&&
face
->
ot_layout
->
gdef
)
?
*
face
->
ot_layout
->
gdef
:
Null
(
GDEF
);
return
likely
(
face
->
ot_layout
&&
face
->
ot_layout
->
gdef
)
?
*
face
->
ot_layout
->
gdef
:
Null
(
GDEF
);
}
}
static
inline
const
GSUB
&
static
inline
const
GSUB
&
_get_gsub
(
hb_face_t
*
face
)
_get_gsub
(
hb_face_t
*
face
)
{
{
return
likely
(
face
->
ot_layout
&&
face
->
ot_layout
->
gsub
)
?
*
face
->
ot_layout
->
gsub
:
Null
(
GSUB
);
return
likely
(
face
->
ot_layout
&&
face
->
ot_layout
->
gsub
)
?
*
face
->
ot_layout
->
gsub
:
Null
(
GSUB
);
}
}
static
inline
const
GPOS
&
static
inline
const
GPOS
&
_get_gpos
(
hb_face_t
*
face
)
_get_gpos
(
hb_face_t
*
face
)
{
{
return
likely
(
face
->
ot_layout
&&
face
->
ot_layout
->
gpos
)
?
*
face
->
ot_layout
->
gpos
:
Null
(
GPOS
);
return
likely
(
face
->
ot_layout
&&
face
->
ot_layout
->
gpos
)
?
*
face
->
ot_layout
->
gpos
:
Null
(
GPOS
);
}
}
static
inline
const
head
&
_get_head
(
hb_face_t
*
face
)
{
return
likely
(
face
->
ot_layout
&&
face
->
ot_layout
->
head
)
?
*
face
->
ot_layout
->
head
:
Null
(
head
);
}
/*
/*
...
@@ -486,4 +495,15 @@ hb_ot_layout_position_finish (hb_buffer_t *buffer)
...
@@ -486,4 +495,15 @@ hb_ot_layout_position_finish (hb_buffer_t *buffer)
}
}
/*
* head
*/
unsigned
int
_hb_ot_layout_get_upem
(
hb_face_t
*
face
)
{
return
_get_head
(
face
).
get_upem
();
}
HB_END_DECLS
HB_END_DECLS
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录