-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use custom font #20
Comments
Currently, the easiest way is to use a font-face rule in your css. Note: Only truetype fonts are supported and this will not currently work in the Java2D renderer - see #17 @font-face {
font-family: "Noto Sans";
src: url("NotoSans-Regular.ttf"); /* Use an absolute or relative url. */
}
/* Later, use font as named: */
body {
font-family: 'Noto Sans', sans-serif;
} If you want to add it in code instead, let me know and I'll give you a code sample. |
The thing is I need to load font from the jar. I can get |
…put stream (such as from a resource). Based on pull-request by @aleksandr-m Thanks a lot.
I think the referenced commit does what you want. You can also use a jar url or a relative url if the document url is from a resource. Let me know if the provided method doesn't work. Thanks, Daniel. |
Initially I was thinking too about adding method with input stream but then noticed that there is check for Anyway, now it should work. Thanks. |
* Change groupid to reflect the transition into organization * Doing builds and especially releases both on push and PR leads into duplicate builds. We should choose on of them, and I think PR should suffice * Release process (danfickle#21) * The first commit in the repo is from 2004, so I find it correct to state that as the inception year * Updated the Maven compiler plugin as well * Updated the Maven source and javadocs plugins * Minor tweaks * First take on a release pipeline * Getting there * Switching to using semver instead * Updated groupid to adhere with what Maven central expects and accepts
Any way to use custom font? There is
PdfBoxFontResolver
, but currently don't see how to add custom font to it.The text was updated successfully, but these errors were encountered: