Class FontFamily<T extends GObject>
- All Implemented Interfaces:
Proxy
,ListModelJavaList<T>
,Iterable<T>
,Collection<T>
,List<T>
,SequencedCollection<T>
,ListModel<T>
- Direct Known Subclasses:
FontFamily.FontFamilyImpl
PangoFontFamily
is used to represent a family of related
font faces.
The font faces in a family share a common design, but differ in slant, weight, width or other aspects.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
FontFamily.Builder<B extends FontFamily.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
FontFamily.FontFamilyClass<T extends GObject>
static class
The FontFamilyImpl type represents a native instance of the abstract FontFamily class.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gio.ListModel
ListModel.ItemsChangedCallback, ListModel.ListModelImpl, ListModel.ListModelInterface
-
Constructor Summary
ConstructorDescriptionFontFamily
(MemorySegment address) Create a FontFamily proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected FontFamily
asParent()
Returns this instance as if it were its parent type.static FontFamily.Builder
<? extends FontFamily.Builder> builder()
AFontFamily.Builder
object constructs aFontFamily
with the specified properties.Gets thePangoFontFace
of this FontFamily with the given name.static MemoryLayout
The memory layout of the native struct.getName()
Gets the name of the family.static Type
getType()
Get the GType of the FontFamily classboolean
A monospace font is a font designed for text display where the the characters form a regular grid.boolean
A variable font is a font which has axes that can be modified to produce different faces.void
Lists the different font faces that make up this FontFamily.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
Methods inherited from interface org.gnome.gio.ListModel
emitItemsChanged, getItem, getItemType, getNItems, itemsChanged, onItemsChanged
Methods inherited from interface io.github.jwharm.javagi.gio.ListModelJavaList
add, add, addAll, addAll, clear, contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
-
Constructor Details
-
FontFamily
Create a FontFamily proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
getFace
Gets thePangoFontFace
of this FontFamily with the given name.- Parameters:
name
- the name of a face. If the name isnull
, the family's default face (fontconfig calls it "Regular") will be returned.- Returns:
- the
PangoFontFace
, ornull
if no face with the given name exists.
-
getName
Gets the name of the family.The name is unique among all fonts for the font backend and can be used in a
PangoFontDescription
to specify that a face from this family is desired.- Returns:
- the name of the family. This string is owned by the family object and must not be modified or freed.
-
isMonospace
public boolean isMonospace()A monospace font is a font designed for text display where the the characters form a regular grid.For Western languages this would mean that the advance width of all characters are the same, but this categorization also includes Asian fonts which include double-width characters: characters that occupy two grid cells. g_unichar_iswide() returns a result that indicates whether a character is typically double-width in a monospace font.
The best way to find out the grid-cell size is to call
FontMetrics.getApproximateDigitWidth()
, since the results ofFontMetrics.getApproximateCharWidth()
may be affected by double-width characters.- Returns:
true
if the family is monospace.
-
isVariable
public boolean isVariable()A variable font is a font which has axes that can be modified to produce different faces.Such axes are also known as _variations_; see
FontDescription.setVariations(java.lang.String)
for more information.- Returns:
true
if the family is variable
-
listFaces
Lists the different font faces that make up this FontFamily.The faces in a family share a common design, but differ in slant, weight, width and other aspects.
Note that the returned faces are not in any particular order, and multiple faces may have the same name or characteristics.
PangoFontFamily
also implemented theListModel
interface for enumerating faces.- Parameters:
faces
- location to store an array of pointers toPangoFontFace
objects, ornull
. This array should be freed with g_free() when it is no longer needed.
-
builder
AFontFamily.Builder
object constructs aFontFamily
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withFontFamily.Builder.build()
.
-