Package ij.util

Class FontUtil


  • public class FontUtil
    extends Object
    This class contains static utility methods for replacing fonts that are not available on the current system.
    • Constructor Detail

      • FontUtil

        public FontUtil()
    • Method Detail

      • getFont

        public static Font getFont​(String fontFamilyName,
                                   int style,
                                   float size)
        Returns a font with the given family name or, if not available, a similar font, e.g. Helvetica replaced by Arial
      • getSimilarFontsList

        public static String[] getSimilarFontsList​(String fontFamily)
        For a few basic font types, gets a list of replacement font families Note that java's 'SansSerif' has wider characters (significantly different metrics) than the other sans-serif fonts in the list; thus it should be considered a fallback option only. Also note that some fonts (Times, Helvetica, Courier, Monospace, Serif) tend to truncate some diacritical marks when using FontMetrics.getHeight (as ImageJ does), e.g. the ring of the Angstrom symbol Å may be clipped (at least on Java 1.6/Mac)