One of the interesting ‘issues’ in writing a PDF to HTML5 convertor is choosing the correct fontsize. In theory this should be easy. If it is 8pt in the PDF we use that for the PDF.
So what happens if we have a value of 8.5pt? This is perfectly possible in PDF (where it can be any double value) but HTML5 only allows 8 or 9. In Maths you would round 8.5 but in HTML5 the answer is it depends… Neither is perfect and you are also limited by the fact that Word spacing and Char spacing are also more limited than in PDF.
You also need to consider any Word Spacing and Text Spacing. I’ve been adding some heuristics this week to improve this in some cases. It makes some definite improvements but it is early days. So if you have any particularly interesting layouts which you think could be improved, let us know.
This post is part of our “Fonts Articles Index” in these articles we explore Fonts.
Latest posts by Mark Stephens (see all)
- Which version of Java SE should I use? - April 25, 2018
- How we are improving our code quality with IDEA in 2018 - March 7, 2018
- How we are improving our code quality with NetBeans in 2018 - March 1, 2018
- 3 ways that the European Union is changing the way Companies write software in 2018 - January 31, 2018
- IDRsolutions product range update for 2018 - January 22, 2018