Class LineMetricsAdapter

  • All Implemented Interfaces:
    FSFontMetrics

    public class LineMetricsAdapter
    extends java.lang.Object
    implements FSFontMetrics
    A note on this class: What we really want is a FontMetrics2D object (i.e. font metrics with float precision). Unfortunately, it doesn't seem the JDK provides this. However, looking at the JDK code, it appears the metrics contained in the LineMetrics are actually the metrics of the font, not the metrics of the line (and empirically strings of "X" and "j" return the same value for getAscent()). So... for now we use LineMetrics for font metrics.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<java.awt.font.LineMetrics> _lineMetrics  
    • Constructor Summary

      Constructors 
      Constructor Description
      LineMetricsAdapter​(java.util.List<java.awt.Font> fonts, java.lang.String str, java.awt.font.FontRenderContext ctx)  
    • Field Detail

      • _lineMetrics

        private final java.util.List<java.awt.font.LineMetrics> _lineMetrics
    • Constructor Detail

      • LineMetricsAdapter

        public LineMetricsAdapter​(java.util.List<java.awt.Font> fonts,
                                  java.lang.String str,
                                  java.awt.font.FontRenderContext ctx)