Forum How do I...?

JavaScript: Change class after text rendering

twantzen
Is it possible to read the height of a text block with javascript after it’s rendering, and if the text block is greater than xyz, use a different CSS class (smaller font-size, change to 2 columns etc.)?
mikeday
Currently this requires a two-pass process, in which JavaScript runs after typesetting to inspect the box tree, then Prince is run again. We hope to streamline this in the future.