Skip to content
Tech News
← Back to articles

Vector Graphics in Lil

read original more articles
Why This Matters

This article highlights the innovative use of vector graphics in Lil, a scripting language influenced by APL, to create and manipulate digital typefaces and text layouts. It showcases how Lil's structured approach to points, strokes, and paths enables precise rendering of complex text shapes, emphasizing its potential for advanced graphic and font design in digital environments. This development is significant for the tech industry as it offers new methods for scalable, customizable graphics and fonts, enhancing digital typography and visual communication for consumers and developers alike.

Key Takeaways

Vector Graphics in Lil

Dr. Allen Vincent Hershey developed some of the first digital typefaces, described by simple sequences of straight line-segments. These were originally published in his 1967 report Calligraphy for Computers.

The hershey module for the Decker ecosystem is concerned with laying out text using these typefaces. Decker’s scripting language, Lil, is of an unusual APL-influenced design. This article will explore Lil in the context of 2-dimensional vector graphics, expanding upon examples also discussed in the interactive documentation linked above.

Foundations

A point is an (x,y) pair of numbers describing rectangular coordinates on a canvas- a drawing surface. Points are represented in Lil as lists with a length of 2:

point:(3,-5)

A stroke is a list of points representing a sequence of lines to draw on the canvas, and thus also a list of lists of numbers. Given a list of four points, the stroke connects the first point to the second, the second point to the third, and the third point to the fourth. If there are N points in a stroke, it describes N-1 connected lines. We might also call a stroke a “polyline”:

stroke:(( list 3,-5),( list 2,5),( list 0,3))

A path is a list of strokes, and thus also a list of lists of points, and a list of lists of lists of numbers. A path can represent the strokes that make up a single shape- like the letter “A”- or a sequence of letters representing an entire word or sentence. The strokes within a path are ragged: they may vary in length.

path:( list ( list 1,2),( list 3,4)),

... continue reading