all files / fontkit/playground/ morx.coffee

0% Statements 0/10
100% Branches 0/0
0% Functions 0/1
0% Lines 0/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                                                     
fontkit = require '../'
fs = require 'fs'
 
# font = fontkit.openSync '/System/Library/Fonts/Apple Color Emoji.ttf'
# font = fontkit.openSync '/Library/Fonts/Zapfino.ttf'
# font = fontkit.openSync '/Library/Fonts/Hoefler Text.ttc', 'HoeflerText-Regular'
font = fontkit.openSync '/Library/Fonts/Skia.ttf' # format 3 kern subtables
# font = fontkit.openSync '/System/Library/Fonts/AppleSDGothicNeo-Regular.otf' # kerx
# font = fontkit.openSync '/Library/Fonts/DevanagariMT.ttf' # indic reordering
# font = fontkit.openSync '/System/Library/Fonts/Geeza Pro.ttf'
# font = fontkit.openSync '/Library/Fonts/Papyrus.ttc', 'Papyrus'
console.log require('util').inspect font.directory, colors: true, depth: 50
 
# glyphs = font.glyphsForString '๐Ÿ˜œ๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ‘'
glyphs = font.glyphsForString 'ffi 1โ„2'
# glyphs = font.glyphsForString 'เคชเคฟ' # indic reordering
# glyphs = font.glyphsForString 'ู…ุญุจุงุ—'
console.log glyphs.map (g) -> g.id
# console.log font.availableFeatures
 
glyphs = font.glyphsForString 'Twitter'
console.log font.advancesForGlyphs glyphs
console.log font.advancesForGlyphs glyphs, ['kern']
 
# glyph = font.getGlyph 191
# fs.writeFileSync 'out.png', glyph.getImageForSize 512