Gjsify LogoGjsify Logo

A PangoFontMetrics structure holds the overall metric information for a font.

The information in a PangoFontMetrics structure may be restricted to a script. The fields of this structure are private to implementations of a font backend. See the documentation of the corresponding getters for documentation of their meaning.

For an overview of the most important metrics, see:

Font metrics
record

Hierarchy

  • FontMetrics

Index

Constructors

Properties

name: string

Methods

  • get_approximate_char_width(): number
  • Gets the approximate character width for a font metrics structure.

    This is merely a representative value useful, for example, for determining the initial size for a window. Actual characters in text will be wider and narrower than this.

    Returns number

  • get_approximate_digit_width(): number
  • Gets the approximate digit width for a font metrics structure.

    This is merely a representative value useful, for example, for determining the initial size for a window. Actual digits in text can be wider or narrower than this, though this value is generally somewhat more accurate than the result of pango_font_metrics_get_approximate_char_width() for digits.

    Returns number

  • get_ascent(): number
  • Gets the ascent from a font metrics structure.

    The ascent is the distance from the baseline to the logical top of a line of text. (The logical top may be above or below the top of the actual drawn ink. It is necessary to lay out the text to figure where the ink will be.)

    Returns number

  • get_descent(): number
  • Gets the descent from a font metrics structure.

    The descent is the distance from the baseline to the logical bottom of a line of text. (The logical bottom may be above or below the bottom of the actual drawn ink. It is necessary to lay out the text to figure where the ink will be.)

    Returns number

  • get_height(): number
  • Gets the line height from a font metrics structure.

    The line height is the recommended distance between successive baselines in wrapped text using this font.

    If the line height is not available, 0 is returned.

    Returns number

  • get_strikethrough_position(): number
  • Gets the suggested position to draw the strikethrough.

    The value returned is the distance above the baseline of the top of the strikethrough.

    Returns number

  • get_strikethrough_thickness(): number
  • get_underline_position(): number
  • Gets the suggested position to draw the underline.

    The value returned is the distance above the baseline of the top of the underline. Since most fonts have underline positions beneath the baseline, this value is typically negative.

    Returns number

  • get_underline_thickness(): number
  • unref(): void
  • Decrease the reference count of a font metrics structure by one.

    If the result is zero, frees the structure and any associated memory.

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method