[hb-ot-layout] Add proper namespace to accessors

This commit is contained in:
Behdad Esfahbod 2008-02-18 21:14:23 -05:00
parent 5722567209
commit c44733596c
2 changed files with 198 additions and 82 deletions

View File

@ -278,7 +278,7 @@ get_gsubgpos_table (hb_ot_layout_t *layout,
unsigned int unsigned int
hb_ot_layout_get_script_count (hb_ot_layout_t *layout, hb_ot_layout_table_get_script_count (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type) hb_ot_layout_table_type_t table_type)
{ {
const GSUBGPOS &g = get_gsubgpos_table (layout, table_type); const GSUBGPOS &g = get_gsubgpos_table (layout, table_type);
@ -287,7 +287,7 @@ hb_ot_layout_get_script_count (hb_ot_layout_t *layout,
} }
hb_tag_t hb_tag_t
hb_ot_layout_get_script_tag (hb_ot_layout_t *layout, hb_ot_layout_table_get_script_tag (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index) unsigned int script_index)
{ {
@ -297,7 +297,7 @@ hb_ot_layout_get_script_tag (hb_ot_layout_t *layout,
} }
hb_bool_t hb_bool_t
hb_ot_layout_find_script (hb_ot_layout_t *layout, hb_ot_layout_table_find_script (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
hb_tag_t script_tag, hb_tag_t script_tag,
unsigned int *script_index) unsigned int *script_index)
@ -320,9 +320,53 @@ hb_ot_layout_find_script (hb_ot_layout_t *layout,
return FALSE; return FALSE;
} }
unsigned int
hb_ot_layout_table_get_feature_count (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type)
{
const GSUBGPOS &g = get_gsubgpos_table (layout, table_type);
return g.get_feature_count ();
}
hb_tag_t
hb_ot_layout_table_get_feature_tag (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type,
unsigned int feature_index)
{
const GSUBGPOS &g = get_gsubgpos_table (layout, table_type);
return g.get_feature_tag (feature_index);
}
hb_bool_t
hb_ot_layout_table_find_feature (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type,
hb_tag_t feature_tag,
unsigned int *feature_index)
{
ASSERT_STATIC (NO_INDEX == HB_OT_LAYOUT_NO_FEATURE_INDEX);
const GSUBGPOS &g = get_gsubgpos_table (layout, table_type);
if (g.find_feature_index (feature_tag, feature_index))
return TRUE;
if (feature_index) *feature_index = HB_OT_LAYOUT_NO_FEATURE_INDEX;
return FALSE;
}
unsigned int unsigned int
hb_ot_layout_get_language_count (hb_ot_layout_t *layout, hb_ot_layout_table_get_lookup_count (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type)
{
const GSUBGPOS &g = get_gsubgpos_table (layout, table_type);
return g.get_lookup_count ();
}
unsigned int
hb_ot_layout_script_get_language_count (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index) unsigned int script_index)
{ {
@ -332,7 +376,7 @@ hb_ot_layout_get_language_count (hb_ot_layout_t *layout,
} }
hb_tag_t hb_tag_t
hb_ot_layout_get_language_tag (hb_ot_layout_t *layout, hb_ot_layout_script_get_language_tag (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index, unsigned int script_index,
unsigned int language_index) unsigned int language_index)
@ -343,7 +387,7 @@ hb_ot_layout_get_language_tag (hb_ot_layout_t *layout,
} }
hb_bool_t hb_bool_t
hb_ot_layout_find_language (hb_ot_layout_t *layout, hb_ot_layout_script_find_language (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index, unsigned int script_index,
hb_tag_t language_tag, hb_tag_t language_tag,
@ -364,7 +408,7 @@ hb_ot_layout_find_language (hb_ot_layout_t *layout,
} }
hb_bool_t hb_bool_t
hb_ot_layout_get_required_feature_index (hb_ot_layout_t *layout, hb_ot_layout_language_get_required_feature_index (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index, unsigned int script_index,
unsigned int language_index, unsigned int language_index,
@ -378,7 +422,7 @@ hb_ot_layout_get_required_feature_index (hb_ot_layout_t *layout,
} }
unsigned int unsigned int
hb_ot_layout_get_feature_count (hb_ot_layout_t *layout, hb_ot_layout_language_get_feature_count (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index, unsigned int script_index,
unsigned int language_index) unsigned int language_index)
@ -388,24 +432,36 @@ hb_ot_layout_get_feature_count (hb_ot_layout_t *layout,
return l.get_feature_count (); return l.get_feature_count ();
} }
hb_tag_t unsigned int
hb_ot_layout_get_feature_tag (hb_ot_layout_t *layout, hb_ot_layout_language_get_feature_index (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index, unsigned int script_index,
unsigned int language_index, unsigned int language_index,
unsigned int feature_index) unsigned int num_feature)
{ {
const GSUBGPOS &g = get_gsubgpos_table (layout, table_type); const GSUBGPOS &g = get_gsubgpos_table (layout, table_type);
const LangSys &l = g.get_script (script_index).get_lang_sys (language_index); const LangSys &l = g.get_script (script_index).get_lang_sys (language_index);
feature_index = l.get_feature_index (feature_index); return l.get_feature_index (num_feature);
}
hb_tag_t
hb_ot_layout_language_get_feature_tag (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type,
unsigned int script_index,
unsigned int language_index,
unsigned int num_feature)
{
const GSUBGPOS &g = get_gsubgpos_table (layout, table_type);
const LangSys &l = g.get_script (script_index).get_lang_sys (language_index);
unsigned int feature_index = l.get_feature_index (num_feature);
return g.get_feature_tag (feature_index); return g.get_feature_tag (feature_index);
} }
hb_bool_t hb_bool_t
hb_ot_layout_find_feature (hb_ot_layout_t *layout, hb_ot_layout_language_find_feature (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index, unsigned int script_index,
unsigned int language_index, unsigned int language_index,
@ -429,3 +485,26 @@ hb_ot_layout_find_feature (hb_ot_layout_t *layout,
if (feature_index) *feature_index = HB_OT_LAYOUT_NO_FEATURE_INDEX; if (feature_index) *feature_index = HB_OT_LAYOUT_NO_FEATURE_INDEX;
return FALSE; return FALSE;
} }
unsigned int
hb_ot_layout_feature_get_lookup_count (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type,
unsigned int feature_index)
{
const GSUBGPOS &g = get_gsubgpos_table (layout, table_type);
const Feature &f = g.get_feature (feature_index);
return f.get_lookup_count ();
}
unsigned int
hb_ot_layout_feature_get_lookup_index (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type,
unsigned int feature_index,
unsigned int num_lookup)
{
const GSUBGPOS &g = get_gsubgpos_table (layout, table_type);
const Feature &f = g.get_feature (feature_index);
return f.get_lookup_index (num_lookup);
}

View File

@ -98,66 +98,103 @@ typedef enum {
#define HB_OT_LAYOUT_TAG_DEFAULT_LANGUAGE HB_TAG ('d', 'f', 'l', 't') #define HB_OT_LAYOUT_TAG_DEFAULT_LANGUAGE HB_TAG ('d', 'f', 'l', 't')
unsigned int unsigned int
hb_ot_layout_get_script_count (hb_ot_layout_t *layout, hb_ot_layout_table_get_script_count (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type); hb_ot_layout_table_type_t table_type);
hb_tag_t hb_tag_t
hb_ot_layout_get_script_tag (hb_ot_layout_t *layout, hb_ot_layout_table_get_script_tag (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index); unsigned int script_index);
hb_bool_t hb_bool_t
hb_ot_layout_find_script (hb_ot_layout_t *layout, hb_ot_layout_table_find_script (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
hb_tag_t script_tag, hb_tag_t script_tag,
unsigned int *script_index); unsigned int *script_index);
unsigned int unsigned int
hb_ot_layout_get_language_count (hb_ot_layout_t *layout, hb_ot_layout_table_get_feature_count (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type);
hb_tag_t
hb_ot_layout_table_get_feature_tag (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type,
unsigned int feature_index);
hb_bool_t
hb_ot_layout_table_find_script (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type,
hb_tag_t feature_tag,
unsigned int *feature_index);
unsigned int
hb_ot_layout_table_get_lookup_count (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type);
unsigned int
hb_ot_layout_script_get_language_count (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index); unsigned int script_index);
hb_tag_t hb_tag_t
hb_ot_layout_get_language_tag (hb_ot_layout_t *layout, hb_ot_layout_script_get_language_tag (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index, unsigned int script_index,
unsigned int language_index); unsigned int language_index);
hb_bool_t hb_bool_t
hb_ot_layout_find_language (hb_ot_layout_t *layout, hb_ot_layout_script_find_language (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index, unsigned int script_index,
hb_tag_t language_tag, hb_tag_t language_tag,
unsigned int *language_index); unsigned int *language_index);
hb_bool_t hb_bool_t
hb_ot_layout_get_required_feature_index (hb_ot_layout_t *layout, hb_ot_layout_language_get_required_feature_index (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index, unsigned int script_index,
unsigned int language_index, unsigned int language_index,
unsigned int *feature_index); unsigned int *feature_index);
unsigned int unsigned int
hb_ot_layout_get_feature_count (hb_ot_layout_t *layout, hb_ot_layout_language_get_feature_count (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index, unsigned int script_index,
unsigned int language_index); unsigned int language_index);
hb_tag_t unsigned int
hb_ot_layout_get_feature_tag (hb_ot_layout_t *layout, hb_ot_layout_language_get_feature_index (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index, unsigned int script_index,
unsigned int language_index, unsigned int language_index,
unsigned int feature_index); unsigned int num_feature);
hb_tag_t
hb_ot_layout_language_get_feature_tag (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type,
unsigned int script_index,
unsigned int language_index,
unsigned int num_feature);
hb_bool_t hb_bool_t
hb_ot_layout_find_feature (hb_ot_layout_t *layout, hb_ot_layout_language_find_feature (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type, hb_ot_layout_table_type_t table_type,
unsigned int script_index, unsigned int script_index,
unsigned int language_index, unsigned int language_index,
hb_tag_t feature_tag, hb_tag_t feature_tag,
unsigned int *feature_index); unsigned int *feature_index);
unsigned int
hb_ot_layout_feature_get_lookup_count (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type,
unsigned int feature_index);
unsigned int
hb_ot_layout_feature_get_lookup_index (hb_ot_layout_t *layout,
hb_ot_layout_table_type_t table_type,
unsigned int feature_index,
unsigned int num_lookup);
/* /*
#define PANGO_OT_ALL_GLYPHS ((guint) 0xFFFF) #define PANGO_OT_ALL_GLYPHS ((guint) 0xFFFF)