GeneralOwn text rendering

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
malkol
Posts: 1
Joined: Tue Apr 23, 2019 5:53 pm

Own text rendering

Post by malkol »

Hi,
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?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

zauguin
Posts: 4
Joined: Thu Jan 24, 2019 9:50 pm

Own text rendering

Post by zauguin »

Hi,

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
Post Reply