embed notosans

This commit is contained in:
Jörg Prante 2023-07-31 10:41:46 +02:00
parent 11bc5a9393
commit ca317f41ec
3 changed files with 4 additions and 2 deletions

View file

@ -1,5 +1,5 @@
group = org.xbib.graphics
name = graphics
version = 4.4.0
version = 4.4.1
org.gradle.warning.mode = ALL

View file

@ -58,7 +58,7 @@ public class NotoSansFont implements Font {
private PDType0Font load(String resourceName) {
try {
return PDType0Font.load(pdDocument, Objects.requireNonNull(NotoSansFont.class.getResourceAsStream(resourceName)));
return PDType0Font.load(pdDocument, Objects.requireNonNull(NotoSansFont.class.getResourceAsStream(resourceName)), true);
} catch (IOException e) {
throw new UncheckedIOException(e);
}

View file

@ -22,6 +22,8 @@ public class HelloNotoFontTest {
paragraph.addMarkup("*Hello Noto Bold*\n", 12, font);
paragraph.addMarkup("_Hello Noto Italic_\n", 12, font);
paragraph.addMarkup("*_Hello Noto Bold Italic_*\n", 12, font);
paragraph.addText("Hello Unicode Text: Zwrotki dla Dorotki : arcyksiążę fiołków\n", 12, font);
paragraph.addMarkup("Hello Unicode Markup: _Zwrotki dla Dorotki : arcyksiążę fiołków_\n", 12, font);
document.add(paragraph);
document.render().save(new FileOutputStream("build/hellonotofont.pdf")).close();
}