Skip to content

class HbDirection

The direction of a text segment or buffer.

Lua wrapper for hb_direction_t type.

Reference:

😱 Types incomplete or incorrect? 🙏 Please contribute!


methods


HbDirection.new


function HbDirection.new(dir: unknown) ->  HbDirection {
    LTR = integer?,
    RTL = integer?,
    TTB = integer?,
    BTT = integer?,
    new = function,
    __to_string = function,
    __eq = function,
    is_valid = function,
    is_horizontal = function,
    is_vertical = function,
    is_forward = function,
    is_backward = function,
    ...(+0)
}
@param dir - can be one of ltr, rtl, ttb, btt or invalid.

@return - a Direction object.

😱 Types incomplete or incorrect? 🙏 Please contribute!

Wraps hb_direction_from_string.

Reference:

HbDirection.__to_string


function HbDirection.__to_string() ->  string

@return - Returns a string representation for direction.

😱 Types incomplete or incorrect? 🙏 Please contribute!

Enable nice output with tostring(…).

Wraps hb_direction_to_string.

Reference:

HbDirection.__eq


function HbDirection.__eq() ->  boolean

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

😱 Types incomplete or incorrect? 🙏 Please contribute!

Enable equality comparisions with == between two directions.

Reference:

HbDirection.is_valid


function HbDirection.is_valid() ->  boolean

@return - a boolean value

😱 Types incomplete or incorrect? 🙏 Please contribute!

Test whether a text direction is valid.

Wraps HB_DIRECTION_IS_VALID.

Reference:

HbDirection.is_horizontal


function HbDirection.is_horizontal() ->  boolean

@return - a boolean value

😱 Types incomplete or incorrect? 🙏 Please contribute!

Test whether a text direction is horizontal.

Requires that the direction be valid. Wraps HB_DIRECTION_IS_HORIZONTAL.

Reference:

HbDirection.is_vertical


function HbDirection.is_vertical() ->  boolean

@return - a boolean value

😱 Types incomplete or incorrect? 🙏 Please contribute!

Test whether a text direction is vertical.

Requires that the direction be valid. Wraps HB_DIRECTION_IS_VERTICAL.

Reference:

HbDirection.is_forward


function HbDirection.is_forward() ->  boolean

@return - a boolean value

😱 Types incomplete or incorrect? 🙏 Please contribute!

Test whether a text direction moves forward (from left to right, or from top to bottom).

Requires that the direction be valid. Wraps HB_DIRECTION_IS_FORWARD.

Reference:

HbDirection.is_backward


function HbDirection.is_backward() ->  boolean

@return - a boolean value

😱 Types incomplete or incorrect? 🙏 Please contribute!

Test whether a text direction moves backward (from right to left, or from bottom to top).

Requires that the direction be valid. Wraps HB_DIRECTION_IS_BACKWARD.

Reference:

fields


HbDirection.LTR


HbDirection.LTR : integer?

Wraps HB_DIRECTION_LTR.

Predefined directions that correspond to their original definitions in Harfbuzz.

Reference:

HbDirection.RTL


HbDirection.RTL : integer?

Wraps HB_DIRECTION_RTL.

Predefined directions that correspond to their original definitions in Harfbuzz.

Reference:

HbDirection.TTB


HbDirection.TTB : integer?

Wraps HB_DIRECTION_TTB.

Predefined directions that correspond to their original definitions in Harfbuzz.

Reference:

HbDirection.BTT


HbDirection.BTT : integer?

Wraps HB_DIRECTION_LTR.

Predefined directions that correspond to their original definitions in Harfbuzz.

Reference: