Package imgui
Class ImFont
Font runtime data. A single logical font that can be baked at multiple sizes (see ImFontBaked via
getFontBaked).
In Dear ImGui 1.92 the font subsystem was reworked: ImFont now represents the font source set,
while size-specific data (glyphs, ascent/descent, character metrics) lives on ImFontBaked.
Many previously-exposed fields moved there and are no longer reachable through ImFont.
-
Field Summary
Fields inherited from class imgui.binding.ImGuiStruct
ptr -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalcTextSizeA(float size, float maxWidth, float wrapWidth, String textBegin) 'max_width' stops rendering after a certain width (could be turned into a 2d size).calcTextSizeA(float size, float maxWidth, float wrapWidth, String textBegin, String textEnd) 'max_width' stops rendering after a certain width (could be turned into a 2d size).voidcalcTextSizeA(ImVec2 dst, float size, float maxWidth, float wrapWidth, String textBegin) 'max_width' stops rendering after a certain width (could be turned into a 2d size).voidcalcTextSizeA(ImVec2 dst, float size, float maxWidth, float wrapWidth, String textBegin, String textEnd) 'max_width' stops rendering after a certain width (could be turned into a 2d size).floatcalcTextSizeAX(float size, float maxWidth, float wrapWidth, String textBegin) 'max_width' stops rendering after a certain width (could be turned into a 2d size).floatcalcTextSizeAX(float size, float maxWidth, float wrapWidth, String textBegin, String textEnd) 'max_width' stops rendering after a certain width (could be turned into a 2d size).floatcalcTextSizeAY(float size, float maxWidth, float wrapWidth, String textBegin) 'max_width' stops rendering after a certain width (could be turned into a 2d size).floatcalcTextSizeAY(float size, float maxWidth, float wrapWidth, String textBegin, String textEnd) 'max_width' stops rendering after a certain width (could be turned into a 2d size).calcWordWrapPositionA(float scale, String text, String textEnd, float wrapWidth) Deprecated.protected longcreate()shortCharacter used for ellipsis rendering.shortCharacter used if a glyph isn't found (U+FFFD, '?').floatFont size passed toAddFontXXX().floatgetScale()Legacy base font scale (~1.0f), multiplied by the per-window font scale which you can adjust with SetWindowFontScale().booleanisLoaded()voidrenderChar(ImDrawList drawList, float size, float posX, float posY, int col, int c) voidrenderChar(ImDrawList drawList, float size, ImVec2 pos, int col, int c) voidrenderText(ImDrawList drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip).voidrenderText(ImDrawList drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd, float wrapWidth) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip).voidrenderText(ImDrawList drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd, float wrapWidth, int flags) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip).voidrenderText(ImDrawList drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd, int flags) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip).voidrenderText(ImDrawList drawList, float size, ImVec2 pos, int col, ImVec4 clipRect, String textBegin, String textEnd) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip).voidrenderText(ImDrawList drawList, float size, ImVec2 pos, int col, ImVec4 clipRect, String textBegin, String textEnd, float wrapWidth) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip).voidrenderText(ImDrawList drawList, float size, ImVec2 pos, int col, ImVec4 clipRect, String textBegin, String textEnd, float wrapWidth, int flags) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip).voidrenderText(ImDrawList drawList, float size, ImVec2 pos, int col, ImVec4 clipRect, String textBegin, String textEnd, int flags) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip).voidsetEllipsisChar(short value) Character used for ellipsis rendering.voidsetFallbackChar(short value) Character used if a glyph isn't found (U+FFFD, '?').voidsetLegacySize(float value) Font size passed toAddFontXXX().voidsetScale(float value) Legacy base font scale (~1.0f), multiplied by the per-window font scale which you can adjust with SetWindowFontScale().Methods inherited from class imgui.binding.ImGuiStructDestroyable
destroyMethods inherited from class imgui.binding.ImGuiStruct
isNotValidPtr, isValidPtr
-
Constructor Details
-
ImFont
public ImFont() -
ImFont
public ImFont(long ptr)
-
-
Method Details
-
create
protected long create()- Specified by:
createin classImGuiStructDestroyable
-
getLegacySize
public float getLegacySize()Font size passed toAddFontXXX(). Use for legacy code callingImGui.pushFont(ImFont, float)that expected the original size (useImGui::GetFontBaked()in new code). -
setLegacySize
public void setLegacySize(float value) Font size passed toAddFontXXX(). Use for legacy code callingImGui.pushFont(ImFont, float)that expected the original size (useImGui::GetFontBaked()in new code). -
getEllipsisChar
public short getEllipsisChar()Character used for ellipsis rendering. -
setEllipsisChar
public void setEllipsisChar(short value) Character used for ellipsis rendering. -
getFallbackChar
public short getFallbackChar()Character used if a glyph isn't found (U+FFFD, '?'). -
setFallbackChar
public void setFallbackChar(short value) Character used if a glyph isn't found (U+FFFD, '?'). -
getScale
public float getScale()Legacy base font scale (~1.0f), multiplied by the per-window font scale which you can adjust with SetWindowFontScale(). Obsolete since 1.92; kept behindIMGUI_DISABLE_OBSOLETE_FUNCTIONS. -
setScale
public void setScale(float value) Legacy base font scale (~1.0f), multiplied by the per-window font scale which you can adjust with SetWindowFontScale(). Obsolete since 1.92; kept behindIMGUI_DISABLE_OBSOLETE_FUNCTIONS. -
isLoaded
public boolean isLoaded() -
getDebugName
-
calcTextSizeA
'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable. 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable. -
calcTextSizeAX
'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable. 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable. -
calcTextSizeAY
'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable. 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable. -
calcTextSizeA
public void calcTextSizeA(ImVec2 dst, float size, float maxWidth, float wrapWidth, String textBegin) 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable. 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable. -
calcTextSizeA
public ImVec2 calcTextSizeA(float size, float maxWidth, float wrapWidth, String textBegin, String textEnd) 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable. 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable. -
calcTextSizeAX
public float calcTextSizeAX(float size, float maxWidth, float wrapWidth, String textBegin, String textEnd) 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable. 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable. -
calcTextSizeAY
public float calcTextSizeAY(float size, float maxWidth, float wrapWidth, String textBegin, String textEnd) 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable. 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable. -
calcTextSizeA
public void calcTextSizeA(ImVec2 dst, float size, float maxWidth, float wrapWidth, String textBegin, String textEnd) 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable. 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable. -
calcWordWrapPositionA
@Deprecated public String calcWordWrapPositionA(float scale, String text, String textEnd, float wrapWidth) Deprecated.since imgui 1.92; preferCalcWordWrapPosition(size, ...). This overload is kept as a legacy redirect; internally it passesLegacySize * scaleas the size. -
renderChar
-
renderChar
-
renderText
public void renderText(ImDrawList drawList, float size, ImVec2 pos, int col, ImVec4 clipRect, String textBegin, String textEnd) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip). -
renderText
public void renderText(ImDrawList drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip). -
renderText
public void renderText(ImDrawList drawList, float size, ImVec2 pos, int col, ImVec4 clipRect, String textBegin, String textEnd, float wrapWidth) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip). -
renderText
public void renderText(ImDrawList drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd, float wrapWidth) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip). -
renderText
public void renderText(ImDrawList drawList, float size, ImVec2 pos, int col, ImVec4 clipRect, String textBegin, String textEnd, float wrapWidth, int flags) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip). -
renderText
public void renderText(ImDrawList drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd, float wrapWidth, int flags) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip). -
renderText
public void renderText(ImDrawList drawList, float size, ImVec2 pos, int col, ImVec4 clipRect, String textBegin, String textEnd, int flags) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip). -
renderText
public void renderText(ImDrawList drawList, float size, float posX, float posY, int col, float clipRectX, float clipRectY, float clipRectZ, float clipRectW, String textBegin, String textEnd, int flags) Theflagsparameter isImDrawTextFlags(since imgui 1.92; previously abool cpu_fine_clip).
-
CalcWordWrapPosition(size, ...).