Package imgui

Class ImFontConfig


public final class ImFontConfig extends ImGuiStructDestroyable
  • Constructor Details

    • ImFontConfig

      public ImFontConfig()
  • Method Details

    • create

      protected long create()
      Specified by:
      create in class ImGuiStructDestroyable
    • getFontData

      public byte[] getFontData()
      TTF/OTF data
    • setFontData

      public void setFontData(byte[] fontData)
      TTF/OTF data
    • getFontDataSize

      public int getFontDataSize()
      TTF/OTF data size
    • setFontDataSize

      public void setFontDataSize(int value)
      TTF/OTF data size
    • getFontDataOwnedByAtlas

      public boolean getFontDataOwnedByAtlas()
      TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself).
    • setFontDataOwnedByAtlas

      public void setFontDataOwnedByAtlas(boolean value)
      TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself).
    • getFontNo

      public int getFontNo()
      Index of font within TTF/OTF file
    • setFontNo

      public void setFontNo(int value)
      Index of font within TTF/OTF file
    • getSizePixels

      public float getSizePixels()
      Size in pixels for rasterizer (more or less maps to the resulting font height).
    • setSizePixels

      public void setSizePixels(float value)
      Size in pixels for rasterizer (more or less maps to the resulting font height).
    • getOversampleH

      public int getOversampleH()
      Rasterize at higher quality for sub-pixel positioning. Note the difference between 2 and 3 is minimal so you can reduce this to 2 to save memory. Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details.
    • setOversampleH

      public void setOversampleH(int value)
      Rasterize at higher quality for sub-pixel positioning. Note the difference between 2 and 3 is minimal so you can reduce this to 2 to save memory. Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details.
    • getOversampleV

      public int getOversampleV()
      Rasterize at higher quality for sub-pixel positioning. This is not really useful as we don't use sub-pixel positions on the Y axis.
    • setOversampleV

      public void setOversampleV(int value)
      Rasterize at higher quality for sub-pixel positioning. This is not really useful as we don't use sub-pixel positions on the Y axis.
    • getPixelSnapH

      public boolean getPixelSnapH()
      Align every glyph to pixel boundary. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1.
    • setPixelSnapH

      public void setPixelSnapH(boolean value)
      Align every glyph to pixel boundary. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1.
    • getGlyphExtraAdvanceX

      public float getGlyphExtraAdvanceX()
      Extra spacing (in pixels) between glyphs (added to glyph AdvanceX). Since imgui 1.92 this is a scalar X-only value; the previous GlyphExtraSpacing ImVec2 was removed as largely obsolete.
    • setGlyphExtraAdvanceX

      public void setGlyphExtraAdvanceX(float value)
      Extra spacing (in pixels) between glyphs (added to glyph AdvanceX). Since imgui 1.92 this is a scalar X-only value; the previous GlyphExtraSpacing ImVec2 was removed as largely obsolete.
    • getGlyphOffset

      public ImVec2 getGlyphOffset()
      Offset all glyphs from this font input.
    • getGlyphOffsetX

      public float getGlyphOffsetX()
      Offset all glyphs from this font input.
    • getGlyphOffsetY

      public float getGlyphOffsetY()
      Offset all glyphs from this font input.
    • getGlyphOffset

      public void getGlyphOffset(ImVec2 dst)
      Offset all glyphs from this font input.
    • setGlyphOffset

      public void setGlyphOffset(ImVec2 value)
      Offset all glyphs from this font input.
    • setGlyphOffset

      public void setGlyphOffset(float valueX, float valueY)
      Offset all glyphs from this font input.
    • getGlyphRanges

      public short[] getGlyphRanges()
      Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list). THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE.
    • setGlyphRanges

      public void setGlyphRanges(short[] glyphRanges)
      Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list). THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE.
    • getGlyphExcludeRanges

      public short[] getGlyphExcludeRanges()
      Exclude ranges (list of Unicode range pairs, zero-terminated) from this font source when merging multiple fonts -- useful to avoid one font's glyphs masking another's. New in imgui 1.92. THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE.
    • setGlyphExcludeRanges

      public void setGlyphExcludeRanges(short[] glyphExcludeRanges)
      Exclude ranges (list of Unicode range pairs, zero-terminated) from this font source when merging multiple fonts. New in imgui 1.92. THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE.
    • getGlyphMinAdvanceX

      public float getGlyphMinAdvanceX()
      Minimum AdvanceX for glyphs, set Min to align font icons, set both Min/Max to enforce mono-space font
    • setGlyphMinAdvanceX

      public void setGlyphMinAdvanceX(float value)
      Minimum AdvanceX for glyphs, set Min to align font icons, set both Min/Max to enforce mono-space font
    • getGlyphMaxAdvanceX

      public float getGlyphMaxAdvanceX()
      Maximum AdvanceX for glyphs
    • setGlyphMaxAdvanceX

      public void setGlyphMaxAdvanceX(float value)
      Maximum AdvanceX for glyphs
    • getMergeMode

      public boolean getMergeMode()
      Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights.
    • setMergeMode

      public void setMergeMode(boolean value)
      Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights.
    • getFontLoaderFlags

      public int getFontLoaderFlags()
      Settings for custom font loader. THIS IS LOADER IMPLEMENTATION DEPENDENT. Leave as zero if unsure. (Renamed from FontBuilderFlags in imgui 1.92.)
    • setFontLoaderFlags

      public void setFontLoaderFlags(int value)
      Settings for custom font loader. THIS IS LOADER IMPLEMENTATION DEPENDENT. Leave as zero if unsure. (Renamed from FontBuilderFlags in imgui 1.92.)
    • addFontLoaderFlags

      public void addFontLoaderFlags(int flags)
      Settings for custom font loader. THIS IS LOADER IMPLEMENTATION DEPENDENT. Leave as zero if unsure. (Renamed from FontBuilderFlags in imgui 1.92.)
    • removeFontLoaderFlags

      public void removeFontLoaderFlags(int flags)
      Settings for custom font loader. THIS IS LOADER IMPLEMENTATION DEPENDENT. Leave as zero if unsure. (Renamed from FontBuilderFlags in imgui 1.92.)
    • hasFontLoaderFlags

      public boolean hasFontLoaderFlags(int flags)
      Settings for custom font loader. THIS IS LOADER IMPLEMENTATION DEPENDENT. Leave as zero if unsure. (Renamed from FontBuilderFlags in imgui 1.92.)
    • getRasterizerMultiply

      public float getRasterizerMultiply()
      Brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable.
    • setRasterizerMultiply

      public void setRasterizerMultiply(float value)
      Brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable.
    • getRasterizerDensity

      public float getRasterizerDensity()
      DPI scale for rasterization, not altering other font metrics: make it easy to swap between e.g. a 100% and a 400% fonts for a zooming display. IMPORTANT: If you increase this it is expected that you increase font scale accordingly, otherwise quality may look lowered.
    • setRasterizerDensity

      public void setRasterizerDensity(float value)
      DPI scale for rasterization, not altering other font metrics: make it easy to swap between e.g. a 100% and a 400% fonts for a zooming display. IMPORTANT: If you increase this it is expected that you increase font scale accordingly, otherwise quality may look lowered.
    • getEllipsisChar

      public short getEllipsisChar()
      Explicitly specify unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used.
    • setEllipsisChar

      public void setEllipsisChar(short value)
      Explicitly specify unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used.
    • setName

      public void setName(String name)
      Name (strictly to ease debugging)
    • getDstFont

      public ImFont getDstFont()
    • setDstFont

      public void setDstFont(ImFont value)