Skip to content

dickclaus/text-filter-svg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status Dependency status

Text filter svg

Library to create photoshop like text effect in svg and embed them in HTML

For now library supports only GlowFilter, ShadowFilter, Stroke Also it supports LinearGradients, which can be applied to strokes. You can use hex colors or web name colors.

Usage:

    var glowFilter = new GlowFilter();
    var textFilterSVG = new TextFilterSVG();
    textFilterSVG.setSize(300, 150);
    textFilterSVG.setText("Text Filter SVG");
    textFilterSVG.setFontFamily("PT Sans");
    textFilterSVG.setFontSize(42);
    textFilterSVG.addFilter(glowFilter);
    var element = document.getElementsByClassName("text-container")[0];
    textFilterSVG.renderToElement(element);

To start dev server:

npm start

Then goto http://127.0.0.1:8080/

Library based on following documentation:

SVG W3C Specification

About

Create pretty text with filters in svg

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages