General ⇒ Own text rendering
Own text rendering
is it possible to write own text rendering?
It would be very useful for me in my project. I would like to make word spacing dynamically using own algorithm. It should be another algorithm for making text justifying. On which level tex stack is it possible?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Own text rendering
If you want to customize the word spacing and the justification, you can use Lua(La)TeX: There you can overwrite the `linebreak_filter` callback. This callback replaces the built-in logic for breaking paragraphs into lines. You get a list of nodes, representing the text of the paragraph, passed and you can implement your own algorithm for converting this into a list of lines.
This allows a lot of customization about the text layout, but if you want to modify the rendering of the vector glyphs into actual screen or printer output, you are out of luck: This is handled (at least for Type 1/OpenType/TrueType fonts) by the PDF viewer, so TeX can change their implementation.
Best regards
Marcel