Module: PangoOT

Defined in:
pango/lib/pango.rb

Overview

Version:

  • 1.0

Defined Under Namespace

Modules: TableType Classes: Info, Ruleset

Constant Summary collapse

ALL_GLYPHS =

This is used as the property bit in pango_ot_ruleset_add_feature() when a feature should be applied to all glyphs.

65535
DEFAULT_LANGUAGE =

This is used as the language index in pango_ot_info_find_feature() when the default language system of the script is desired.

It is also returned by pango_ot_info_find_language() if the requested language is not found, or the requested language tag was PANGO_OT_TAG_DEFAULT_LANGUAGE. The end result is that one can always call pango_ot_tag_from_language() followed by pango_ot_info_find_language() and pass the result to pango_ot_info_find_feature() without having to worry about falling back to default language system explicitly.

65535
NO_FEATURE =

This is used as a feature index that represent no feature, that is, should be skipped. It may be returned as feature index by pango_ot_info_find_feature() if the feature is not found, and pango_ot_ruleset_add_feature() function automatically skips this value, so no special handling is required by the user.

65535
NO_SCRIPT =

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 pango_ot_info_find_script() if the script or a default script are not found, all other functions taking a script index essentially return if the input script index is this value, so no special handling is required by the user.

65535

Instance Method Summary collapse

Instance Method Details

#tag_from_language(language) ⇒ PangoOT::Tag

Finds the OpenType language-system tag best describing language. %PANGO_OT_TAG_DEFAULT_LANGUAGE if none found or if language is nil.

Parameters:

  • language (Pango::Language)

    A Pango::Language, or nil

Returns:

  • (PangoOT::Tag)

    Pango::OTTag best matching language or

#tag_from_script(script) ⇒ PangoOT::Tag

Finds the OpenType script tag corresponding to script.

The %PANGO_SCRIPT_COMMON, %PANGO_SCRIPT_INHERITED, and %PANGO_SCRIPT_UNKNOWN scripts are mapped to the OpenType ‘DFLT’ script tag that is also defined as %PANGO_OT_TAG_DEFAULT_SCRIPT.

Note that multiple Pango::Script values may map to the same OpenType script tag. In particular, %PANGO_SCRIPT_HIRAGANA and %PANGO_SCRIPT_KATAKANA both map to the OT tag ‘kana’. %PANGO_OT_TAG_DEFAULT_SCRIPT if none found.

Parameters:

Returns:

  • (PangoOT::Tag)

    Pango::OTTag corresponding to script or

#tag_to_language(language_tag) ⇒ Pango::Language

Finds a Pango::Language corresponding to language_tag. Pango::Language corresponding to the string “xx” if none found.

Parameters:

  • language_tag (PangoOT::Tag)

    A Pango::OTTag OpenType language-system tag

Returns:

  • (Pango::Language)

    Pango::Language best matching language_tag or

#tag_to_script(script_tag) ⇒ Pango::Script

Finds the Pango::Script corresponding to script_tag.

The ‘DFLT’ script tag is mapped to %PANGO_SCRIPT_COMMON.

Note that an OpenType script tag may correspond to multiple Pango::Script values. In such cases, the #PangoScript value with the smallest value is returned. In particular, %PANGO_SCRIPT_HIRAGANA and %PANGO_SCRIPT_KATAKANA both map to the OT tag ‘kana’. This function will return %PANGO_SCRIPT_HIRAGANA for ‘kana’. %PANGO_SCRIPT_UNKNOWN if none found.

Parameters:

  • script_tag (PangoOT::Tag)

    A Pango::OTTag OpenType script tag

Returns:

  • (Pango::Script)

    Pango::Script corresponding to script_tag or