FontMapProtocol
public protocol FontMapProtocol
PangoCairoFontMap
is an interface exported by font maps for
use with Cairo.
The actual type of the font map will depend on the particular font technology Cairo was compiled to use.
The FontMapProtocol
protocol exposes the methods and properties of an underlying PangoCairoFontMap
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see FontMap
.
Alternatively, use FontMapRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
PangoCairoFontMap
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
font_map_ptr
Default implementationTyped pointer to the underlying
PangoCairoFontMap
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
PangoCairoFontMap
instance.Declaration
Swift
var font_map_ptr: UnsafeMutablePointer<PangoCairoFontMap>! { get }
-
Required Initialiser for types conforming to
FontMapProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
createContext()
Extension methodCreate a
PangoContext
for the given fontmap.create_context is deprecated: Use pango_font_map_create_context() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func createContext() -> Pango.ContextRef!
-
getFontType()
Extension methodGets the type of Cairo font backend that
fontmap
uses.Declaration
Swift
@inlinable func getFontType() -> cairo_font_type_t
-
getResolution()
Extension methodGets the resolution for the fontmap.
See [method
PangoCairo.FontMap.set_resolution
].Declaration
Swift
@inlinable func getResolution() -> CDouble
-
setDefault()
Extension methodSets a default
PangoCairoFontMap
to use with Cairo.This can be used to change the Cairo font backend that the default fontmap uses for example. The old default font map is unreffed and the new font map referenced.
Note that since Pango 1.32.6, the default fontmap is per-thread. This function only changes the default fontmap for the current thread. Default fontmaps of existing threads are not changed. Default fontmaps of any new threads will still be created using [func
PangoCairo.FontMap.new
].A value of
nil
forfontmap
will cause the current default font map to be released and a new default font map to be created on demand, using [funcPangoCairo.FontMap.new
].Declaration
Swift
@inlinable func setDefault()
-
setResolution(dpi:
Extension method) Sets the resolution for the fontmap.
This is a scale factor between points specified in a
PangoFontDescription
and Cairo units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3).Declaration
Swift
@inlinable func setResolution(dpi: CDouble)
-
fontType
Extension methodGets the type of Cairo font backend that
fontmap
uses.Declaration
Swift
@inlinable var fontType: cairo_font_type_t { get }
-
resolution
Extension methodGets the resolution for the fontmap.
See [method
PangoCairo.FontMap.set_resolution
].Declaration
Swift
@inlinable var resolution: CDouble { get nonmutating set }