Replies: 1 comment 3 replies
-
In the TeX system, glue nodes were flexible spaces; is this true in your implementation? TeX's algorithm was designed for text using the Latin script, where the way to implement justification was to add flexible spaces between (essentially fixed-size) words. This is obviously not optimal for scripts which justify text in other ways - through varying the width of a glyph, or using substitutions, ligatures and replacements to create text nodes of alternative sizes. I've been trying to develop an algorithm which works well for flexible glyph/hlist nodes, but I'm interested to see if there is other work in this area. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Architecture overview of “boxes and glue”
Here is an attempt go give you an overview of the “boxes and glue” PDF typesetting library
There is a high level API (the frontend) and a low level API. Both can be used to create PDF documents. While the frontend gives you ready to use data structures and methods, you can still use the backend and create all the items yourself.
The frontend
The typesetting frontend knows about these building blocks:
The backend
The backend has all low level functions to handle typesetting (basic font loading and accessing, language handling and hyphenation, justification of paragraphs, ...). It also contains the logging API that is used in the frontend can which can be used in the underlying application.
Units
The basic typesetting unit is a “scaled point”. 65535 scaled points are in one dtp point. There are two methods (
bag.Sp()
andbag.MustSp()
) to convert from other units to sp.The part that needs the most explanation is the one on nodes:
Nodes
A node is a tiny piece of information that can be chained with other nodes to node lists. A node can be a glyph, a rule, an image or a box that holds other nodes.
These are the known node types:
a
or thefi
ligature.(to be continued/extended)
Beta Was this translation helpful? Give feedback.
All reactions