/// /// /// /// /// /// /// /// /** * Type Definitions for Gjs (https://gjs.guide/) * * These type definitions are automatically generated, do not edit them by hand. * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir * * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ... */ declare module 'gi://Pango?version=1.0' { // Module dependencies import type cairo from 'cairo'; import type GObject from 'gi://GObject?version=2.0'; import type GLib from 'gi://GLib?version=2.0'; import type HarfBuzz from 'gi://HarfBuzz?version=0.0'; import type freetype2 from 'gi://freetype2?version=2.0'; import type Gio from 'gi://Gio?version=2.0'; import type GModule from 'gi://GModule?version=2.0'; export namespace Pango { /** * Pango-1.0 */ /** * `PangoAlignment` describes how to align the lines of a `PangoLayout` * within the available space. * * If the `PangoLayout` is set to justify using [method`Pango`.Layout.set_justify], * this only affects partial lines. * * See [method`Pango`.Layout.set_auto_dir] for how text direction affects * the interpretation of `PangoAlignment` values. */ /** * `PangoAlignment` describes how to align the lines of a `PangoLayout` * within the available space. * * If the `PangoLayout` is set to justify using [method`Pango`.Layout.set_justify], * this only affects partial lines. * * See [method`Pango`.Layout.set_auto_dir] for how text direction affects * the interpretation of `PangoAlignment` values. */ export namespace Alignment { export const $gtype: GObject.GType; } enum Alignment { /** * Put all available space on the right */ LEFT, /** * Center the line within the available space */ CENTER, /** * Put all available space on the left */ RIGHT, } /** * The `PangoAttrType` distinguishes between different types of attributes. * * Along with the predefined values, it is possible to allocate additional * values for custom attributes using [func`AttrType`.register]. The predefined * values are given below. The type of structure used to store the attribute is * listed in parentheses after the description. */ /** * The `PangoAttrType` distinguishes between different types of attributes. * * Along with the predefined values, it is possible to allocate additional * values for custom attributes using [func`AttrType`.register]. The predefined * values are given below. The type of structure used to store the attribute is * listed in parentheses after the description. */ export namespace AttrType { export const $gtype: GObject.GType; } enum AttrType { /** * does not happen */ INVALID, /** * language ([struct`Pango`.AttrLanguage]) */ LANGUAGE, /** * font family name list ([struct`Pango`.AttrString]) */ FAMILY, /** * font slant style ([struct`Pango`.AttrInt]) */ STYLE, /** * font weight ([struct`Pango`.AttrInt]) */ WEIGHT, /** * font variant (normal or small caps) ([struct`Pango`.AttrInt]) */ VARIANT, /** * font stretch ([struct`Pango`.AttrInt]) */ STRETCH, /** * font size in points scaled by %PANGO_SCALE ([struct`Pango`.AttrInt]) */ SIZE, /** * font description ([struct`Pango`.AttrFontDesc]) */ FONT_DESC, /** * foreground color ([struct`Pango`.AttrColor]) */ FOREGROUND, /** * background color ([struct`Pango`.AttrColor]) */ BACKGROUND, /** * whether the text has an underline ([struct`Pango`.AttrInt]) */ UNDERLINE, /** * whether the text is struck-through ([struct`Pango`.AttrInt]) */ STRIKETHROUGH, /** * baseline displacement ([struct`Pango`.AttrInt]) */ RISE, /** * shape ([struct`Pango`.AttrShape]) */ SHAPE, /** * font size scale factor ([struct`Pango`.AttrFloat]) */ SCALE, /** * whether fallback is enabled ([struct`Pango`.AttrInt]) */ FALLBACK, /** * letter spacing ([struct`PangoAttrInt]`) */ LETTER_SPACING, /** * underline color ([struct`Pango`.AttrColor]) */ UNDERLINE_COLOR, /** * strikethrough color ([struct`Pango`.AttrColor]) */ STRIKETHROUGH_COLOR, /** * font size in pixels scaled by %PANGO_SCALE ([struct`Pango`.AttrInt]) */ ABSOLUTE_SIZE, /** * base text gravity ([struct`Pango`.AttrInt]) */ GRAVITY, /** * gravity hint ([struct`Pango`.AttrInt]) */ GRAVITY_HINT, /** * OpenType font features ([struct`Pango`.AttrFontFeatures]). Since 1.38 */ FONT_FEATURES, /** * foreground alpha ([struct`Pango`.AttrInt]). Since 1.38 */ FOREGROUND_ALPHA, /** * background alpha ([struct`Pango`.AttrInt]). Since 1.38 */ BACKGROUND_ALPHA, /** * whether breaks are allowed ([struct`Pango`.AttrInt]). Since 1.44 */ ALLOW_BREAKS, /** * how to render invisible characters ([struct`Pango`.AttrInt]). Since 1.44 */ SHOW, /** * whether to insert hyphens at intra-word line breaks ([struct`Pango`.AttrInt]). Since 1.44 */ INSERT_HYPHENS, /** * whether the text has an overline ([struct`Pango`.AttrInt]). Since 1.46 */ OVERLINE, /** * overline color ([struct`Pango`.AttrColor]). Since 1.46 */ OVERLINE_COLOR, /** * line height factor ([struct`Pango`.AttrFloat]). Since: 1.50 */ LINE_HEIGHT, /** * line height ([struct`Pango`.AttrInt]). Since: 1.50 */ ABSOLUTE_LINE_HEIGHT, TEXT_TRANSFORM, /** * override segmentation to classify the range of the attribute as a single word ([struct`Pango`.AttrInt]). Since 1.50 */ WORD, /** * override segmentation to classify the range of the attribute as a single sentence ([struct`Pango`.AttrInt]). Since 1.50 */ SENTENCE, /** * baseline displacement ([struct`Pango`.AttrInt]). Since 1.50 */ BASELINE_SHIFT, /** * font-relative size change ([struct`Pango`.AttrInt]). Since 1.50 */ FONT_SCALE, } /** * An enumeration that affects baseline shifts between runs. */ /** * An enumeration that affects baseline shifts between runs. */ export namespace BaselineShift { export const $gtype: GObject.GType; } enum BaselineShift { /** * Leave the baseline unchanged */ NONE, /** * Shift the baseline to the superscript position, * relative to the previous run */ SUPERSCRIPT, /** * Shift the baseline to the subscript position, * relative to the previous run */ SUBSCRIPT, } /** * `PangoBidiType` represents the bidirectional character * type of a Unicode character. * * The values in this enumeration are specified by the * [Unicode bidirectional algorithm](http://www.unicode.org/reports/tr9/). */ /** * `PangoBidiType` represents the bidirectional character * type of a Unicode character. * * The values in this enumeration are specified by the * [Unicode bidirectional algorithm](http://www.unicode.org/reports/tr9/). */ export namespace BidiType { export const $gtype: GObject.GType; } enum BidiType { /** * Left-to-Right */ L, /** * Left-to-Right Embedding */ LRE, /** * Left-to-Right Override */ LRO, /** * Right-to-Left */ R, /** * Right-to-Left Arabic */ AL, /** * Right-to-Left Embedding */ RLE, /** * Right-to-Left Override */ RLO, /** * Pop Directional Format */ PDF, /** * European Number */ EN, /** * European Number Separator */ ES, /** * European Number Terminator */ ET, /** * Arabic Number */ AN, /** * Common Number Separator */ CS, /** * Nonspacing Mark */ NSM, /** * Boundary Neutral */ BN, /** * Paragraph Separator */ B, /** * Segment Separator */ S, /** * Whitespace */ WS, /** * Other Neutrals */ ON, /** * Left-to-Right isolate. Since 1.48.6 */ LRI, /** * Right-to-Left isolate. Since 1.48.6 */ RLI, /** * First strong isolate. Since 1.48.6 */ FSI, /** * Pop directional isolate. Since 1.48.6 */ PDI, } /** * `PangoCoverageLevel` is used to indicate how well a font can * represent a particular Unicode character for a particular script. * * Since 1.44, only %PANGO_COVERAGE_NONE and %PANGO_COVERAGE_EXACT * will be returned. */ /** * `PangoCoverageLevel` is used to indicate how well a font can * represent a particular Unicode character for a particular script. * * Since 1.44, only %PANGO_COVERAGE_NONE and %PANGO_COVERAGE_EXACT * will be returned. */ export namespace CoverageLevel { export const $gtype: GObject.GType; } enum CoverageLevel { /** * The character is not representable with * the font. */ NONE, /** * The character is represented in a * way that may be comprehensible but is not the correct * graphical form. For instance, a Hangul character represented * as a a sequence of Jamos, or a Latin transliteration of a * Cyrillic word. */ FALLBACK, /** * The character is represented as * basically the correct graphical form, but with a stylistic * variant inappropriate for the current script. */ APPROXIMATE, /** * The character is represented as the * correct graphical form. */ EXACT, } /** * `PangoDirection` represents a direction in the Unicode bidirectional * algorithm. * * Not every value in this enumeration makes sense for every usage of * `PangoDirection`; for example, the return value of [func`unichar_direction]` * and [func`find_base_dir]` cannot be `PANGO_DIRECTION_WEAK_LTR` or * `PANGO_DIRECTION_WEAK_RTL`, since every character is either neutral * or has a strong direction; on the other hand `PANGO_DIRECTION_NEUTRAL` * doesn't make sense to pass to [func`itemize_with_base_dir]`. * * The `PANGO_DIRECTION_TTB_LTR`, `PANGO_DIRECTION_TTB_RTL` values come from * an earlier interpretation of this enumeration as the writing direction * of a block of text and are no longer used. See `PangoGravity` for how * vertical text is handled in Pango. * * If you are interested in text direction, you should really use fribidi * directly. `PangoDirection` is only retained because it is used in some * public apis. */ /** * `PangoDirection` represents a direction in the Unicode bidirectional * algorithm. * * Not every value in this enumeration makes sense for every usage of * `PangoDirection`; for example, the return value of [func`unichar_direction]` * and [func`find_base_dir]` cannot be `PANGO_DIRECTION_WEAK_LTR` or * `PANGO_DIRECTION_WEAK_RTL`, since every character is either neutral * or has a strong direction; on the other hand `PANGO_DIRECTION_NEUTRAL` * doesn't make sense to pass to [func`itemize_with_base_dir]`. * * The `PANGO_DIRECTION_TTB_LTR`, `PANGO_DIRECTION_TTB_RTL` values come from * an earlier interpretation of this enumeration as the writing direction * of a block of text and are no longer used. See `PangoGravity` for how * vertical text is handled in Pango. * * If you are interested in text direction, you should really use fribidi * directly. `PangoDirection` is only retained because it is used in some * public apis. */ export namespace Direction { export const $gtype: GObject.GType; } enum Direction { /** * A strong left-to-right direction */ LTR, /** * A strong right-to-left direction */ RTL, /** * Deprecated value; treated the * same as `PANGO_DIRECTION_RTL`. */ TTB_LTR, /** * Deprecated value; treated the * same as `PANGO_DIRECTION_LTR` */ TTB_RTL, /** * A weak left-to-right direction */ WEAK_LTR, /** * A weak right-to-left direction */ WEAK_RTL, /** * No direction specified */ NEUTRAL, } /** * `PangoEllipsizeMode` describes what sort of ellipsization * should be applied to text. * * In the ellipsization process characters are removed from the * text in order to make it fit to a given width and replaced * with an ellipsis. */ /** * `PangoEllipsizeMode` describes what sort of ellipsization * should be applied to text. * * In the ellipsization process characters are removed from the * text in order to make it fit to a given width and replaced * with an ellipsis. */ export namespace EllipsizeMode { export const $gtype: GObject.GType; } enum EllipsizeMode { /** * No ellipsization */ NONE, /** * Omit characters at the start of the text */ START, /** * Omit characters in the middle of the text */ MIDDLE, /** * Omit characters at the end of the text */ END, } /** * An enumeration that affects font sizes for superscript * and subscript positioning and for (emulated) Small Caps. */ /** * An enumeration that affects font sizes for superscript * and subscript positioning and for (emulated) Small Caps. */ export namespace FontScale { export const $gtype: GObject.GType; } enum FontScale { /** * Leave the font size unchanged */ NONE, /** * Change the font to a size suitable for superscripts */ SUPERSCRIPT, /** * Change the font to a size suitable for subscripts */ SUBSCRIPT, /** * Change the font to a size suitable for Small Caps */ SMALL_CAPS, } /** * `PangoGravity` represents the orientation of glyphs in a segment * of text. * * This is useful when rendering vertical text layouts. In those situations, * the layout is rotated using a non-identity [struct`Pango`.Matrix], and then * glyph orientation is controlled using `PangoGravity`. * * Not every value in this enumeration makes sense for every usage of * `PangoGravity`; for example, %PANGO_GRAVITY_AUTO only can be passed to * [method`Pango`.Context.set_base_gravity] and can only be returned by * [method`Pango`.Context.get_base_gravity]. * * See also: [enum`Pango`.GravityHint] */ /** * `PangoGravity` represents the orientation of glyphs in a segment * of text. * * This is useful when rendering vertical text layouts. In those situations, * the layout is rotated using a non-identity [struct`Pango`.Matrix], and then * glyph orientation is controlled using `PangoGravity`. * * Not every value in this enumeration makes sense for every usage of * `PangoGravity`; for example, %PANGO_GRAVITY_AUTO only can be passed to * [method`Pango`.Context.set_base_gravity] and can only be returned by * [method`Pango`.Context.get_base_gravity]. * * See also: [enum`Pango`.GravityHint] */ export namespace Gravity { export const $gtype: GObject.GType; } enum Gravity { /** * Glyphs stand upright (default) */ SOUTH, /** * Glyphs are rotated 90 degrees counter-clockwise. */ EAST, /** * Glyphs are upside-down. */ NORTH, /** * Glyphs are rotated 90 degrees clockwise. */ WEST, /** * Gravity is resolved from the context matrix */ AUTO, } /** * `PangoGravityHint` defines how horizontal scripts should behave in a * vertical context. * * That is, English excerpts in a vertical paragraph for example. * * See also [enum`Pango`.Gravity] */ /** * `PangoGravityHint` defines how horizontal scripts should behave in a * vertical context. * * That is, English excerpts in a vertical paragraph for example. * * See also [enum`Pango`.Gravity] */ export namespace GravityHint { export const $gtype: GObject.GType; } enum GravityHint { /** * scripts will take their natural gravity based * on the base gravity and the script. This is the default. */ NATURAL, /** * always use the base gravity set, regardless of * the script. */ STRONG, /** * for scripts not in their natural direction (eg. * Latin in East gravity), choose per-script gravity such that every script * respects the line progression. This means, Latin and Arabic will take * opposite gravities and both flow top-to-bottom for example. */ LINE, } /** * Errors that can be returned by [func`Pango`.Layout.deserialize]. */ class LayoutDeserializeError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * Unspecified error */ static INVALID: number; /** * A JSon value could not be * interpreted */ static INVALID_VALUE: number; /** * A required JSon member was * not found */ static MISSING_VALUE: number; // Constructors constructor(options: { message: string; code: number }); _init(...args: any[]): void; // Static methods static quark(): GLib.Quark; } /** * The `PangoOverline` enumeration is used to specify whether text * should be overlined, and if so, the type of line. */ /** * The `PangoOverline` enumeration is used to specify whether text * should be overlined, and if so, the type of line. */ export namespace Overline { export const $gtype: GObject.GType; } enum Overline { /** * no overline should be drawn */ NONE, /** * Draw a single line above the ink * extents of the text being underlined. */ SINGLE, } /** * `PangoRenderPart` defines different items to render for such * purposes as setting colors. */ /** * `PangoRenderPart` defines different items to render for such * purposes as setting colors. */ export namespace RenderPart { export const $gtype: GObject.GType; } enum RenderPart { /** * the text itself */ FOREGROUND, /** * the area behind the text */ BACKGROUND, /** * underlines */ UNDERLINE, /** * strikethrough lines */ STRIKETHROUGH, /** * overlines */ OVERLINE, } /** * The `PangoScript` enumeration identifies different writing * systems. * * The values correspond to the names as defined in the Unicode standard. See * [Unicode Standard Annex 24: Script names](http://www.unicode.org/reports/tr24/) * * Note that this enumeration is deprecated and will not be updated to include values * in newer versions of the Unicode standard. Applications should use the * [enum`GLib`.UnicodeScript] enumeration instead, * whose values are interchangeable with `PangoScript`. */ /** * The `PangoScript` enumeration identifies different writing * systems. * * The values correspond to the names as defined in the Unicode standard. See * [Unicode Standard Annex 24: Script names](http://www.unicode.org/reports/tr24/) * * Note that this enumeration is deprecated and will not be updated to include values * in newer versions of the Unicode standard. Applications should use the * [enum`GLib`.UnicodeScript] enumeration instead, * whose values are interchangeable with `PangoScript`. */ export namespace Script { export const $gtype: GObject.GType