embed notosans
This commit is contained in:
parent
11bc5a9393
commit
ca317f41ec
3 changed files with 4 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
group = org.xbib.graphics
|
group = org.xbib.graphics
|
||||||
name = graphics
|
name = graphics
|
||||||
version = 4.4.0
|
version = 4.4.1
|
||||||
|
|
||||||
org.gradle.warning.mode = ALL
|
org.gradle.warning.mode = ALL
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class NotoSansFont implements Font {
|
||||||
|
|
||||||
private PDType0Font load(String resourceName) {
|
private PDType0Font load(String resourceName) {
|
||||||
try {
|
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) {
|
} catch (IOException e) {
|
||||||
throw new UncheckedIOException(e);
|
throw new UncheckedIOException(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,8 @@ public class HelloNotoFontTest {
|
||||||
paragraph.addMarkup("*Hello Noto Bold*\n", 12, font);
|
paragraph.addMarkup("*Hello Noto Bold*\n", 12, font);
|
||||||
paragraph.addMarkup("_Hello Noto Italic_\n", 12, font);
|
paragraph.addMarkup("_Hello Noto Italic_\n", 12, font);
|
||||||
paragraph.addMarkup("*_Hello Noto Bold 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.add(paragraph);
|
||||||
document.render().save(new FileOutputStream("build/hellonotofont.pdf")).close();
|
document.render().save(new FileOutputStream("build/hellonotofont.pdf")).close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue