FontDescription

open class FontDescription : FontDescriptionProtocol

A PangoFontDescription describes a font in an implementation-independent manner.

PangoFontDescription structures are used both to list what fonts are available on the system and also for specifying the characteristics of a font to load.

The FontDescription type acts as an owner of an underlying PangoFontDescription instance. It provides the methods that can operate on this data type through FontDescriptionProtocol conformance. Use FontDescription as a strong reference or owner of a PangoFontDescription instance.

  • ptr
    Untyped pointer to the underlying `PangoFontDescription` instance.
    

    For type-safe access, use the generated, typed pointer font_description_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!
  • Designated initialiser from the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the FontDescription instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafeMutablePointer<PangoFontDescription>)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the FontDescription instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafePointer<PangoFontDescription>)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a non-mutating gpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the FontDescription instance.

    Declaration

    Swift

    @inlinable
    public init!(gpointer op: gpointer?)

    Parameters

    op

    gpointer to the underlying object

  • Optional initialiser from a non-mutating gconstpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the FontDescription instance.

    Declaration

    Swift

    @inlinable
    public init!(gconstpointer op: gconstpointer?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the FontDescription instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafePointer<PangoFontDescription>?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the FontDescription instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafeMutablePointer<PangoFontDescription>?)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from the underlying C data type. PangoFontDescription does not allow reference counting, so despite the name no actual retaining will occur. i.e., ownership is transferred to the FontDescription instance.

    Declaration

    Swift

    @inlinable
    public init(retaining op: UnsafeMutablePointer<PangoFontDescription>)

    Parameters

    op

    pointer to the underlying object

  • Reference intialiser for a related type that implements FontDescriptionProtocol PangoFontDescription does not allow reference counting.

    Declaration

    Swift

    @inlinable
    public init<T>(_ other: T) where T : FontDescriptionProtocol

    Parameters

    other

    an instance of a related type that implements FontDescriptionProtocol

  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to FontDescriptionProtocol.

    Declaration

    Swift

    @inlinable
    public init<T>(cPointer p: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe typed, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to FontDescriptionProtocol.

    Declaration

    Swift

    @inlinable
    public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to FontDescriptionProtocol.

    Declaration

    Swift

    @inlinable
    public init(raw p: UnsafeRawPointer)

    Parameters

    p

    raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to FontDescriptionProtocol.

    Declaration

    Swift

    @inlinable
    public init(retainingRaw raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to FontDescriptionProtocol.

    Declaration

    Swift

    @inlinable
    public required init(raw p: UnsafeMutableRawPointer)

    Parameters

    p

    mutable raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to FontDescriptionProtocol.

    Declaration

    Swift

    @inlinable
    public init(retainingRaw raw: UnsafeMutableRawPointer)

    Parameters

    raw

    mutable raw pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to FontDescriptionProtocol.

    Declaration

    Swift

    @inlinable
    public init(opaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to FontDescriptionProtocol.

    Declaration

    Swift

    @inlinable
    public init(retainingOpaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Creates a new font description structure with all fields unset.

    Declaration

    Swift

    @inlinable
    public init()
  • Creates a new font description from a string representation.

    The string must have the form

    "\[FAMILY-LIST] \[STYLE-OPTIONS] \[SIZE] \[VARIATIONS]",
    

    where FAMILY-LIST is a comma-separated list of families optionally terminated by a comma, STYLE_OPTIONS is a whitespace-separated list of words where each word describes one of style, variant, weight, stretch, or gravity, and SIZE is a decimal number (size in points) or optionally followed by the unit modifier “px” for absolute size. VARIATIONS is a comma-separated list of font variation specifications of the form “`axis`=value” (the = sign is optional).

    The following words are understood as styles: “Normal”, “Roman”, “Oblique”, “Italic”.

    The following words are understood as variants: “Small-Caps”, “All-Small-Caps”, “Petite-Caps”, “All-Petite-Caps”, “Unicase”, “Title-Caps”.

    The following words are understood as weights: “Thin”, “Ultra-Light”, “Extra-Light”, “Light”, “Semi-Light”, “Demi-Light”, “Book”, “Regular”, “Medium”, “Semi-Bold”, “Demi-Bold”, “Bold”, “Ultra-Bold”, “Extra-Bold”, “Heavy”, “Black”, “Ultra-Black”, “Extra-Black”.

    The following words are understood as stretch values: “Ultra-Condensed”, “Extra-Condensed”, “Condensed”, “Semi-Condensed”, “Semi-Expanded”, “Expanded”, “Extra-Expanded”, “Ultra-Expanded”.

    The following words are understood as gravity values: “Not-Rotated”, “South”, “Upside-Down”, “North”, “Rotated-Left”, “East”, “Rotated-Right”, “West”.

    Any one of the options may be absent. If FAMILY-LIST is absent, then the family_name field of the resulting font description will be initialized to nil. If STYLE-OPTIONS is missing, then all style options will be set to the default values. If SIZE is missing, the size in the resulting font description will be set to 0.

    A typical example:

    "Cantarell Italic Light 15 \`wght`=200"
    

    Declaration

    Swift

    @inlinable
    public static func from(string str: UnsafePointer<CChar>!) -> Pango.FontDescription!