-
Notifications
You must be signed in to change notification settings - Fork 22
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
Support default fonts for text without font embedding #5
Comments
Just a note: PDFFont is an internal class of mine, not intended to be exported.
PDFFont.INTERNAL_PD_FONT_SANS_PLAIN is just pointing to PDType1Font.HELVETICA
So in the example the overridden method should simply look like:
@OverRide
protected PDFont mapFont(final Font font, final IFontTextDrawerEnv env) throws IOException, FontFormatException
{
return PDType1Font.HELVETICA;
}
@FabioVassallo<https://github.com/fabiovassallo> requires text rendered as fonts using the default PDF fonts without embedding any font file. His workaround/quickfix for that problem should be extended to handle more default font families correct.
PdfBoxGraphics2DFontTextDrawer fontTextDrawer = new PdfBoxGraphics2DFontTextDrawer() {
@OverRide
protected PDFont mapFont(final Font font, final IFontTextDrawerEnv env) throws IOException, FontFormatException
{
return PDFFont.INTERNAL_PD_FONT_SANS_PLAIN;
}
};
This requires a test driver which uses the different default font families first.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#5>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AcQfnfm1gbgqL3jEyl9OVZ5WHyq5rDCWks5siQPJgaJpZM4PXY-s>.
|
rototor
added a commit
that referenced
this issue
Oct 8, 2017
always uses default fonts if no matching font is registered.
I've just released version 0.8 which provides a PdfBoxGraphics2DFontTextDrawerDefaultFonts class. Using that PdfBoxGraphics2dFontTextDrawer you always get some default font, but it tries to map the font style to the correct font. (i.e. Bold to PDType1Font.HELVETICA_BOLD and so on). @FabioVassallo You might now use this one instead of your custom PdfBoxGraphics2dFontTextDrawer. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@FabioVassallo requires text rendered as fonts using the default PDF fonts without embedding any font file. His workaround/quickfix for that problem should be extended to handle more default font families correct.
This requires a test driver which uses the different default font families first.
The text was updated successfully, but these errors were encountered: