all files / fontkit/src/opentype/shapers/ index.coffee

100% Statements 9/9
100% Branches 2/2
100% Functions 1/1
100% Lines 8/8
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                               19× 19×    
DefaultShaper = require './DefaultShaper'
ArabicShaper = require './ArabicShaper'
HangulShaper = require './HangulShaper'
 
SHAPERS =
  arab: ArabicShaper    # Arabic
  mong: ArabicShaper    # Mongolian
  syrc: ArabicShaper    # Syriac
  'nko ': ArabicShaper  # N'Ko
  phag: ArabicShaper    # Phags Pa
  mand: ArabicShaper    # Mandaic
  mani: ArabicShaper    # Manichaean
  phlp: ArabicShaper    # Psalter Pahlavi
  
  hang: HangulShaper    # Hangul
  
  latn: DefaultShaper   # Latin
  DFLT: DefaultShaper   # Default
 
exports.choose = (script) ->
  shaper = SHAPERS[script]
  return shaper if shaper
  
  return DefaultShaper