Fix broken cup (`∪`) and cap (`∩`) symbol Fix Fix broken degree-C and degree-F ligature. Closes #449, #450.
25 lines
938 B
Text
25 lines
938 B
Text
import [add-common-feature add-feature add-lookup] from "./table-util"
|
|
|
|
# Name-driven feature pairs
|
|
export : define [buildPairFeature sink tag1 tag2 glyphs glyphList] : begin
|
|
local mapTag2 {.}
|
|
local mapTag1 {.}
|
|
define reHidden : regex "^\\."
|
|
define reTag1 : new RegExp ("\\." + tag1 + "$")
|
|
foreach [glyph : items-of glyphList] : begin
|
|
if ([reTag1.test glyph.name] && ![reHidden.test glyph.name]) : do
|
|
local gnTag2 : glyph.name.replace reTag1 ('.' + tag2)
|
|
if (glyphs.(gnTag2)) : begin
|
|
set mapTag2.(glyph.name) gnTag2
|
|
set mapTag1.(gnTag2) glyph.name
|
|
|
|
define lookup1 : add-lookup sink {.type 'gsub_single' .subtables {mapTag1}}
|
|
define lookup2 : add-lookup sink {.type 'gsub_single' .subtables {mapTag2}}
|
|
|
|
define feature1 : add-feature sink tag1
|
|
feature1.lookups.push lookup1
|
|
define feature2 : add-feature sink tag2
|
|
feature2.lookups.push lookup2
|
|
|
|
add-common-feature sink feature1
|
|
add-common-feature sink feature2
|