danfickle / danfickle/openhtmltopdf

Allow adding glyphs to the default font

Open
#287 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.2k
Forks
423
PR merge metrics
No merged PRs in 30d

Description

Currently I have to add the following code using JSoup to add a new "font-family"

document.head().append("body` { font-family: 'noto', sans-serif;}");

Then I have to add the following loaders

.useFont(() -> Thread.currentThread().getContextClassLoader().getResourceAsStream("fonts/NotoSansCJKtc-Regular.ttf"), "noto")
.useFont(() -> Thread.currentThread().getContextClassLoader().getResourceAsStream("fonts/NotoSans-Regular.ttf"), "noto")

I was wondering if we can get away from defining "noto" and just add the CJK font glyphs as a fallback to the default font?

Presently `useFont` only provides a `fontFamily` parameter as a string. Perhaps `useFont` that does not provide a fontFamily can be used to provide extra glyphs to the default font so we don't need to add `font-family`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.