Package com.jetbrains

Interface FontExtensions


@Service @Provided public interface FontExtensions
Font-related utilities.
  • Method Details

    • deriveFontWithFeatures

      Font deriveFontWithFeatures(Font font, String... features)
      This method derives a new Font object with a set of features. Feature syntax is <name> or <name>=<int>, like kern, or aalt=2. This method does not preserve features of the original font, they are completely overridden, if you need to append features to the font, use getEnabledFeatures(Font).
      Parameters:
      font - basic font
      features - set of OpenType's features
      Returns:
      new font
    • getEnabledFeatures

      String[] getEnabledFeatures(Font font)
      This method returns an array of features for the given font, set via deriveFontWithFeatures(java.awt.Font, java.lang.String...). Feature syntax is <name> or <name>=<int>, like kern, or aalt=2.
      Parameters:
      font - the font
      Returns:
      an array of features for the font
    • getAvailableFeatures

      Set<String> getAvailableFeatures(Font font)
      This method returns a set of OpenType features supported by the given font
      Parameters:
      font - the font
      Returns:
      set of supported features
    • getSubpixelResolution

      Dimension getSubpixelResolution()
      Get subpixel resolution for rendering text with greyscale antialiasing, set with -Djava2d.font.subpixelResolution=NxM, with integers between 1 and 16 instead of N and M. This only affects text rendered via glyph cache. Value of NxM means that each glyph has rasterized images for N distinct positions horizontally and M positions vertically. This effectively increases quality of glyph spacing in each direction at the cost of N*M times increased memory consumption.
      Returns:
      subpixel resolution (N, M)