When substituting fonts, there is one important questions we need to solve…
What happens if we do not recognise the font?
There are 3 alternatives we have for handling fonts we do not have setup for substitution:-
a. Ignore the fact and use the font name. (HTMLFontMapper.IGNORE)
b. Use a default. (HTMLFontMapper.DEFAULT_ON_UNMAPPED)
c. Fail (forcing the user to fix the issue by setting up a mapping (HTMLFontMapper.FAIL_ON_UNMAPPED)
It is set by a single call when we setup HTML extraction
If you look at the code you will also see THREE currently unused options (EMBED_UNKNOWN_AS_IMAGE, EMBED_UNKNOWN_WITH_FONT, EMBED_ALL) which might whet your appetite for some possible future enhancements…
Click here to see all the articles in the PDF to HTML5 conversion series.
This post is part of our “Fonts Articles Index” in these articles we explore Fonts.
Latest posts by Mark Stephens (see all)
- My experience of a Turkish bath (visiting Istanbul for DevFest) - November 24, 2017
- My 5 key takeaways from JavaOne 2017 - October 6, 2017
- My notes and pictures from thursday JavaOne 2017 - October 5, 2017
- My notes and pictures from Wednesday JavaOne 2017 - October 5, 2017
- My notes and pictures from Tuesday JavaOne 2017 - October 4, 2017