Class FontFamily
- All Implemented Interfaces:
Iterable<FontFace>, Collection<FontFace>, List<FontFace>, SequencedCollection<FontFace>, ListModel<FontFace>, Proxy, ListModelJavaList<FontFace>
- Direct Known Subclasses:
FontFamily.FontFamily$Impl
A 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 GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface ListModel
ListModel.ItemsChangedCallback, ListModel.ListModel$Impl, ListModel.ListModelInterfaceNested classes/interfaces inherited from interface ListModelJavaList
ListModelJavaList.SubList<E,List> -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new FontFamily.FontFamily(MemorySegment address) Create a FontFamily instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected FontFamilyasParent()Return 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 class.booleanA 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 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 TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCodeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort, spliteratorMethods inherited from interface ListModel
emitItemsChanged, getItem, getItemType, getNItems, itemsChanged, onItemsChangedMethods inherited from interface 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 instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
FontFamily
public FontFamily()Create a new FontFamily.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
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(String)for more information.- Returns:
trueif the family is variable- Since:
- 1.44
-
listFaces
Lists the different font faces that make up
family.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.
-