Giter VIP home page Giter VIP logo

dynotype's Introduction

Warning: This is pre-release, experimental software!

dynotype is a specialized sprite sheet generator and typesetter, designed to feed bitmap text rendering systems. This module is not capable of rendering text on its own, and should be paired with loopin-dynotype.

Quick Walkthrough

Given the following configuration file ...

# Name of the font sheet. This will be used for yaml, png and html file.
name: hello-example

# Glyphs to include in the sheet.
glyphs: Hello, world! ๐Ÿ‘ ๐Ÿ˜
size: 48
fonts: 
  - family: 'Lobster'
    # CSS for individual fonts needs a bit of tweaking.
    css: |
      top: 6px;
      left: 6px;

# Set the background. In real-world usage, 
# transparent would better,
# but this will show up in markdown.
css: |
  body {
    background: #004
  }  

... and running from the command line ...

dynotype example/hello.yaml

... dynotype will produce this image ...

example output image from configuration above

... along with metadata describing the sprite sheet. The sheet can now be loaded in javascript and typeset.

const Dynotype = require('dynotype')
const dyno = new Dynotype()
await dyno.load('hello-example.yaml')

let line = dyno.line('Hello, world!')
// `line` will now contain placement of each
// glyph of the string above, using actual 
// character widths!

Installation

dynotype should be installed globally for command line use.

PhantomJS is required for sheet generation.

ImageMagick is required for blurring.

The following is for OSX, using the Homebrew package manager.

brew install phantomjs imagemagick
npm install -g dynotype

Usage

Multiple Fonts

const dyno = new Dynotype( {
  glyphs: 'First Second Font,!',
  fonts: [
    { family: 'Roboto' },
    { family: 'Lobster' }
  ]
})

await dyno.refresh()

let line = dyno.line( 'First Font, ', { font: 1 }, 'Second Font!' )

Future

  • More thorough documentation.
  • Publishing of downstream modules.
  • Support for icon libraries font-awesome and weathericons.
  • Text rendering.
  • More advanced typesetting.
  • Support for images.

Thanks

Development of dynotype, as well as other interesting, open source creative coding software, is supported by HFour.

dynotype's People

Contributors

koopero avatar

Watchers

 avatar

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.