com.openhtmltopdf.util.OpenUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openhtmltopdf-core Show documentation
Show all versions of openhtmltopdf-core Show documentation
Open HTML to PDF is a CSS 2.1 renderer written in Java. This artifact contains the core rendering and layout code.
package com.openhtmltopdf.util;
public class OpenUtil {
private OpenUtil() {}
/**
* 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.
* @param codePoint
* @return whether codePoint is printable
*/
public static boolean isCodePointPrintable(int codePoint) {
if (Character.isISOControl(codePoint))
return false;
int category = Character.getType(codePoint);
return !(category == Character.CONTROL ||
category == Character.FORMAT ||
category == Character.UNASSIGNED ||
category == Character.PRIVATE_USE ||
category == Character.SURROGATE);
}
}