Class FontMetrics


  • public class FontMetrics
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      float _ascent
      distance to reserve above baseline, typically negative
      float _avgCharWidth
      average character width, zero if unknown
      float _bottom
      greatest extent below origin of any glyph bounding box, typically positive; deprecated with variable fonts
      float _capHeight
      height of an upper-case letter, zero if unknown, typically negative
      float _descent
      distance to reserve below baseline, typically positive
      float _leading
      distance to add between lines, typically positive or zero
      float _maxCharWidth
      maximum character width, zero if unknown
      @Nullable java.lang.Float _strikeoutPosition
      distance from baseline to bottom of stroke, typically negative
      @Nullable java.lang.Float _strikeoutThickness
      strikeout thickness
      float _top
      greatest extent above origin of any glyph bounding box, typically negative; deprecated with variable fonts
      @Nullable java.lang.Float _underlinePosition
      distance from baseline to top of stroke, typically positive
      @Nullable java.lang.Float _underlineThickness
      underline thickness
      float _xHeight
      height of lower-case 'x', zero if unknown, typically negative
      float _xMax
      greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts
      float _xMin
      greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts
    • Constructor Summary

      Constructors 
      Constructor Description
      FontMetrics​(float top, float ascent, float descent, float bottom, float leading, float avgCharWidth, float maxCharWidth, float xMin, float xMax, float xHeight, float capHeight, @Nullable java.lang.Float underlineThickness, @Nullable java.lang.Float underlinePosition, @Nullable java.lang.Float strikeoutThickness, @Nullable java.lang.Float strikeoutPosition)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean canEqual​(java.lang.Object other)  
      boolean equals​(java.lang.Object o)  
      float getAscent()
      distance to reserve above baseline, typically negative
      float getAvgCharWidth()
      average character width, zero if unknown
      float getBottom()
      greatest extent below origin of any glyph bounding box, typically positive; deprecated with variable fonts
      float getCapHeight()
      height of an upper-case letter, zero if unknown, typically negative
      float getDescent()
      distance to reserve below baseline, typically positive
      float getHeight()  
      float getLeading()
      distance to add between lines, typically positive or zero
      float getMaxCharWidth()
      maximum character width, zero if unknown
      @Nullable java.lang.Float getStrikeoutPosition()
      distance from baseline to bottom of stroke, typically negative
      @Nullable java.lang.Float getStrikeoutThickness()
      strikeout thickness
      float getTop()
      greatest extent above origin of any glyph bounding box, typically negative; deprecated with variable fonts
      @Nullable java.lang.Float getUnderlinePosition()
      distance from baseline to top of stroke, typically positive
      @Nullable java.lang.Float getUnderlineThickness()
      underline thickness
      float getXHeight()
      height of lower-case 'x', zero if unknown, typically negative
      float getXMax()
      greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts
      float getXMin()
      greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • _top

        public final float _top
        greatest extent above origin of any glyph bounding box, typically negative; deprecated with variable fonts
      • _ascent

        public final float _ascent
        distance to reserve above baseline, typically negative
      • _descent

        public final float _descent
        distance to reserve below baseline, typically positive
      • _bottom

        public final float _bottom
        greatest extent below origin of any glyph bounding box, typically positive; deprecated with variable fonts
      • _leading

        public final float _leading
        distance to add between lines, typically positive or zero
      • _avgCharWidth

        public final float _avgCharWidth
        average character width, zero if unknown
      • _maxCharWidth

        public final float _maxCharWidth
        maximum character width, zero if unknown
      • _xMin

        public final float _xMin
        greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts
      • _xMax

        public final float _xMax
        greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts
      • _xHeight

        public final float _xHeight
        height of lower-case 'x', zero if unknown, typically negative
      • _capHeight

        public final float _capHeight
        height of an upper-case letter, zero if unknown, typically negative
      • _underlineThickness

        @Nullable
        public final @Nullable java.lang.Float _underlineThickness
        underline thickness
      • _underlinePosition

        @Nullable
        public final @Nullable java.lang.Float _underlinePosition
        distance from baseline to top of stroke, typically positive
      • _strikeoutThickness

        @Nullable
        public final @Nullable java.lang.Float _strikeoutThickness
        strikeout thickness
      • _strikeoutPosition

        @Nullable
        public final @Nullable java.lang.Float _strikeoutPosition
        distance from baseline to bottom of stroke, typically negative
    • Constructor Detail

      • FontMetrics

        public FontMetrics​(float top,
                           float ascent,
                           float descent,
                           float bottom,
                           float leading,
                           float avgCharWidth,
                           float maxCharWidth,
                           float xMin,
                           float xMax,
                           float xHeight,
                           float capHeight,
                           @Nullable
                           @Nullable java.lang.Float underlineThickness,
                           @Nullable
                           @Nullable java.lang.Float underlinePosition,
                           @Nullable
                           @Nullable java.lang.Float strikeoutThickness,
                           @Nullable
                           @Nullable java.lang.Float strikeoutPosition)
    • Method Detail

      • getHeight

        public float getHeight()
      • getTop

        public float getTop()
        greatest extent above origin of any glyph bounding box, typically negative; deprecated with variable fonts
      • getAscent

        public float getAscent()
        distance to reserve above baseline, typically negative
      • getDescent

        public float getDescent()
        distance to reserve below baseline, typically positive
      • getBottom

        public float getBottom()
        greatest extent below origin of any glyph bounding box, typically positive; deprecated with variable fonts
      • getLeading

        public float getLeading()
        distance to add between lines, typically positive or zero
      • getAvgCharWidth

        public float getAvgCharWidth()
        average character width, zero if unknown
      • getMaxCharWidth

        public float getMaxCharWidth()
        maximum character width, zero if unknown
      • getXMin

        public float getXMin()
        greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts
      • getXMax

        public float getXMax()
        greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts
      • getXHeight

        public float getXHeight()
        height of lower-case 'x', zero if unknown, typically negative
      • getCapHeight

        public float getCapHeight()
        height of an upper-case letter, zero if unknown, typically negative
      • getUnderlineThickness

        @Nullable
        public @Nullable java.lang.Float getUnderlineThickness()
        underline thickness
      • getUnderlinePosition

        @Nullable
        public @Nullable java.lang.Float getUnderlinePosition()
        distance from baseline to top of stroke, typically positive
      • getStrikeoutThickness

        @Nullable
        public @Nullable java.lang.Float getStrikeoutThickness()
        strikeout thickness
      • getStrikeoutPosition

        @Nullable
        public @Nullable java.lang.Float getStrikeoutPosition()
        distance from baseline to bottom of stroke, typically negative
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object