gnujpdf - unicode font support

This commit is contained in:
Jindra Petřík
2021-02-19 23:00:11 +01:00
parent 8aaf3a3b42
commit 9dacd28347
10 changed files with 520 additions and 137 deletions

View File

@@ -0,0 +1,54 @@
package gnu.jpdf;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author JPEXS
*/
public class RawPrintWriter {
private final OutputStream os;
public RawPrintWriter(OutputStream os) {
this.os = os;
}
public void print(String s) {
try {
os.write(s.getBytes());
} catch (IOException ex) {
Logger.getLogger(RawPrintWriter.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void printRaw(byte[] data) {
try {
os.write(data);
} catch (IOException ex) {
Logger.getLogger(RawPrintWriter.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void println(String s) {
try {
os.write((s + "\n").getBytes());
} catch (IOException ex) {
Logger.getLogger(RawPrintWriter.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void close() {
try {
os.close();
} catch (IOException ex) {
Logger.getLogger(RawPrintWriter.class.getName()).log(Level.SEVERE, null, ex);
}
}
}