[hb-view] Rewrite --features parsing, with range support
authorBehdad Esfahbod <behdad@behdad.org>
Mon, 4 Apr 2011 18:50:09 +0000 (14:50 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 4 Apr 2011 18:50:09 +0000 (14:50 -0400)
commitfb9ca1bfabde7da0c274e7a1bd12bffaf7949c18
treed37b8158a6075b57e3a7a44862d87961f2a3bfaa
parentccc6745afaa68ce7497a6cd02ce85986d3c863d0
[hb-view] Rewrite --features parsing, with range support

The --features parsing handles errors now.  More importantly, it
allos limiting individual features to specific byte ranges.  The
format is Python-esque.  Here is how it all works:

  Syntax: Value: Start: End:

Setting value:
  "kern" 1 0 ∞ # Turn feature on
  "+kern" 1 0 ∞ # Turn feature off
  "-kern" 0 0 ∞ # Turn feature off
  "kern=0" 0 0 ∞ # Turn feature off
  "kern=1" 1 0 ∞ # Turn feature on
  "kern=2" 2 0 ∞ # Choose 2nd alternate

Setting index:
  "kern[]" 1 0 ∞ # Turn feature on
  "kern[:]" 1 0 ∞ # Turn feature on
  "kern[5:]" 1 5 ∞ # Turn feature on, partial
  "kern[:5]" 1 0 5 # Turn feature on, partial
  "kern[3:5]" 1 3 5 # Turn feature on, range
  "kern[3]" 1 3 3+1 # Turn feature on, single char

Mixing it all:

  "kern[3:5]=0" 1 3 5 # Turn feature off for range
src/hb-view.c