Class FlatRobotoMonoFont


  • public class FlatRobotoMonoFont
    extends java.lang.Object
    The Roboto Mono font family.

    Font home page: https://fonts.google.com/specimen/Roboto+Mono
    GitHub project: https://github.com/googlefonts/RobotoMono

    To install the font, invoke following once (e.g. in your main() method; on AWT thread).

    For lazy loading use:

    
     FlatRobotoMonoFont.installLazy();
     

    Or load immediately with:

    
     FlatRobotoMonoFont.install();
     

    Use as application monospaced font (invoke before setting up FlatLaf):

    
     FlatLaf.setPreferredMonospacedFontFamily( FlatRobotoMonoFont.FAMILY );
     

    Create single fonts:

    
     new Font( FlatRobotoMonoFont.FAMILY, Font.PLAIN, 12 );
     new Font( FlatRobotoMonoFont.FAMILY, Font.ITALIC, 12 );
     new Font( FlatRobotoMonoFont.FAMILY, Font.BOLD, 12 );
     new Font( FlatRobotoMonoFont.FAMILY, Font.BOLD | Font.ITALIC, 12 );
     

    If using lazy loading, invoke following before creating the font:

    
     FontUtils.loadFontFamily( FlatRobotoMonoFont.FAMILY );
     

    E.g.:

    
     FontUtils.loadFontFamily( FlatRobotoMonoFont.FAMILY );
     Font font = new Font( FlatRobotoMonoFont.FAMILY, Font.PLAIN, 12 );
     

    Or use following:

    
     Font font = FontUtils.getCompositeFont( FlatRobotoMonoFont.FAMILY, Font.PLAIN, 12 );
     
    • Field Detail

      • FAMILY

        public static final java.lang.String FAMILY
        Family name for basic styles (regular, italic and bold).

        Usage:

        
         new Font( FlatRobotoMonoFont.FAMILY, Font.PLAIN, 12 );
         new Font( FlatRobotoMonoFont.FAMILY, Font.ITALIC, 12 );
         new Font( FlatRobotoMonoFont.FAMILY, Font.BOLD, 12 );
         new Font( FlatRobotoMonoFont.FAMILY, Font.BOLD | Font.ITALIC, 12 );
         
        See Also:
        Constant Field Values
    • Constructor Detail

      • FlatRobotoMonoFont

        private FlatRobotoMonoFont()
    • Method Detail

      • install

        public static void install()
        Creates and registers the fonts for all styles.

        When using FlatLaf, consider using installLazy().

      • installStyle

        public static boolean installStyle​(java.lang.String name)
        Creates and registers the font for the given style. See STYLE_ constants.