Here is the same paragraph set with Firefox (text-align: justify
),
typengine.js
, and LaTex:
I think as long typesetting in the web is ugly, PDF will remain the goto format for scientific publishing. I hope this project encurages more HTML5 based publishing.
typeengine.js
uses some advanced micro typography features:
- Condencing an expansion of the font by a few percent (using
transform: yScale()
). - Protrusion of the Margin, e.g. moving
.
out of the margin (settings parsed from microtype). - Implements the Knuth & Plass linebreaking algorithm.
This project build upon the tex-linebreak
by
Robert Knight.
For now, please see the example code. If people are interested in using this libary, I will add a better explanation.
- When calculating overhangs, match Unicode points to closest ASCII code point:
А̊ -> A
. see stackoverflow - The microtype functionallity is currently not considered when calculating linebreaks.
- Improve performance, maybe add some server side or static rendering capabilities.
- Add a slightly larger whitespace at a sentence end as LaTex.
- Make this project follow good javascript library
- The Hàn Thế Thành's PhD Thesis documents well how
microtyping works, is well written and is a nice introduction how
pdflatex
works.
Contributions are always welcome!