Class FontFamily
- All Implemented Interfaces:
Iterable<FontFace>,Collection<FontFace>,List<FontFace>,SequencedCollection<FontFace>,ListModel<FontFace>,Proxy,ListModelJavaList<FontFace>
- Direct Known Subclasses:
FontFamily.FontFamily$Impl
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
Nested ClassesModifier and TypeClassDescriptionstatic classFontFamily.Builder<B extends FontFamily.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classThe FontFamily$Impl type represents a native instance of the abstract FontFamily class.static classNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface org.gnome.gio.ListModel
ListModel.ItemsChangedCallback, ListModel.ListModel$Impl, ListModel.ListModelInterfaceNested classes/interfaces inherited from interface org.javagi.gio.ListModelJavaList
ListModelJavaList.SubList<E extends @Nullable GObject,List extends ListModelJavaList<E>> -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new FontFamily.FontFamily(MemorySegment address) Create a FontFamily proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected FontFamilyasParent()Returns this instance as if it were its parent type.@Nullable FontFaceGets thePangoFontFaceof this FontFamily with the given name.static MemoryLayoutThe memory layout of the native struct.getName()Gets the name of the family.static @Nullable TypegetType()Get the GType of the FontFamily classbooleanA monospace font is a font designed for text display where the the characters form a regular grid.booleanA variable font is a font which has axes that can be modified to produce different faces.voidLists the different font faces that make upfamily.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, builder, 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, 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, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort, spliteratorMethods inherited from interface org.gnome.gio.ListModel
emitItemsChanged, getItem, getItemType, getNItems, itemsChanged, onItemsChangedMethods inherited from interface org.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
-
FontFamily
public FontFamily()Creates a new FontFamily.
-
-
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 Javasuperkeyword, 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 thePangoFontFaceof 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, ornullif no face with the given name exists. - Since:
- 1.46
-
getName
Gets the name of the family.The name is unique among all fonts for the font backend and can be used in a
PangoFontDescriptionto 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:
trueif the family is monospace.- Since:
- 1.4
-
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:
trueif the family is variable- Since:
- 1.44
-
listFaces
Lists the different font faces that make upfamily.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.
PangoFontFamilyalso implemented theListModelinterface for enumerating faces.- Parameters:
faces- location to store an array of pointers toPangoFontFaceobjects, ornull. This array should be freed with g_free() when it is no longer needed.
-