Class FontFace

All Implemented Interfaces:
Proxy
Direct Known Subclasses:
FontFace.FontFace$Impl

@Generated("org.javagi.JavaGI") public abstract class FontFace extends GObject
A PangoFontFace is used to represent a group of fonts with the same family, slant, weight, and width, but varying sizes.
  • Constructor Details

    • FontFace

      public FontFace(MemorySegment address)
      Create a FontFace instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • FontFace

      public FontFace()
      Create a new FontFace.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the FontFace class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected FontFace asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • describe

      public FontDescription describe()

      Returns a font description that matches the face.

      The resulting font description will have the family, style, variant, weight and stretch of the face, but its size field will be unset.

      Returns:
      a newly-created PangoFontDescription structure holding the description of the face. Use FontDescription.free() to free the result.
    • getFaceName

      public String getFaceName()

      Gets a name representing the style of this face.

      Note that a font family may contain multiple faces with the same name (e.g. a variable and a non-variable face for the same style).

      Returns:
      the face name for the face. This string is owned by the face object and must not be modified or freed.
    • getFamily

      public FontFamily getFamily()
      Gets the PangoFontFamily that this FontFace belongs to.
      Returns:
      the PangoFontFamily
      Since:
      1.46
    • isSynthesized

      public boolean isSynthesized()

      Returns whether a PangoFontFace is synthesized.

      This will be the case if the underlying font rendering engine creates this face from another face, by shearing, emboldening, lightening or modifying it in some other way.

      Returns:
      whether this FontFace is synthesized
      Since:
      1.18
    • listSizes

      public void listSizes(@Nullable Out<int[]> sizes)

      List the available sizes for a font.

      This is only applicable to bitmap fonts. For scalable fonts, stores null at the location pointed to by sizes and 0 at the location pointed to by nSizes. The sizes returned are in Pango units and are sorted in ascending order.

      Parameters:
      sizes - location to store a pointer to an array of int. This array should be freed with g_free().
      Since:
      1.4