Class OpenUtil


  • public class OpenUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private OpenUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean areAllCharactersPrintable​(java.lang.String str)
      Returns true, when all characters of the given string are printable.
      static int firstNonZero​(int... values)
      First non-zero value or zero if none.
      static boolean isCodePointPrintable​(int codePoint)
      Checks if a code point is printable.
      static boolean isSafeFontCodePointToPrint​(int codePoint)
      Whether the code point should be passed through to the font for rendering.
      static java.lang.Integer parseIntegerOrNull​(java.lang.String possibleInteger)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OpenUtil

        private OpenUtil()
    • Method Detail

      • isCodePointPrintable

        public static boolean isCodePointPrintable​(int codePoint)
        Checks if a code point is printable. If false, it can be safely discarded at the rendering stage, else it should be replaced with the replacement character, if a suitable glyph can not be found. NOTE: This should only be called after a character has been shown to be NOT present in the font. It can not be called beforehand because some fonts contain private area characters and so on. Issue#588.
        Parameters:
        codePoint -
        Returns:
        whether codePoint is printable
      • isSafeFontCodePointToPrint

        public static boolean isSafeFontCodePointToPrint​(int codePoint)
        Whether the code point should be passed through to the font for rendering. It effectively filters out characters that have been shown to be problematic in some (broken) fonts such as visible soft-hyphens.
      • areAllCharactersPrintable

        public static boolean areAllCharactersPrintable​(java.lang.String str)
        Returns true, when all characters of the given string are printable.
        Parameters:
        str - a non-null string to test
        Returns:
        whether all characters are printable
      • parseIntegerOrNull

        public static java.lang.Integer parseIntegerOrNull​(java.lang.String possibleInteger)
      • firstNonZero

        public static int firstNonZero​(int... values)
        First non-zero value or zero if none.