ztcl::typeset

ztcl::typeset subcommand ?arg ...?

Breaks paragraphs into lines with the total-fit algorithm of Knuth and Plass, hyphenates words with the patterns of Liang, measures text in TrueType fonts, and lays out Markdown into the pages of a PDF document.

Subcommands

Synopsis What it does
break text -width w ?options? Gives the lines of a paragraph, with the x position of each word.
justify text -width columns ?options? Gives justified lines of characters, for a terminal.
svg text -width w -font font ?options? Gives an SVG image of a paragraph.
hyphenate word ?-lang en-us? Gives the word with a hyphen at each place where it can break.
pages counts -lines n ?-columns c? ?-gap g? Places paragraphs in columns and pages with no widow or orphan line.
font load bytes Loads a TrueType font and gives its handle.
font metrics font size Gives the metrics of a font at a size.
font measure font size string Gives the width of a string in points.
markdown doc text -fonts dict ?-style dict? ?-run prefix? Lays out Markdown into new pages of a document.
book doc chapters -fonts dict ?-style dict? ?-run prefix? Lays out a list of Markdown chapters into new pages of a document.

Examples

A click on an example runs it in the shell of the page.

Facts