opentype.js
                                
                                 opentype.js copied to clipboard
                                
                                    opentype.js copied to clipboard
                            
                            
                            
                        The example even not work,
var notdefGlyph = new opentype.Glyph({
    name: '.notdef',
    unicode: 0,
    advanceWidth: 650,
    path: new opentype.Path()
});
var aPath = new opentype.Path();
aPath.moveTo(100, 0);
aPath.lineTo(100, 700);
// more drawing instructions...
var aGlyph = new opentype.Glyph({
    name: 'A',
    unicode: 65,
    advanceWidth: 650,
    path: aPath
});
var glyphs = [notdefGlyph, aGlyph];
// Log out `A` path, which result NaN
console.log(aGlyph.getPath());
var font = new opentype.Font({
    familyName: 'OpenTypeSans',
    styleName: 'Medium',
    unitsPerEm: 1000,
    ascender: 800,
    descender: -200,
    glyphs: glyphs
    });
font.download();
And the A glyph's path are all NaN
Output
[Log] Path (index.html, line 28)
commands: [{type: "M", x: NaN, y: NaN}, {type: "L", x: NaN, y: NaN}] (2)
fill: "black"
stroke: null
strokeWidth: 1
Path Prototype
What am I doing wrong?
Hi!
Are you using the latest version on npm or the master branch maybe? In the browser or with Node.js (Which version?)
Also if you could join a full example as a gist it would help ;-)
@Jolg42 Sorry for the long waiting, I am busy these few days.
I make a repo which is very simple demo for showing this issue, please have a check.
Open the html, and check the console.
You are not loading any font.
Closing this stale issue.