Skip to content

remembercode/text2canvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

text2svg

convert text by sepcific windows font file(*.ttf) to canvas

##depences text2svg

##beta version

Give up text2svg option param. Always convet text to font size 72px.

Support Simple Chinese Fonts by Inziu Iosevka, inziu-iosevkaCC-SC-regular.ttf

return promise

return a promise object contains a canvas object

for nw.js only

how to use

        var fonts = 'fonts/inziu-iosevkaCC-SC-regular.ttf';
        fonts = path.normalize(fonts);
        fonts = path.join(nw.__dirname, fonts);
        //var text = "1ºÅ´°¿Ú";
        var text = "No1.Window";
        var png = Promise.resolve(require('text2canvas')).then(function (converter) {
            return converter(fonts, text);
        }, function (error) {
            return Promise.reject(error);
        })

About

convert text by .ttf fonts to canvas

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published