Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
FontMap
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.
Since: 1.10
Synopsis
- newtype FontMap = FontMap (ManagedPtr FontMap)
- class (GObject o, IsDescendantOf FontMap o) => IsFontMap o
- toFontMap :: (MonadIO m, IsFontMap o) => o -> m FontMap
- fontMapGetDefault :: (HasCallStack, MonadIO m) => m FontMap
- fontMapGetFontType :: (HasCallStack, MonadIO m, IsFontMap a) => a -> m FontType
- fontMapGetResolution :: (HasCallStack, MonadIO m, IsFontMap a) => a -> m Double
- fontMapNew :: (HasCallStack, MonadIO m) => m FontMap
- fontMapNewForFontType :: (HasCallStack, MonadIO m) => FontType -> m (Maybe FontMap)
- fontMapSetDefault :: (HasCallStack, MonadIO m, IsFontMap a) => a -> m ()
- fontMapSetResolution :: (HasCallStack, MonadIO m, IsFontMap a) => a -> Double -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq FontMap Source # | |
GObject FontMap Source # | |
Defined in GI.PangoCairo.Interfaces.FontMap | |
ManagedPtrNewtype FontMap Source # | |
Defined in GI.PangoCairo.Interfaces.FontMap toManagedPtr :: FontMap -> ManagedPtr FontMap | |
TypedObject FontMap Source # | |
Defined in GI.PangoCairo.Interfaces.FontMap | |
HasParentTypes FontMap Source # | |
Defined in GI.PangoCairo.Interfaces.FontMap | |
IsGValue (Maybe FontMap) Source # | Convert |
Defined in GI.PangoCairo.Interfaces.FontMap gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe FontMap -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe FontMap) | |
type ParentTypes FontMap Source # | |
Defined in GI.PangoCairo.Interfaces.FontMap |
class (GObject o, IsDescendantOf FontMap o) => IsFontMap o Source #
Instances
(GObject o, IsDescendantOf FontMap o) => IsFontMap o Source # | |
Defined in GI.PangoCairo.Interfaces.FontMap |
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, changed, createContext, forceFloating, freezeNotify, getv, isFloating, listFamilies, loadFont, loadFontset, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getFamily, getFontType, getProperty, getQdata, getResolution, getSerial.
Setters
setData, setDataFull, setDefault, setProperty, setResolution.
getDefault
:: (HasCallStack, MonadIO m) | |
=> m FontMap | Returns: the default PangoCairo fontmap for the current thread. This object is owned by Pango and must not be freed. |
Gets a default FontMap
to use with Cairo.
Note that the type of the returned object will depend
on the particular font backend Cairo was compiled to use;
You generally should only use the FontMap
and
FontMap
interfaces on the returned object.
The default Cairo fontmap can be changed by using
fontMapSetDefault
. This can be used to
change the Cairo font backend that the default fontmap
uses for example.
Note that since Pango 1.32.6, the default fontmap is per-thread. Each thread gets its own default fontmap. In this way, PangoCairo can be used safely from multiple threads.
Since: 1.10
getFontType
:: (HasCallStack, MonadIO m, IsFontMap a) | |
=> a |
|
-> m FontType | Returns: the |
Gets the type of Cairo font backend that fontmap
uses.
Since: 1.18
getResolution
:: (HasCallStack, MonadIO m, IsFontMap a) | |
=> a |
|
-> m Double | Returns: the resolution in "dots per inch" |
Gets the resolution for the fontmap. See fontMapSetResolution
Since: 1.10
new
:: (HasCallStack, MonadIO m) | |
=> m FontMap | Returns: the newly allocated |
Creates a new FontMap
object; a fontmap is used
to cache information about available fonts, and holds
certain global parameters such as the resolution.
In most cases, you can use fontMapGetDefault
instead.
Note that the type of the returned object will depend
on the particular font backend Cairo was compiled to use;
You generally should only use the FontMap
and
FontMap
interfaces on the returned object.
You can override the type of backend returned by using an
environment variable PANGOCAIRO_BACKEND
. Supported types,
based on your build, are fc (fontconfig), win32, and coretext.
If requested type is not available, NULL is returned. Ie.
this is only useful for testing, when at least two backends
are compiled in.
Since: 1.10
newForFontType
fontMapNewForFontType Source #
:: (HasCallStack, MonadIO m) | |
=> FontType |
|
-> m (Maybe FontMap) | Returns: the newly allocated
|
Creates a new FontMap
object of the type suitable
to be used with cairo font backend of type fonttype
.
In most cases one should simply use pangoCairoFontMapNew
(),
or in fact in most of those cases, just use
pangoCairoFontMapGetDefault
().
Since: 1.18
setDefault
:: (HasCallStack, MonadIO m, IsFontMap a) | |
=> a |
|
-> m () |
Sets a default FontMap
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 fontMapNew
.
A value of Nothing
for fontmap
will cause the current default
font map to be released and a new default font
map to be created on demand, using fontMapNew
.
Since: 1.22
setResolution
:: (HasCallStack, MonadIO m, IsFontMap a) | |
=> a |
|
-> Double |
|
-> m () |
Sets the resolution for the fontmap. This is a scale factor between
points specified in a FontDescription
and Cairo units. The
default value is 96, meaning that a 10 point font will be 13
units high. (10 * 96. / 72. = 13.3).
Since: 1.10