Git Product home page Git Product logo

pixi-sdf-text's Introduction

pixi-sdf-text

Signed distance fields text implementation for PixiJS

SDF is the most efficient way to draw text in WebGL. It uses special kind of raster atlases and GLSL shader to draw vector scalable text in a very performant way on GPU.

Demo

Installation

npm i pixi-sdf-text --save

Usage

var style = {
    fontSize: 24,
    fontWeight: 'bold',
    fill: 0x39FF14,
    align: 'left',
    wordWrapWidth: 400,
    lineHeight: 64,
    fontURL: 'assets/Lato-Regular-64.fnt',
    imageURL: 'assets/lato.png'
};

var sdfText = new PIXI.sdf.Text('Abc', style);
stage.addChild(sdfText);

How to generate font descriptors and SDF atlases?

Use this manual

Bugs

Feel free to submit issues to GitHub tracker

License

MIT: http://mit-license.org/

Copyright 2017 Denis Radin aka PixelsCommander

pixi-sdf-text's People

Contributors

ivanpopelyshev avatar maclay74 avatar pixelscommander avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pixi-sdf-text's Issues

pixi v5 support?

Right now this won't support PixiV5, no? What would be needed to make it work? I need v5 for other functionality...

How to use msdf fonts?

Just playing with you demo tried to change fonts in it. Did it in this way:

var style = {
        fontSize: 12,
        fontWeight: 'bold',
        fill: 0x39FF14,
        align: 'left',
        wordWrapWidth: 400,
        lineHeight: 64,
        fontURL: 'assets/Roboto-msdf.json',
        imageURL: 'assets/Roboto-msdf.png'
    };

    window.text = new PIXI.sdf.Text('This is a multiline SDF text', style);

And I got blurry text. So how to use this kind of fonts?
screenshot from 2017-03-31 19-49-45

Aliasing issue.

The Pixi demo doesn't look sharp. Setting antialias: true for the renderer has no effect.

sdftext

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.