提交 5e5eb057 编写于 作者: B Behdad Esfahbod

[HB] Start GPOS!

上级 64e67f75
此差异已折叠。
...@@ -469,7 +469,6 @@ ASSERT_SIZE (LigatureSubst, 2); ...@@ -469,7 +469,6 @@ ASSERT_SIZE (LigatureSubst, 2);
static inline bool substitute_lookup (LOOKUP_ARGS_DEF, unsigned int lookup_index); static inline bool substitute_lookup (LOOKUP_ARGS_DEF, unsigned int lookup_index);
struct ContextSubst : Context { struct ContextSubst : Context {
inline bool substitute (LOOKUP_ARGS_DEF) const { inline bool substitute (LOOKUP_ARGS_DEF) const {
...@@ -478,7 +477,6 @@ struct ContextSubst : Context { ...@@ -478,7 +477,6 @@ struct ContextSubst : Context {
}; };
ASSERT_SIZE (ContextSubst, 2); ASSERT_SIZE (ContextSubst, 2);
struct ChainContextSubst : ChainContext { struct ChainContextSubst : ChainContext {
inline bool substitute (LOOKUP_ARGS_DEF) const { inline bool substitute (LOOKUP_ARGS_DEF) const {
......
...@@ -39,12 +39,25 @@ typedef unsigned int hb_ot_layout_class_t; ...@@ -39,12 +39,25 @@ typedef unsigned int hb_ot_layout_class_t;
struct _hb_ot_layout_t { struct _hb_ot_layout_t {
const struct GDEF *gdef; const struct GDEF *gdef;
const struct GSUB *gsub; const struct GSUB *gsub;
const struct /*XXX*/GSUBGPOS *gpos; const struct GPOS *gpos;
struct { struct {
unsigned char *klasses; unsigned char *klasses;
unsigned int len; unsigned int len;
} new_gdef; } new_gdef;
/* TODO full-matrix transformation? */
struct {
unsigned int x_ppem, y_ppem;
hb_16dot16_t x_scale, y_scale;
hb_bool_t dvi;
hb_bool_t r2l;
unsigned int last; /* the last valid glyph--used with cursive positioning */
hb_position_t anchor_x; /* the coordinates of the anchor point */
hb_position_t anchor_y; /* of the last valid glyph */
} gpos_info;
}; };
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "hb-ot-layout-open-private.h" #include "hb-ot-layout-open-private.h"
#include "hb-ot-layout-gdef-private.h" #include "hb-ot-layout-gdef-private.h"
#include "hb-ot-layout-gsub-private.h" #include "hb-ot-layout-gsub-private.h"
#include "hb-ot-layout-gpos-private.h"
/* XXX */ /* XXX */
#include "harfbuzz-buffer-private.h" #include "harfbuzz-buffer-private.h"
...@@ -49,7 +50,7 @@ hb_ot_layout_create (void) ...@@ -49,7 +50,7 @@ hb_ot_layout_create (void)
layout->gdef = &Null(GDEF); layout->gdef = &Null(GDEF);
layout->gsub = &Null(GSUB); layout->gsub = &Null(GSUB);
layout->gpos = &/*XXX*/Null(GSUBGPOS); layout->gpos = &Null(GPOS);
return layout; return layout;
} }
...@@ -70,7 +71,7 @@ hb_ot_layout_create_for_data (const char *font_data, ...@@ -70,7 +71,7 @@ hb_ot_layout_create_for_data (const char *font_data,
layout->gdef = &GDEF::get_for_data (font.get_table_data (face.get_table_by_tag (GDEF::Tag))); layout->gdef = &GDEF::get_for_data (font.get_table_data (face.get_table_by_tag (GDEF::Tag)));
layout->gsub = &GSUB::get_for_data (font.get_table_data (face.get_table_by_tag (GSUB::Tag))); layout->gsub = &GSUB::get_for_data (font.get_table_data (face.get_table_by_tag (GSUB::Tag)));
layout->gpos = &/*XXX*/GSUBGPOS::get_for_data (font.get_table_data (face.get_table_by_tag (/*XXX*/GSUBGPOS::GPOSTag))); layout->gpos = &GPOS::get_for_data (font.get_table_data (face.get_table_by_tag (GPOS::Tag)));
return layout; return layout;
} }
......
...@@ -124,10 +124,10 @@ hb_ot_layout_table_get_feature_tag (hb_ot_layout_t *layout, ...@@ -124,10 +124,10 @@ hb_ot_layout_table_get_feature_tag (hb_ot_layout_t *layout,
unsigned int feature_index); unsigned int feature_index);
hb_bool_t hb_bool_t
hb_ot_layout_table_find_script (hb_ot_layout_t *layout, hb_ot_layout_table_find_feature (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
hb_tag_t feature_tag, hb_tag_t feature_tag,
unsigned int *feature_index); unsigned int *feature_index);
unsigned int unsigned int
hb_ot_layout_table_get_lookup_count (hb_ot_layout_t *layout, hb_ot_layout_table_get_lookup_count (hb_ot_layout_t *layout,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册