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?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
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