Class JSFont


  • class JSFont
    extends Object
    methods required by Jmol that access java.awt.Font private to org.jmol.awtjs2d
    • Constructor Detail

      • JSFont

        JSFont()
    • Method Detail

      • newFont

        static Object newFont​(String fontFace,
                              boolean isBold,
                              boolean isItalic,
                              float fontSize,
                              String type)
      • getFontMetrics

        static Object getFontMetrics​(Font font,
                                     Object context)
        Parameters:
        font -
        context -
        Returns:
        the context
      • getAscent

        static int getAscent​(Object context)
        Parameters:
        context -
        Returns:
        height of the font
      • getDescent

        static int getDescent​(Object context)
        Parameters:
        context -
        Returns:
        descent of "g"
      • stringWidth

        static int stringWidth​(Font font,
                               Object context,
                               String text)
        Parameters:
        font -
        context -
        text -
        Returns:
        width