letter: 'My mother had a beautiful handwriting. A little gothic, at the same time a little hysterical. At the beginning of each line, on the left side, the writing was regular, strict, gothic, but as the line moved to the side of the page, she became more and more nervous, worried, almost hysterical.',
function getCentroid(data) {
const size = data.size? data.size : 1;
const region = Math.ceil(size / data.cantCentroids);
const r = region * (data.i + Math.random());
const x = 0.5 * r * Math.cos(Math.PI * (2 * Math.random() + 0.75));
const y = r * Math.sin(2 * Math.PI * Math.random());
let glyphData, dictionary, modes;
let spacingX, spacingY, marginX, marginY;
function drawPaper(data) {
const CANT_LINES = data.cantLines? data.cantLines : 20;
const CANT_SEPARATIONS = data.cantSeps? data.cantSeps : 20;
const spacingX = Math.floor(data.dimensions.width / CANT_SEPARATIONS);
const spacingY = Math.floor(data.dimensions.height / CANT_LINES);
const marginX = spacingX * 0.5;
const marginY = Math.floor(data.dimensions.width / CANT_LINES);
colorMode(HSB, 360, 100, 100, 100);
background(color(BASE_H, BASE_S, BASE_B));
for (let x = marginX; x < data.dimensions.width - marginX; x += spacingX) {
for (let y = spacingY * 0.25; y < data.dimensions.height - marginY; y += spacingY) {
stroke(color(220, 80, 60, 95));
x + spacingX, y + spacingY
stroke(color(220 - 5, 80 - 15, 60 + 15, 95));
createCanvas(windowWidth, windowHeight);
describe('A notebook-like background, containing incomprehensible text. Its characters\' strokes get progressively wider as they approach the edge.')
spacingX = Math.floor(windowWidth / md.cols);
spacingY = Math.floor(windowHeight / md.rows);
marginX = spacingX * 0.5;
marginY = Math.floor(windowWidth / md.rows);
for (let i = 0; i < md.glyph.domain.cantCentroids; i++) {
centroids.push(getCentroid({size: spacingX * md.factorGlyphSize, cantCentroids: md.glyph.domain.cantCentroids, i}));
glyphData = {...md.glyph[md.typeGlyph], spacingX, spacingY, centroids, idx: 0};
dictionary = makeDictionary(md.typeGlyph, md.dictData, glyphData);
default: ({x, y}, glyphData) => {
const ran = Math.random();
if (jumped || ran > 0.15) {
glyphData.jumped = jumped;
const glyph = getGlyph(md.typeGlyph, glyphData);
drawGlyph(p, glyphData, glyph);
glyphData.jumped = false;
dictionary: ({x, y}, glyphData) => {
const c = md.letter[glyphData.idx];
drawGlyph(glyphData, dictionary[c]);
strokeWeight(md.strokeWeight * Math.ceil(2 * x / (windowWidth - marginX)));
md.factorGlyphSize += 0.4 * Math.ceil(2 * x / (windowWidth - marginX));
modes[md.mode]({x, y}, glyphData);
if (!md.letter[glyphData.idx] || md.letter[glyphData.idx] === '\n') {
if (x >= windowWidth - marginX) {
function mouseClicked() {