Class: PangoOT::Info

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.get(face) ⇒ PangoOT::Info

Returns the PangoOTInfo structure for the given FreeType font face.

Parameters:

  • face (freetype2::Face)

    a FT_Face

Returns:

  • (PangoOT::Info)

    the PangoOTInfo for face.
    This object will have the same lifetime as face.

Instance Method Details

#find_feature(table_type, feature_tag, script_index, language_index, feature_index) ⇒ Boolean

Finds the index of a feature.

If the feature is not found, sets feature_index to PANGO_OT_NO_FEATURE,
which is safe to pass to [methodPangoOT.Ruleset.add_feature] and similar
functions.

In the future, this may set feature_index to an special value that if
used in [methodPangoOT.Ruleset.add_feature] will ask Pango to synthesize
the requested feature based on Unicode properties and data. However, this
function will still return false in those cases. So, users may want to
ignore the return value of this function in certain cases.

Parameters:

  • table_type (PangoOT::TableType)

    the table type to obtain information about

  • feature_tag (PangoOT::Tag)

    the tag of the feature to find

  • script_index (Integer)

    the index of the script

  • language_index (Integer)

    the index of the language whose features are searched,
    or %PANGO_OT_DEFAULT_LANGUAGE to use the default language of the script

  • feature_index (Integer)

    location to store the index of
    the feature

Returns:

  • (Boolean)

    true if the feature was found

#find_language(table_type, script_index, language_tag, language_index, required_feature_index) ⇒ Boolean

Finds the index of a language and its required feature index.

If the language is not found, sets language_index to %PANGO_OT_DEFAULT_LANGUAGE
and the required feature of the default language system is returned in
required_feature_index. For best compatibility with some fonts, also
searches the language system tag 'dflt' before falling back to the default
language system, but that is transparent to the user. The user can simply
ignore the return value of this function to automatically fall back to the
default language system.

Parameters:

  • table_type (PangoOT::TableType)

    the table type to obtain information about

  • script_index (Integer)

    the index of the script whose languages are searched

  • language_tag (PangoOT::Tag)

    the tag of the language to find

  • language_index (Integer)

    location to store the index of the language

  • required_feature_index (Integer)

    location to store the
    required feature index of the language

Returns:

  • (Boolean)

    true if the language was found

#find_script(table_type, script_tag, script_index) ⇒ Boolean

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 script_index. If none of those is found
either, %PANGO_OT_NO_SCRIPT is placed in script_index.

All other functions taking an input script_index parameter know
how to handle %PANGO_OT_NO_SCRIPT, so one can ignore the return
value of this function completely and proceed, to enjoy the automatic
fallback to the 'DFLT'/'dflt' script.

Parameters:

  • table_type (PangoOT::TableType)

    the table type to obtain information about

  • script_tag (PangoOT::Tag)

    the tag of the script to find

  • script_index (Integer)

    location to store the index of the script

Returns:

  • (Boolean)

    true if the script was found

#list_features(table_type, tag, script_index, language_index) ⇒ PangoOT::Tag

Obtains the list of features for the given language of the given script.

Parameters:

  • table_type (PangoOT::TableType)

    the table type to obtain information about

  • tag (PangoOT::Tag)

    unused parameter

  • script_index (Integer)

    the index of the script to obtain information about

  • language_index (Integer)

    the index of the language to list features for, or
    %PANGO_OT_DEFAULT_LANGUAGE, to list features for the default
    language of the script

Returns:

  • (PangoOT::Tag)

    a newly-allocated zero-terminated
    array containing the tags of the available features

#list_languages(table_type, script_index, language_tag) ⇒ PangoOT::Tag

Obtains the list of available languages for a given script.

Parameters:

  • table_type (PangoOT::TableType)

    the table type to obtain information about

  • script_index (Integer)

    the index of the script to list languages for

  • language_tag (PangoOT::Tag)

    unused parameter

Returns:

  • (PangoOT::Tag)

    a newly-allocated zero-terminated
    array containing the tags of the available languages

#list_scripts(table_type) ⇒ PangoOT::Tag

Obtains the list of available scripts.

Parameters:

Returns:

  • (PangoOT::Tag)

    a newly-allocated zero-terminated
    array containing the tags of the available scripts