Package ch.bailu.gtk.pango
Class Font
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.pango.Font
- All Implemented Interfaces:
PointerInterface
A `PangoFont` is used to represent a font in a
rendering-system-independent manner.
rendering-system-independent manner.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondescribe()
Returns a description of the font, with font size set in points.Returns a description of the font, with absolute font size set
in device units.static Font
deserialize
(Context context, Bytes bytes) Loads data previously created via [method@Pango.Font.serialize].static ClassHandler
getCoverage
(Language language) Computes the coverage map for a given font and language tag.getFace()
Gets the `PangoFontFace` to which @font belongs.Gets the font map for which the font was created.static int
getMetrics
(Language language) Gets overall metric information for a font.static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
boolean
hasChar
(byte wc) Returns whether the font provides a glyph for this character.Serializes the @font in a way that can be uniquely identified.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
Font
-
-
Method Details
-
getClassHandler
-
describe
Returns a description of the font, with font size set in points.
Use [method@Pango.Font.describe_with_absolute_size] if you want
the font size in device units.- Returns:
- a newly-allocated `PangoFontDescription` object.
-
describeWithAbsoluteSize
Returns a description of the font, with absolute font size set
in device units.
Use [method@Pango.Font.describe] if you want the font size in points.- Returns:
- a newly-allocated `PangoFontDescription` object.
-
getCoverage
Computes the coverage map for a given font and language tag.- Parameters:
language
- the language tag- Returns:
- a newly-allocated `PangoCoverage` object.
-
getFace
Gets the `PangoFontFace` to which @font belongs.- Returns:
- the `PangoFontFace`
-
getFontMap
Gets the font map for which the font was created.
Note that the font maintains a *weak* reference to
the font map, so if all references to font map are
dropped, the font map will be finalized even if there
are fonts created with the font map that are still alive.
In that case this function will return %NULL.
It is the responsibility of the user to ensure that the
font map is kept alive. In most uses this is not an issue
as a `PangoContext` holds a reference to the font map.- Returns:
- the `PangoFontMap` for the font
-
getMetrics
Gets overall metric information for a font.
Since the metrics may be substantially different for different scripts,
a language tag can be provided to indicate that the metrics should be
retrieved that correspond to the script(s) used by that language.
If @font is %NULL, this function gracefully sets some sane values in the
output variables and returns.- Parameters:
language
- language tag used to determine which script to get the metrics for, or %NULL to indicate to get the metrics for the entire font.- Returns:
- a `PangoFontMetrics` object. The caller must call [method@Pango.FontMetrics.unref] when finished using the object.
-
hasChar
public boolean hasChar(byte wc) Returns whether the font provides a glyph for this character.- Parameters:
wc
- a Unicode character- Returns:
- `TRUE` if @font can render @wc
-
serialize
Serializes the @font in a way that can be uniquely identified.
There are no guarantees about the format of the output across different
versions of Pango.
The intended use of this function is testing, benchmarking and debugging.
The format is not meant as a permanent storage format.
To recreate a font from its serialized form, use [func@Pango.Font.deserialize].- Returns:
- a `GBytes` containing the serialized form of @font
-
deserialize
public static Font deserialize(@Nonnull Context context, @Nonnull Bytes bytes) throws AllocationError Loads data previously created via [method@Pango.Font.serialize].
For a discussion of the supported format, see that function.
Note: to verify that the returned font is identical to
the one that was serialized, you can compare @bytes to the
result of serializing the font again.- Parameters:
context
- a `PangoContext`bytes
- the bytes containing the data- Returns:
- a new `PangoFont`
- Throws:
AllocationError
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-