-
Notifications
You must be signed in to change notification settings - Fork 514
Open
Labels
Description
Uncaught Error: Only format 4 and 12 cmap tables are supported.
or
Uncaught TypeError: Cannot read property 'glyphIndexMap' of null
I suppose the first is an expected error.
Code here:
<html>
<head>
<meta charset="UTF-8">
<script src="lib/opentype.js"></script>
<script>
window.onload = function() {
opentype.load('fonts/font.ttf', function(err, font) {
if (err) {
alert('Font could not be loaded: ' + err);
} else {
var ctx = document.getElementById('canvas').getContext('2d');
var path = font.getPath('Hello, World!', 0, 100, 22);
path.draw(ctx);
}
});
}
</script>
</head>
<body>
<canvas id="canvas" style="width: 600px"></canvas>
</body>
</html>