Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
6f425b11
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看板
提交
6f425b11
编写于
1月 24, 2008
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[GDEF] Finish internal API
上级
590d55cb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
66 addition
and
60 deletion
+66
-60
src/hb-ot-layout-private.h
src/hb-ot-layout-private.h
+13
-2
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+45
-50
src/hb-ot-layout.h
src/hb-ot-layout.h
+8
-8
未找到文件。
src/hb-ot-layout-private.h
浏览文件 @
6f425b11
...
...
@@ -34,19 +34,30 @@
#include "hb-private.h"
#include "hb-ot-layout.h"
/* XXX */
#include "harfbuzz-buffer.h"
typedef
uint16_t
hb_ot_layout_class_t
;
typedef
uint16_t
hb_ot_layout_glyph_properties_t
;
typedef
uint16_t
hb_ot_layout_lookup_flags_t
;
typedef
int
hb_ot_layout_coverage_t
;
/* -1 is not covered, >= 0 otherwise */
HB_BEGIN_DECLS
();
static
hb_bool_t
_hb_ot_layout_has_new_glyph_classes
(
HB_OT_Layout
*
layout
);
static
hb_ot_layout_glyph_properties_t
_hb_ot_layout_get_glyph_properties
(
HB_OT_Layout
*
layout
,
hb_glyph_t
glyph
);
static
hb_bool_t
_hb_ot_layout_has_new_glyph_classes
(
HB_OT_Layout
*
layout
);
static
bool
_hb_ot_layout_check_glyph_properties
(
HB_OT_Layout
*
layout
,
HB_GlyphItem
gitem
,
hb_ot_layout_lookup_flags_t
lookup_flags
,
hb_ot_layout_glyph_properties_t
*
property
);
HB_END_DECLS
();
...
...
src/hb-ot-layout.cc
浏览文件 @
6f425b11
/*
* Copyright (C) 1998-2004 David Turner and Werner Lemberg
* Copyright (C) 2006 Behdad Esfahbod
* Copyright (C) 2007,2008 Red Hat, Inc.
*
* This is part of HarfBuzz, an OpenType Layout engine library.
...
...
@@ -33,6 +35,7 @@
#include "hb-ot-layout-gdef-private.h"
#include "hb-ot-layout-gsub-private.h"
#include <stdlib.h>
#include <string.h>
...
...
@@ -114,63 +117,55 @@ _hb_ot_layout_get_glyph_properties (HB_OT_Layout *layout,
}
}
#if 0
static
bool
_hb_ot_layout_check_glyph_properties (HB_OT_Layout *layout,
HB_GlyphItem gitem,
HB_UShort
flags,
HB_UShort*
property)
_hb_ot_layout_check_glyph_properties
(
HB_OT_Layout
*
layout
,
HB_GlyphItem
gitem
,
hb_ot_layout_lookup_flags_t
lookup_
flags
,
hb_ot_layout_glyph_properties_t
*
property
)
{
HB_Error error;
/* TODO ugh, clean this mess up */
hb_ot_layout_glyph_class_t
basic_glyph_class
;
hb_ot_layout_glyph_properties_t
desired_attachment_class
;
if
(
gitem
->
gproperties
==
HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED
)
{
gitem
->
gproperties
=
_hb_ot_layout_get_glyph_properties
(
layout
,
gitem
->
gindex
);
if
(
gitem
->
gproperties
==
HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED
)
return
false
;
}
if ( gdef )
*
property
=
gitem
->
gproperties
;
/* If the glyph was found in the MarkAttachmentClass table,
* then that class value is the high byte of the result,
* otherwise the low byte contains the basic type of the glyph
* as defined by the GlyphClassDef table.
*/
if
(
*
property
&
LookupFlag
::
MarkAttachmentType
)
basic_glyph_class
=
HB_OT_LAYOUT_GLYPH_CLASS_MARK
;
else
basic_glyph_class
=
(
hb_ot_layout_glyph_class_t
)
*
property
;
/* Not covered, if, for example, basic_glyph_class
* is HB_GDEF_LIGATURE and lookup_flags includes LookupFlags::IgnoreLigatures
*/
if
(
lookup_flags
&
basic_glyph_class
)
return
false
;
/* The high byte of lookup_flags has the meaning
* "ignore marks of attachment type different than
* the attachment type specified."
*/
desired_attachment_class
=
lookup_flags
&
LookupFlag
::
MarkAttachmentType
;
if
(
desired_attachment_class
)
{
HB_UShort basic_glyph_class;
HB_UShort desired_attachment_class;
if ( gitem->gproperties == HB_GLYPH_PROPERTIES_UNKNOWN )
{
error = HB_GDEF_Get_Glyph_Property( gdef, gitem->gindex, &gitem->gproperties );
if ( error )
return error;
}
*property = gitem->gproperties;
/* If the glyph was found in the MarkAttachmentClass table,
* then that class value is the high byte of the result,
* otherwise the low byte contains the basic type of the glyph
* as defined by the GlyphClassDef table.
*/
if ( *property & HB_LOOKUP_FLAG_IGNORE_SPECIAL_MARKS )
basic_glyph_class = HB_GDEF_MARK;
else
basic_glyph_class = *property;
/* Return Not_Covered, if, for example, basic_glyph_class
* is HB_GDEF_LIGATURE and LookFlags includes HB_LOOKUP_FLAG_IGNORE_LIGATURES
*/
if ( flags & basic_glyph_class )
return HB_Err_Not_Covered;
/* The high byte of LookupFlags has the meaning
* "ignore marks of attachment type different than
* the attachment type specified."
*/
desired_attachment_class = flags & HB_LOOKUP_FLAG_IGNORE_SPECIAL_MARKS;
if ( desired_attachment_class )
{
if ( basic_glyph_class == HB_GDEF_MARK &&
*property != desired_attachment_class )
return HB_Err_Not_Covered;
}
} else {
*property = 0;
if
(
basic_glyph_class
==
HB_OT_LAYOUT_GLYPH_CLASS_MARK
&&
*
property
!=
desired_attachment_class
)
return
false
;
}
return
HB_Err_Ok
;
return
true
;
}
#endif
hb_ot_layout_glyph_class_t
...
...
src/hb-ot-layout.h
浏览文件 @
6f425b11
...
...
@@ -31,14 +31,6 @@
HB_BEGIN_DECLS
();
typedef
enum
{
HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED
=
0x0000
,
HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH
=
0x0002
,
HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE
=
0x0004
,
HB_OT_LAYOUT_GLYPH_CLASS_MARK
=
0x0008
,
HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT
=
0x0010
}
hb_ot_layout_glyph_class_t
;
/*
* HB_OT_Layout
*/
...
...
@@ -62,6 +54,14 @@ hb_ot_layout_create_sanitize (char *data,
* GDEF
*/
typedef
enum
{
HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED
=
0x0000
,
HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH
=
0x0002
,
HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE
=
0x0004
,
HB_OT_LAYOUT_GLYPH_CLASS_MARK
=
0x0008
,
HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT
=
0x0010
}
hb_ot_layout_glyph_class_t
;
hb_bool_t
hb_ot_layout_has_font_glyph_classes
(
HB_OT_Layout
*
layout
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录