engine/

directory
v0.0.0-...-ae32867 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2020 License: BSD-3-Clause

README

Typesetting Engine

If you think about it: a typesetter using the HTML/CSS box model is effectively a browser with output type PDF. Browsers are large and complex pieces of code, a fact that implies that we should seek out where to reduce complexity.

A good explanation of styling may be found in a superb blog entry by Lin Clark about the Firefox styling engine. I also very much enjoyed reading articles by Mikito Takada: "Learn CSS Layout the pedantic way."

There is not very much open source Go code around for supporting us in implementing a styling and layout engine, except the great work of Cascadia. Therefore we will have to compromise on many feature in order to complete this in a realistic time frame. For a reminder of why that is, refer to this video.

From a high level view the creation of documents from the internal representation looks something like this:

gotype document creation flow overview

Directories

Path Synopsis
dom
Package dom will some day provide utilities for HTMLbook DOMs.
Package dom will some day provide utilities for HTMLbook DOMs.
cssom
Package cssom provides functionality for CSS styling.
Package cssom provides functionality for CSS styling.
cssom/douceuradapter
Package douceuradapter is a concrete implementation of interface cssom.StyleSheet.
Package douceuradapter is a concrete implementation of interface cssom.StyleSheet.
cssom/style
Package style provides functionality for CSS styling properties.
Package style provides functionality for CSS styling properties.
domdbg
Package domdbg implements helpers to debug a DOM tree.
Package domdbg implements helpers to debug a DOM tree.
styledtree
Package styledtree is a straightforward default implementation of a styled document tree.
Package styledtree is a straightforward default implementation of a styled document tree.
styledtree/xpathadapter
Package xpathadapter implements an xpath.NodeNavigator.
Package xpathadapter implements an xpath.NodeNavigator.
w3cdom
Package w3cdom defines an interface type for W3C Document Object Models.
Package w3cdom defines an interface type for W3C Document Object Models.
xpath
Package xpath provides tree walking for the DOM with XPath syntax.
Package xpath provides tree walking for the DOM with XPath syntax.
box
Package box deals with typesetting boxes.
Package box deals with typesetting boxes.
layout
Package layout produces a render tree from a styled tree.
Package layout produces a render tree from a styled tree.
Package khipu is about encoding text into typesetting items.
Package khipu is about encoding text into typesetting items.
linebreak
Package linebreak collects types for line-breaking.
Package linebreak collects types for line-breaking.
linebreak/firstfit
Package firstfit implements a straightforward line-breaking algorithm where lines are broken at the first suitable breakpoint.
Package firstfit implements a straightforward line-breaking algorithm where lines are broken at the first suitable breakpoint.
linebreak/knuthplass
Package knuthplass implements (in an early draft) a line breaking algorithm described by D.E. Knuth and M.F. Plass.
Package knuthplass implements (in an early draft) a line breaking algorithm described by D.E. Knuth and M.F. Plass.
textshaping
CGo wrapper for the Harfbuzz text shaping library.
CGo wrapper for the Harfbuzz text shaping library.
Package tree implements an all-purpose tree type.
Package tree implements an all-purpose tree type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL