Top Constructors Methods
com.openhtmltopdf.util

public Class OpenUtil

extends Object
Class Inheritance
Imports
java.util.Objects

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

whether all characters are printable
areAllCharactersPrintable
(String
a non-null string to test
str
)

Returns true, when all characters of the given string are printable.

public static int
firstNonZero(int... values)

First non-zero value or zero if none.

public static boolean

Returns:

whether codePoint is printable
isCodePointPrintable
(int codePoint)

Checks if a code point is printable.

public static boolean
isSafeFontCodePointToPrint(int codePoint)

Whether the code point should be passed through to the font for rendering.

public static Integer
parseIntegerOrNull(String possibleInteger)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

OpenUtilback to summary
private OpenUtil()

Method Detail

areAllCharactersPrintableback to summary
public static boolean areAllCharactersPrintable(String str)

Returns true, when all characters of the given string are printable.

Parameters
str:String

a non-null string to test

Returns:boolean

whether all characters are printable

firstNonZeroback to summary
public static int firstNonZero(int... values)

First non-zero value or zero if none.

isCodePointPrintableback to summary
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.

Returns:boolean

whether codePoint is printable

isSafeFontCodePointToPrintback to summary
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.

parseIntegerOrNullback to summary
public static Integer parseIntegerOrNull(String possibleInteger)