| Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.PangoCairo.Interfaces.FontMap
Contents
Description
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.
- newtype FontMap = FontMap (ManagedPtr FontMap)
- noFontMap :: Maybe FontMap
- class GObject o => IsFontMap o
- toFontMap :: IsFontMap o => o -> IO FontMap
- fontMapGetDefault :: (HasCallStack, MonadIO m) => m FontMap
- data FontMapGetFontTypeMethodInfo
- fontMapGetFontType :: (HasCallStack, MonadIO m, IsFontMap a) => a -> m FontType
- data FontMapGetResolutionMethodInfo
- fontMapGetResolution :: (HasCallStack, MonadIO m, IsFontMap a) => a -> m Double
- fontMapNew :: (HasCallStack, MonadIO m) => m FontMap
- fontMapNewForFontType :: (HasCallStack, MonadIO m) => FontType -> m (Maybe FontMap)
- data FontMapSetDefaultMethodInfo
- fontMapSetDefault :: (HasCallStack, MonadIO m, IsFontMap a) => a -> m ()
- data FontMapSetResolutionMethodInfo
- fontMapSetResolution :: (HasCallStack, MonadIO m, IsFontMap a) => a -> Double -> m ()
Exported types
Constructors
| FontMap (ManagedPtr FontMap) |
Instances
| GObject FontMap Source # | |
| IsObject FontMap Source # | |
| IsFontMap FontMap Source # | |
| IsFontMap FontMap Source # | |
| ((~) * info (ResolveFontMapMethod t FontMap), MethodInfo * info FontMap p) => IsLabel t (FontMap -> p) Source # | |
| ((~) * info (ResolveFontMapMethod t FontMap), MethodInfo * info FontMap p) => IsLabelProxy t (FontMap -> p) Source # | |
| HasAttributeList * FontMap Source # | |
| type AttributeList FontMap Source # | |
| type SignalList FontMap Source # | |
Methods
getDefault
Arguments
| :: (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
data FontMapGetFontTypeMethodInfo Source #
Instances
| ((~) * signature (m FontType), MonadIO m, IsFontMap a) => MethodInfo * FontMapGetFontTypeMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsFontMap a) | |
| => a |
|
| -> m FontType | Returns: the |
Gets the type of Cairo font backend that fontmap uses.
Since: 1.18
getResolution
data FontMapGetResolutionMethodInfo Source #
Instances
| ((~) * signature (m Double), MonadIO m, IsFontMap a) => MethodInfo * FontMapGetResolutionMethodInfo a signature Source # | |
Arguments
| :: (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
Arguments
| :: (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 #
Arguments
| :: (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
data FontMapSetDefaultMethodInfo Source #
Instances
| ((~) * signature (m ()), MonadIO m, IsFontMap a) => MethodInfo * FontMapSetDefaultMethodInfo a signature Source # | |
Arguments
| :: (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 exisiting 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
data FontMapSetResolutionMethodInfo Source #
Instances
| ((~) * signature (Double -> m ()), MonadIO m, IsFontMap a) => MethodInfo * FontMapSetResolutionMethodInfo a signature Source # | |
Arguments
| :: (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