Skip to content

allenm/ttf.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ttf.js

A JavaScript TrueType font engine for modern browsers and Node.js.

Demo

ttf.js Demo - Glyph List

ttf.js Demo - Glyph List

Development Status

work in progress...

Implementation status of TrueType Tables

sfnt header

sfnt versionImplemented
numTablesImplemented
searchRangeImplemented
entrySelectorImplemented
rangeShiftImplemented

Table Directory

Table DirectoryImplemented

Required Tables

cmapPart Implemented
glyfAlmost
headAlmost
hhea-
hmtx-
locaAlmost
maxpAlmost
name-
post-
OS/2-

Optional Tables

cvt-
EBDT-
EBLC-
EBSC-
fpgm-
gasp-
hdmx-
kern-
LTSH-
prep-
PCLT-
VDMX-
vhea-
vmtx-

API

  • ttf.cmap.getGlyphIndex(charactor)
    • Return glyph index array of the given charactor . The array's length equals to number of the font's cmap subtables.
    • The param charactor only accept a single charactor, if you use multiple charactors , only return the result of the first charactor.
    • This API is working in process , only support cmap format0 and part format4. You can try your font with this , if not support, contact me;

TrueType Specifications

About

A JavaScript TrueType font engine

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%