GithubHelp home page GithubHelp logo

bewelge / funcanvasfonts Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 333 KB

Collection of Experimental Font Rendering Techniques on HTML5 Canvas

Home Page: https://bewelge.github.io/funCanvasFonts/

JavaScript 98.21% HTML 0.37% CSS 1.42%

funcanvasfonts's Introduction

Fun Canvas Fonts

Collection of Experimental Font Rendering Techniques on HTML5 Canvas

Currently features four different techniques of rendering Fonts on Canvas.

Please note that these are quite experimental and often computationally demanding techniques. They might significantly slow down your App if used.

Dots

dotImg

Splits

splitImg

Jitter

jitterImg

SVG Path ( Uses OpenFont.js )

SVGImg

Hanging Letters

hangingImg

Usage:

Dots:

Initiate with initDots( text, opts)

text - The text to write.

opts is an Object that can include:

  • font: Integer - The font size (Integer)

  • stroke:Boolean - Whether to stroke text or not

  • fill: Boolean - Whether to fill text or not

  • fillStyle: Color

  • strokeStyle: Color

  • lineWidth: Float - Width of Stroke

  • radius: Float - radius of dots

  • margin: Float - How close the dots are to one another

  • parseColors: Boolean - Whether or not dots take color of underlying text (otherwise always black)

  • gravity: Float - With how much force dots return to correct spot.

  • mass: Float - Heaviness of dots

  • mouseGravity: Float - Force of mouse

  • randomSpeed: Float - Randomizes how much dots are affected by mouse / gravity

  • randomSort: Boolean - sorts dots randomly (only noticeable if randomStart is true)

  • randomStart: Boolean - whether dots start at random point

  • continuousSpawn: Boolean - Whether all dots spawn at once or not

  • spawnSpeed: Integer - How many dots spawn per tick (only noticeable in connection with continuousSpawn)

  • cacheImg: Boolean - Whether to save dots as Images (instead of rendering with context.rect() everytime)

Splits

Initiate with initSplits(text, opts)

text - the text to render

opts - Object that can include:

  • font: Integer - Fontsize

  • fill: color

  • splitSize: Float - How big the splits are.

  • gravity: Float - With how much force splits return to correct spot.

  • mass: Float - Heaviness of splits

  • angMass: Float - Angular heaviness of splits

  • mouseGravity: Float - Force of mouse

  • randomSpeed: Float - Randomizes how much dots are affected by mouse / gravity

  • randomSort: Boolean - sorts dots randomly (only noticeable if randomStart is true)

  • randomStart: Boolean - whether dots start at random point

  • continuousSpawn: Boolean - Whether all dots spawn at once or not

  • spawnSpeed: Integer - How many dots spawn per tick (only noticeable in connection with continuousSpawn)

funcanvasfonts's People

Contributors

bewelge avatar

Watchers

James Cloos avatar  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.