Class InstalledFontCollection

  • All Implemented Interfaces:
    FontCollection

    public class InstalledFontCollection
    extends java.lang.Object
    implements FontCollection
    A custom AWT font collection
    • Field Detail

      • log

        private static org.apache.commons.logging.Log log
      • HARDCODED_FONT_NAMES

        private static final java.util.Set<java.lang.String> HARDCODED_FONT_NAMES
      • java2DFontMetrics

        private final Java2DFontMetrics java2DFontMetrics
        Required by new instances of FontMetricsMapper
    • Constructor Detail

      • InstalledFontCollection

        public InstalledFontCollection​(Java2DFontMetrics java2DFontMetrics)
        Main constructor
        Parameters:
        java2DFontMetrics - required by new instances of FontMetricsMapper
    • Method Detail

      • setup

        public int setup​(int start,
                         FontInfo fontInfo)
        Sets up fonts in a font info object. Adds metrics for basic fonts and useful family-style-weight triplets for lookup.
        Specified by:
        setup in interface FontCollection
        Parameters:
        start - the font starting number
        fontInfo - the font info to set up
        Returns:
        the starting font number for the next font to be added
      • addFontTriplet

        private static void addFontTriplet​(FontInfo fontInfo,
                                           java.lang.String fontName,
                                           java.lang.String fontStyle,
                                           int fontWeight,
                                           java.lang.String fontKey)
      • addFontMetricsMapper

        private static void addFontMetricsMapper​(FontInfo fontInfo,
                                                 java.lang.String family,
                                                 java.lang.String fontKey,
                                                 Java2DFontMetrics java2DFontMetrics,
                                                 int style)
      • convertToAWTFontStyle

        private static int convertToAWTFontStyle​(java.lang.String fontStyle,
                                                 int fontWeight)