Synopsistypedef PangoOTTag; PangoOTInfo; PangoOTBuffer; PangoOTGlyph; PangoOTRuleset; PangoOTRulesetDescription; enum PangoOTTableType; PangoOTFeatureMap; #define PANGO_OT_TAG_MAKE (c1,c2,c3,c4) #define PANGO_OT_TAG_MAKE_FROM_STRING (s) #define PANGO_OT_ALL_GLYPHS #define PANGO_OT_NO_FEATURE #define PANGO_OT_NO_SCRIPT #define PANGO_OT_DEFAULT_LANGUAGE #define PANGO_OT_TAG_DEFAULT_LANGUAGE #define PANGO_OT_TAG_DEFAULT_SCRIPT PangoOTInfo* pango_ot_info_get (FT_Face face); gboolean pango_ot_info_find_script (PangoOTInfo *info, PangoOTTableType table_type, PangoOTTag script_tag, guint *script_index); gboolean pango_ot_info_find_language (PangoOTInfo *info, PangoOTTableType table_type, guint script_index, PangoOTTag language_tag, guint *language_index, guint *required_feature_index); gboolean pango_ot_info_find_feature (PangoOTInfo *info, PangoOTTableType table_type, PangoOTTag feature_tag, guint script_index, guint language_index, guint *feature_index); PangoOTTag* pango_ot_info_list_scripts (PangoOTInfo *info, PangoOTTableType table_type); PangoOTTag* pango_ot_info_list_languages (PangoOTInfo *info, PangoOTTableType table_type, guint script_index, PangoOTTag language_tag); PangoOTTag* pango_ot_info_list_features (PangoOTInfo *info, PangoOTTableType table_type, PangoOTTag tag, guint script_index, guint language_index); PangoOTBuffer* pango_ot_buffer_new (PangoFcFont *font); void pango_ot_buffer_destroy (PangoOTBuffer *buffer); void pango_ot_buffer_clear (PangoOTBuffer *buffer); void pango_ot_buffer_add_glyph (PangoOTBuffer *buffer, guint glyph, guint properties, guint cluster); void pango_ot_buffer_set_rtl (PangoOTBuffer *buffer, gboolean rtl); void pango_ot_buffer_set_zero_width_marks (PangoOTBuffer *buffer, gboolean zero_width_marks); void pango_ot_buffer_get_glyphs (const PangoOTBuffer *buffer, PangoOTGlyph **glyphs, int *n_glyphs); void pango_ot_buffer_output (const PangoOTBuffer *buffer, PangoGlyphString *glyphs); const PangoOTRuleset* pango_ot_ruleset_get_for_description (PangoOTInfo *info, const PangoOTRulesetDescription *desc); PangoOTRuleset* pango_ot_ruleset_new (PangoOTInfo *info); PangoOTRuleset* pango_ot_ruleset_new_for (PangoOTInfo *info, PangoScript script, PangoLanguage *language); PangoOTRuleset* pango_ot_ruleset_new_from_description (PangoOTInfo *info, const PangoOTRulesetDescription *desc); void pango_ot_ruleset_add_feature (PangoOTRuleset *ruleset, PangoOTTableType table_type, guint feature_index, gulong property_bit); gboolean pango_ot_ruleset_maybe_add_feature (PangoOTRuleset *ruleset, PangoOTTableType table_type, PangoOTTag feature_tag, gulong property_bit); guint pango_ot_ruleset_maybe_add_features (PangoOTRuleset *ruleset, PangoOTTableType table_type, const PangoOTFeatureMap *features, guint n_features); guint pango_ot_ruleset_get_feature_count (const PangoOTRuleset *ruleset, guint *n_gsub_features, guint *n_gpos_features); void pango_ot_ruleset_substitute (const PangoOTRuleset *ruleset, PangoOTBuffer *buffer); void pango_ot_ruleset_position (const PangoOTRuleset *ruleset, PangoOTBuffer *buffer); PangoOTRulesetDescription* pango_ot_ruleset_description_copy (const PangoOTRulesetDescription *desc); gboolean pango_ot_ruleset_description_equal (const PangoOTRulesetDescription *desc1, const PangoOTRulesetDescription *desc2); void pango_ot_ruleset_description_free (PangoOTRulesetDescription *desc); guint pango_ot_ruleset_description_hash (const PangoOTRulesetDescription *desc); PangoOTTag pango_ot_tag_from_language (PangoLanguage *language); PangoOTTag pango_ot_tag_from_script (PangoScript script); PangoLanguage* pango_ot_tag_to_language (PangoOTTag language_tag); PangoScript pango_ot_tag_to_script (PangoOTTag script_tag); DescriptionFunctions and macros in this section are used to implement the OpenType Layout features and algorithms. These are mostly useful when writing Fontconfig-based shaping engines DetailsPangoOTTagtypedef guint32 PangoOTTag;
The PangoOTTag typedef is used to represent TrueType and OpenType
four letter tags inside Pango. Use PangoOTInfotypedef struct _PangoOTInfo PangoOTInfo;
The PangoOTInfo struct contains the various
tables associated with an OpenType font. It contains only private fields and
should only be accessed via the PangoOTBuffertypedef struct _PangoOTBuffer PangoOTBuffer;
The PangoOTBuffer structure is used to store strings of glyphs associated
with a PangoFcFont, suitable for OpenType layout processing. It contains
only private fields and should only be accessed via the
PangoOTGlyphtypedef struct { guint glyph; guint properties; guint cluster; gushort component; gushort ligID; gushort property_cache; /* Internal */ } PangoOTGlyph; The PangoOTGlyph structure represents a single glyph together with information used for OpenType layout processing of the glyph. It contains the following fields.
PangoOTRulesettypedef struct _PangoOTRuleset PangoOTRuleset;
The PangoOTRuleset structure holds a
set of features selected from the tables in an OpenType font.
(A feature is an operation such as adjusting glyph positioning
that should be applied to a text feature such as a certain
type of accent.) A PangoOTRuleset
is created with PangoOTRulesetDescriptiontypedef struct { PangoScript script; PangoLanguage *language; const PangoOTFeatureMap *static_gsub_features; guint n_static_gsub_features; const PangoOTFeatureMap *static_gpos_features; guint n_static_gpos_features; const PangoOTFeatureMap *other_features; guint n_other_features; } PangoOTRulesetDescription;
The PangoOTRuleset structure holds all the information needed
to build a complete PangoOTRuleset from an OpenType font.
The main use of this struct is to act as the key for a per-font
hash of rulesets. The user populates a ruleset description and
gets the ruleset using
Since 1.18 enum PangoOTTableTypetypedef enum { PANGO_OT_TABLE_GSUB, PANGO_OT_TABLE_GPOS } PangoOTTableType;
The PangoOTTableType enumeration values are used to
identify the various OpenType tables in the
PangoOTFeatureMaptypedef struct { char feature_name[5]; gulong property_bit; } PangoOTFeatureMap; The PangoOTFeatureMap typedef is used to represent an OpenType feature with the property bit associated with it. The feature tag is represented as a char array instead of a PangoOTTag for convenience.
Since 1.18 PANGO_OT_TAG_MAKE()#define PANGO_OT_TAG_MAKE(c1,c2,c3,c4) ((PangoOTTag) FT_MAKE_TAG (c1, c2, c3, c4))
Creates a PangoOTTag from four characters. This is similar and
compatible with the
PANGO_OT_TAG_MAKE_FROM_STRING()#define PANGO_OT_TAG_MAKE_FROM_STRING(s)
Creates a PangoOTTag from a string. The string should be at least
four characters long (pad with space characters if needed), and need
not be nul-terminated. This is a convenience wrapper around
PANGO_OT_ALL_GLYPHS#define PANGO_OT_ALL_GLYPHS ((guint) 0xFFFF)
This is used as the property bit in Since 1.16 PANGO_OT_NO_FEATURE#define PANGO_OT_NO_FEATURE ((guint) 0xFFFF)
This is used as a feature index that represent no feature, that is, should be
skipped. It may be returned as feature index by Since 1.18 PANGO_OT_NO_SCRIPT#define PANGO_OT_NO_SCRIPT ((guint) 0xFFFF)
This is used as a script index that represent no script, that is, when the
requested script was not found, and a default ('DFLT') script was not found
either. It may be returned as script index by Since 1.18 PANGO_OT_DEFAULT_LANGUAGE#define PANGO_OT_DEFAULT_LANGUAGE ((guint) 0xFFFF)
This is used as the language index in Since 1.16 PANGO_OT_TAG_DEFAULT_LANGUAGE#define PANGO_OT_TAG_DEFAULT_LANGUAGE PANGO_OT_TAG_MAKE ('d', 'f', 'l', 't')
This is a PangoOTTag representing a special language tag 'dflt'. It is
returned as language tag by Since 1.18 PANGO_OT_TAG_DEFAULT_SCRIPT#define PANGO_OT_TAG_DEFAULT_SCRIPT PANGO_OT_TAG_MAKE ('D', 'F', 'L', 'T')
This is a PangoOTTag representing the special script tag 'DFLT'. It is
returned as script tag by Since 1.18 pango_ot_info_get ()PangoOTInfo* pango_ot_info_get (FT_Face face); Returns the PangoOTInfo structure for the given FreeType font face.
Since 1.2 pango_ot_info_find_script ()gboolean pango_ot_info_find_script (PangoOTInfo *info, PangoOTTableType table_type, PangoOTTag script_tag, guint *script_index);
Finds the index of a script. If not found, tries to find the 'DFLT'
and then 'dflt' scripts and return the index of that in
All other functions taking an input script_index parameter know
how to handle
pango_ot_info_find_language ()gboolean pango_ot_info_find_language (PangoOTInfo *info, PangoOTTableType table_type, guint script_index, PangoOTTag language_tag, guint *language_index, guint *required_feature_index);
Finds the index of a language and its required feature index.
If the language is not found, sets
pango_ot_info_find_feature ()gboolean pango_ot_info_find_feature (PangoOTInfo *info, PangoOTTableType table_type, PangoOTTag feature_tag, guint script_index, guint language_index, guint *feature_index);
Finds the index of a feature. If the feature is not found, sets
In the future, this may set
pango_ot_info_list_scripts ()PangoOTTag* pango_ot_info_list_scripts (PangoOTInfo *info, PangoOTTableType table_type); Obtains the list of available scripts.
pango_ot_info_list_languages ()PangoOTTag* pango_ot_info_list_languages (PangoOTInfo *info, PangoOTTableType table_type, guint script_index, PangoOTTag language_tag); Obtains the list of available languages for a given script.
pango_ot_info_list_features ()PangoOTTag* pango_ot_info_list_features (PangoOTInfo *info, PangoOTTableType table_type, PangoOTTag tag, guint script_index, guint language_index); Obtains the list of features for the given language of the given script.
pango_ot_buffer_new ()PangoOTBuffer* pango_ot_buffer_new (PangoFcFont *font); Creates a new PangoOTBuffer for the given OpenType font.
Since 1.4 pango_ot_buffer_destroy ()void pango_ot_buffer_destroy (PangoOTBuffer *buffer); Destroys a PangoOTBuffer and free all associated memory.
Since 1.4 pango_ot_buffer_clear ()void pango_ot_buffer_clear (PangoOTBuffer *buffer); Empties a PangoOTBuffer, make it ready to add glyphs to.
Since 1.4 pango_ot_buffer_add_glyph ()void pango_ot_buffer_add_glyph (PangoOTBuffer *buffer, guint glyph, guint properties, guint cluster);
Appends a glyph to a PangoOTBuffer, with
Since 1.4 pango_ot_buffer_set_rtl ()void pango_ot_buffer_set_rtl (PangoOTBuffer *buffer, gboolean rtl); Sets whether glyphs will be rendered right-to-left. This setting is needed for proper horizontal positioning of right-to-left scripts.
Since 1.4 pango_ot_buffer_set_zero_width_marks ()void pango_ot_buffer_set_zero_width_marks (PangoOTBuffer *buffer, gboolean zero_width_marks); Sets whether characters with a mark class should be forced to zero width. This setting is needed for proper positioning of Arabic accents, but will produce incorrect results with standard OpenType Indic fonts.
Since 1.6 pango_ot_buffer_get_glyphs ()void pango_ot_buffer_get_glyphs (const PangoOTBuffer *buffer, PangoOTGlyph **glyphs, int *n_glyphs); Gets the glyph array contained in a PangoOTBuffer. The glyphs are owned by the buffer and should not be freed, and are only valid as long as buffer is not modified.
Since 1.4 pango_ot_buffer_output ()void pango_ot_buffer_output (const PangoOTBuffer *buffer, PangoGlyphString *glyphs); Exports the glyphs in a PangoOTBuffer into a PangoGlyphString. This is typically used after the OpenType layout processing is over, to convert the resulting glyphs into a generic Pango glyph string.
Since 1.4 pango_ot_ruleset_get_for_description ()const PangoOTRuleset* pango_ot_ruleset_get_for_description (PangoOTInfo *info, const PangoOTRulesetDescription *desc);
Returns a ruleset for the given OpenType info and ruleset
description. Rulesets are created on demand using
The static feature map members of
Since 1.18 pango_ot_ruleset_new ()PangoOTRuleset* pango_ot_ruleset_new (PangoOTInfo *info); Creates a new PangoOTRuleset for the given OpenType info.
pango_ot_ruleset_new_for ()PangoOTRuleset* pango_ot_ruleset_new_for (PangoOTInfo *info, PangoScript script, PangoLanguage *language); Creates a new PangoOTRuleset for the given OpenType info, script, and language. This function is part of a convenience scheme that highly simplifies using a PangoOTRuleset to represent features for a specific pair of script and language. So one can use this function passing in the script and language of interest, and later try to add features to the ruleset by just specifying the feature name or tag, without having to deal with finding script, language, or feature indices manually.
In excess to what
Because of the way return values of
Since 1.18 pango_ot_ruleset_new_from_description ()PangoOTRuleset* pango_ot_ruleset_new_from_description (PangoOTInfo *info, const PangoOTRulesetDescription *desc); Creates a new PangoOTRuleset for the given OpenType infor and matching the given ruleset description.
This is a convenience function that calls
The static feature map members of
Since 1.18 pango_ot_ruleset_add_feature ()void pango_ot_ruleset_add_feature (PangoOTRuleset *ruleset, PangoOTTableType table_type, guint feature_index, gulong property_bit); Adds a feature to the ruleset.
pango_ot_ruleset_maybe_add_feature ()gboolean pango_ot_ruleset_maybe_add_feature (PangoOTRuleset *ruleset, PangoOTTableType table_type, PangoOTTag feature_tag, gulong property_bit);
This is a convenience function that first tries to find the feature
using
If
Since 1.18 pango_ot_ruleset_maybe_add_features ()guint pango_ot_ruleset_maybe_add_features (PangoOTRuleset *ruleset, PangoOTTableType table_type, const PangoOTFeatureMap *features, guint n_features);
This is a convenience function that
for each feature in the feature map array
Since 1.18 pango_ot_ruleset_get_feature_count ()guint pango_ot_ruleset_get_feature_count (const PangoOTRuleset *ruleset, guint *n_gsub_features, guint *n_gpos_features); Gets the number of GSUB and GPOS features in the ruleset.
Since 1.18 pango_ot_ruleset_substitute ()void pango_ot_ruleset_substitute (const PangoOTRuleset *ruleset, PangoOTBuffer *buffer);
Performs the OpenType GSUB substitution on
Since 1.4 pango_ot_ruleset_position ()void pango_ot_ruleset_position (const PangoOTRuleset *ruleset, PangoOTBuffer *buffer);
Performs the OpenType GPOS positioning on
Since 1.4 pango_ot_ruleset_description_copy ()PangoOTRulesetDescription* pango_ot_ruleset_description_copy (const PangoOTRulesetDescription *desc);
Creates a copy of
Since 1.18 pango_ot_ruleset_description_equal ()gboolean pango_ot_ruleset_description_equal (const PangoOTRulesetDescription *desc1, const PangoOTRulesetDescription *desc2);
Compares two ruleset descriptions for equality.
Two ruleset descriptions are considered equal if the rulesets
they describe are provably identical. This means that their
script, language, and all feature sets should be equal. For static feature
sets, the array addresses are compared directly, while for other
features, the list of features is compared one by one.
(Two ruleset descriptions may result in identical rulesets
being created, but still compare
Since 1.18 pango_ot_ruleset_description_free ()void pango_ot_ruleset_description_free (PangoOTRulesetDescription *desc);
Frees a ruleset description allocated by
Since 1.18 pango_ot_ruleset_description_hash ()guint pango_ot_ruleset_description_hash (const PangoOTRulesetDescription *desc);
Computes a hash of a PangoOTRulesetDescription structure suitable
to be used, for example, as an argument to
Since 1.18 pango_ot_tag_from_language ()PangoOTTag pango_ot_tag_from_language (PangoLanguage *language);
Finds the OpenType language-system tag best describing
Since 1.18 pango_ot_tag_from_script ()PangoOTTag pango_ot_tag_from_script (PangoScript script);
Finds the OpenType script tag corresponding to
The
Note that multiple PangoScript values may map to the same
OpenType script tag. In particular,
Since 1.18 pango_ot_tag_to_language ()PangoLanguage* pango_ot_tag_to_language (PangoOTTag language_tag);
Finds a PangoLanguage corresponding to
Since 1.18 pango_ot_tag_to_script ()PangoScript pango_ot_tag_to_script (PangoOTTag script_tag);
Finds the PangoScript corresponding to
The 'DFLT' script tag is mapped to
Note that an OpenType script tag may correspond to multiple
PangoScript values. In such cases, the PangoScript value
with the smallest value is returned.
In particular,
Since 1.18 |