Module: PangoOT

Defined in:
lib/pango/ot-loader.rb,
lib/pango.rb

Overview

Copyright (C) 2021 Ruby-GNOME Project Team

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Defined Under Namespace

Modules: TableType Classes: Info, Loader, 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:

Returns:

  • (PangoOT::Tag)

    PangoOTTag 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 PangoScript 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)

    PangoOTTag corresponding to script or

#tag_to_language(language_tag) ⇒ Pango::Language

Finds a PangoLanguage corresponding to language_tag. PangoLanguage corresponding to the string "xx" if none found.

Parameters:

  • language_tag (PangoOT::Tag)

    A PangoOTTag OpenType language-system tag

Returns:

#tag_to_script(script_tag) ⇒ Pango::Script

Finds the PangoScript corresponding to script_tag.

The 'DFLT' script tag is mapped to %PANGO_SCRIPT_COMMON.

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, %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 PangoOTTag OpenType script tag

Returns: