bramstein / typeset

TeX line breaking algorithm in JavaScript
BSD 2-Clause "Simplified" License
996 stars 74 forks source link

line breaking with optional word breaking if needed? #17

Closed foo123 closed 9 years ago

foo123 commented 9 years ago

Hello there, not sure cif this issue is already answered somewhere (not sure)

i want a variant of the Knuth-Plass/Tex line breaking with optimal hyphenation insertion (word breaking)

Specificaly i have a paragraph of text that i need to format in specifieed width with minimal lines but also optimal word breaks (meaning words can be broken/hyphenated if needed but optimaly to preserve visual/textual pleasing layout). i already have a greedy/local algorithm in place but i would like to change to the Tex algorithm.

Is this possible in typeset or maybe i ned to add this (and maybe create a PR)

Thank you

bramstein commented 9 years ago

This is exactly what Typeset does :) It uses Hypher (http://github.com/bramstein/hypher) to perform hyphenation.

foo123 commented 9 years ago

Great, i guess i'll have to do some tests and if needed get back here. Thanks closing this