FontDescriptionRef
public struct FontDescriptionRef : 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 FontDescriptionRef
type acts as a lightweight Swift reference to an underlying PangoFontDescription
instance.
It exposes methods that can operate on this data type through FontDescriptionProtocol
conformance.
Use FontDescriptionRef
only as an unowned
reference to an existing PangoFontDescription
instance.
-
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 typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<PangoFontDescription>)
-
Designated initialiser from a constant pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<PangoFontDescription>)
-
Conditional initialiser from an optional pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<PangoFontDescription>?)
-
Conditional initialiser from an optional, non-mutable pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<PangoFontDescription>?)
-
Conditional initialiser from an optional
gpointer
Declaration
Swift
@inlinable init!(gpointer g: gpointer?)
-
Conditional initialiser from an optional, non-mutable
gconstpointer
Declaration
Swift
@inlinable init!(gconstpointer g: gconstpointer?)
-
Reference intialiser for a related type that implements
FontDescriptionProtocol
Declaration
Swift
@inlinable init<T>(_ other: T) where T : FontDescriptionProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
FontDescriptionProtocol
.Declaration
Swift
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>)
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
FontDescriptionProtocol
.Declaration
Swift
@inlinable init<T>(constPointer: UnsafePointer<T>)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
FontDescriptionProtocol
.Declaration
Swift
@inlinable init(mutating 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 init(raw: UnsafeMutableRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
FontDescriptionProtocol
.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer)
-
Creates a new font description structure with all fields unset.
Declaration
Swift
@inlinable 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 static func from(string str: UnsafePointer<CChar>!) -> Pango.FontDescriptionRef!