Scribble.js was an old project with the goal of drawing scribbly looking things, such as randomized handwriting, to create more convincing results than a static handwriting font, even one that provides glyph subsitutions to add variation.
If scribble.js existed and used modules and was a thing, it might look something like this:
Modules for contexts, pens, and fonts.
A context is an interface to something like a canvas or an svg.
A pen is the bridge between the context and a drawing action. It can have properties such as color, size, radius, shape, width, height, slant etc.
A font consists of a map of characters to glyph path data, and a function to iterate over it.
A sample font is given for testing, convinience, or whatever. Maybe you can find some other use for some, uh, typographic data.
Font data has this structure:
var pseudoFont = {
name: "Hello World",
// Glyphs is a map of glyphs (characters) to Paths.
// Paths are arrays of PathNodes.
// PathNodes are objects with position (x, y) and pressure (p).
glyphs: {
"A":[{x,y,p},{x,y,p},{x,y,p},{x,y,p},{x,y,p},{x,y,p},{x,y,p}...],
"B":[{x,y,p},{x,y,p},{x,y,p},{x,y,p},{x,y,p},{x,y,p},{x,y,p},{x,y,p}...],
"C":[{x,y,p},{x,y,p},{x,y,p},{x,y,p},{x,y,p},{x,y,p}...],
...
},
// (Optional metadata can be tacked on:)
metaData: "This stuff Is Optional",
otherMetaData: "whatever"
};