Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
b8a78ce2
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,发现更多精彩内容 >>
未验证
提交
b8a78ce2
编写于
11月 03, 2018
作者:
E
Ebrahim Byagowi
提交者:
GitHub
11月 03, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[BASE] Improvements (#1347)
上级
c560ca92
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
380 addition
and
370 deletion
+380
-370
src/hb-ot-layout-base-table.hh
src/hb-ot-layout-base-table.hh
+260
-350
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+61
-4
src/hb-ot-layout.h
src/hb-ot-layout.h
+0
-16
test/api/Makefile.am
test/api/Makefile.am
+1
-0
test/api/fonts/base.ttf
test/api/fonts/base.ttf
+0
-0
test/api/test-baseline.c
test/api/test-baseline.c
+58
-0
未找到文件。
src/hb-ot-layout-base-table.hh
浏览文件 @
b8a78ce2
此差异已折叠。
点击以展开。
src/hb-ot-layout.cc
浏览文件 @
b8a78ce2
...
...
@@ -37,10 +37,8 @@
#include "hb-ot-layout-gdef-table.hh"
#include "hb-ot-layout-gsub-table.hh"
#include "hb-ot-layout-gpos-table.hh"
#include "hb-ot-layout-base-table.hh" // Just so we compile them; unused otherwise
#include "hb-ot-layout-jstf-table.hh" // Just so we compile them; unused otherwise
#include "hb-ot-layout-base-table.hh" // Just so we compile it; unused otherwise
#include "hb-ot-layout-jstf-table.hh" // Just so we compile it; unused otherwise
#include "hb-ot-kern-table.hh"
#include "hb-ot-name-table.hh"
...
...
@@ -1425,3 +1423,62 @@ hb_ot_layout_substitute_lookup (OT::hb_ot_apply_context_t *c,
{
apply_string
<
GSUBProxy
>
(
c
,
lookup
,
accel
);
}
#if 0
static const OT::BASE& _get_base (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::BASE);
return *hb_ot_face_data (face)->BASE;
}
hb_bool_t
hb_ot_layout_get_baseline (hb_font_t *font,
hb_ot_layout_baseline_t baseline,
hb_direction_t direction,
hb_tag_t script_tag,
hb_tag_t language_tag,
hb_position_t *coord /* OUT. May be NULL. */)
{
const OT::BASE &base = _get_base (font->face);
bool result = base.get_baseline (font, baseline, direction, script_tag,
language_tag, coord);
/* TODO: Simulate https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags#ideographic-em-box */
if (!result && coord) *coord = 0;
if (coord) *coord = font->em_scale_dir (*coord, direction);
return result;
}
/* To be moved to public header */
/*
* BASE
*/
/**
* hb_ot_layout_baseline_t:
*
* https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags
*
* Since: DONTREPLACEME
*/
typedef enum {
HB_OT_LAYOUT_BASELINE_HANG = HB_TAG('h','a','n','g'),
HB_OT_LAYOUT_BASELINE_ICFB = HB_TAG('i','c','f','b'),
HB_OT_LAYOUT_BASELINE_ICFT = HB_TAG('i','c','f','t'),
HB_OT_LAYOUT_BASELINE_IDEO = HB_TAG('i','d','e','o'),
HB_OT_LAYOUT_BASELINE_IDTB = HB_TAG('i','d','t','b'),
HB_OT_LAYOUT_BASELINE_MATH = HB_TAG('m','a','t','h'),
HB_OT_LAYOUT_BASELINE_ROMN = HB_TAG('r','o','m','n')
} hb_ot_layout_baseline_t;
HB_EXTERN hb_bool_t
hb_ot_layout_get_baseline (hb_font_t *font,
hb_ot_layout_baseline_t baseline,
hb_direction_t direction,
hb_tag_t script_tag,
hb_tag_t language_tag,
hb_position_t *coord /* OUT. May be NULL. */);
#endif
src/hb-ot-layout.h
浏览文件 @
b8a78ce2
...
...
@@ -391,22 +391,6 @@ hb_ot_layout_feature_get_characters (hb_face_t *face,
unsigned
int
*
char_count
/* IN/OUT. May be NULL */
,
hb_codepoint_t
*
characters
/* OUT. May be NULL */
);
/*
* BASE
*/
#if 0
#define HB_OT_TAG_BASE_HANG HB_TAG('h','a','n','g')
#define HB_OT_TAG_BASE_ICFB HB_TAG('i','c','f','b')
#define HB_OT_TAG_BASE_ICFT HB_TAG('i','c','f','t')
#define HB_OT_TAG_BASE_IDEO HB_TAG('i','d','e','o')
#define HB_OT_TAG_BASE_IDTB HB_TAG('i','d','t','b')
#define HB_OT_TAG_BASE_MATH HB_TAG('m','a','t','h')
#define HB_OT_TAG_BASE_ROMN HB_TAG('r','o','m','n')
#endif
HB_END_DECLS
#endif
/* HB_OT_LAYOUT_H */
test/api/Makefile.am
浏览文件 @
b8a78ce2
...
...
@@ -28,6 +28,7 @@ check_PROGRAMS = $(TEST_PROGS)
noinst_PROGRAMS
=
$(TEST_PROGS)
TEST_PROGS
=
\
test-baseline
\
test-blob
\
test-buffer
\
test-collect-unicodes
\
...
...
test/api/fonts/base.ttf
0 → 100644
浏览文件 @
b8a78ce2
文件已添加
test/api/test-baseline.c
0 → 100644
浏览文件 @
b8a78ce2
/*
* Copyright © 2018 Ebrahim Byagowi
*
* This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
#include "hb-test.h"
#include <hb-ot.h>
/* Unit tests for hb-ot-layout.h baseline */
static
void
test_ot_layout_base
(
void
)
{
hb_face_t
*
face
=
hb_test_open_font_file
(
"fonts/base.ttf"
);
hb_font_t
*
font
=
hb_font_create
(
face
);
#if 0
hb_position_t position;
g_assert (hb_ot_layout_get_baseline (font, HB_OT_LAYOUT_BASELINE_ICFB, HB_DIRECTION_TTB,
HB_TAG ('h','a','n','i'),
HB_TAG ('E','N','G',' '),
&position));
g_assert_cmpint (46, ==, position);
#endif
hb_font_destroy
(
font
);
hb_face_destroy
(
face
);
}
int
main
(
int
argc
,
char
**
argv
)
{
hb_test_init
(
&
argc
,
&
argv
);
hb_test_add
(
test_ot_layout_base
);
return
hb_test_run
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录