Git Product home page Git Product logo

scribble's Introduction

Scribble.js

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.

Similar Projects

  • Rough.js for drawing scribbly shapes (lines, circles, rectangles, arbitrary polygons)
  • A neural network based technique for rendering handwriting in different styles - this is impressive, and obviously much more dynamic in its generation of handwriting, but still it would be interesting to compare results to much simpler techniques for randomizing handwriting, like adding noise to the derivitive of recorded paths (/to the relative points that make up the path)
  • MultiMedium - a later project of mine where the idea is to record handwriting inline in a page, so you record unique data per word instead of using a font and randomizing it

Modules

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.

font.json

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"
};

scribble's People

Contributors

1j01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

scribble's Issues

Demo doesn't work

I drew a glyph for each character then clicked draw something with this font but only get a bunch of squiggly lines trailing down to the right

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.