Skip to content

class HbLanguage

Data type for languages. Each lanauge object corresponds to a BCP 47 language tag.

Lua wrapper for hb_language_t type.

Reference:


methods


HbLanguage.new


function HbLanguage.new(language_tag) ->  HbLanguage {
    INVALID = HbLanguage,
    new = function,
    __tostring = function,
    __eq = function,
}

@return - a Language object.

😱 Types incomplete or incorrect? 🙏 Please contribute!

Convert a string representing a BCP 47 language tag to the corresponding language object.

Wraps hb_language_from_string.

Reference:

HbLanguage.__tostring


function HbLanguage.__tostring() ->  string

@return - Returns a string representation for the language object.

😱 Types incomplete or incorrect? 🙏 Please contribute!

Enable nice output with tostring(…).

Wraps hb_language_to_string.

Reference:

HbLanguage.__eq


function HbLanguage.__eq(lang: HbLanguage {
    INVALID = HbLanguage,
    new = function,
    __tostring = function,
    __eq = function,
}) ->  boolean

@return - true or false depending on whether the two languages are equal.

😱 Types incomplete or incorrect? 🙏 Please contribute!

Enable equality comparisions with == between two languages.

Reference:

fields


HbLanguage.INVALID


HbLanguage.INVALID : HbLanguage {
    INVALID: HbLanguage,
    new: function,
    __tostring: function,
    __eq: function,
}

Value to represent a nonexistent name ID.

Wraps HB_LANGUAGE_INVALID.

Reference: