diff --git a/FiraCode.glyphs b/FiraCode.glyphs index 7748643..fa48010 100644 --- a/FiraCode.glyphs +++ b/FiraCode.glyphs @@ -1,15 +1,14 @@ { -.appVersion = "1286"; +.appVersion = "1330"; DisplayStrings = ( -"<-\012<--\012<---\012<----\012-\012--\012---\012----\012-----\012->\012-->\012--->\012---->\012<->\012<-->\012<--->\012[->\012[-->\012[--->\012", -">-\012>--\012>---\012>----\012-<\012--<\012---<\012----<\012>-<\012>--<\012>---<\012>----<\012>\012--->>\012---->>\012-<<\012--<<\012---<<\012----<<\012<<->>\012<<-->>\012<<--->>\012<<---->>\012>>-<<\012>>--<<\012>>---<<\012>>----<<\012>->>\012<-<<", -"|> ||> <|| <|\012|-\012|--\012|---\012|----\012-|\012--|\012---|\012----|\012||-\012||--\012||---\012||----\012-||\012--||\012---||\012----||\012|-| |--| |---| |----|\012||-|| ||--||\012||---||\012||----||\012|-> |-< |->> |-<< <-| >-| <<-| >>-|", -"->-\012-->--\012--->---\012---->----\012-<-\012--<--\012---<---\012----<----\012-|-\012--|--\012---|---\012----|----\012-||- ->>- -<<-\012->>- -->>--" +"/greater_start.arw ->-/greater_end.arw \012/greater_start.darw/equal_end.darw/greater_middle.darw/equal_end.darw/greater_end.darw \012>>->>-/space/greater_greater_end.arw \012/space/greater_greater_start.darw/equal_end.darw/space/greater_greater_middle.darw/equal_end.darw/space/greater_greater_end.darw \012<-<-<\012/less_start.darw/equal_end.darw/less_middle.darw/equal_end.darw/less_end.darw \012<<-<<-<<\012/space/less_less_start.darw/equal_end.darw/space/less_less_middle.darw/equal_end.darw/space/less_less_end.darw \012|-|-|\012/bar_start.darw/equal_end.darw/bar_middle.darw/equal_end.darw/bar_end.darw \012||-||-||\012/space/bar_bar_start.darw/equal_end.darw/space/bar_bar_middle.darw/equal_end.darw/space/bar_bar_end.darw", +"<============================================<<\012=====/space ====/space ===>>/space ====|/space ===||\012<====/space <===/space <==>>/space <===|/space <==||/space ==<==\012<<===/space <<==/space <<=>>/space <<==|/space <<=||/space =<<=\012>====/space >=====<===>/space >==>>/space >===|/space >==||/space ==>==\012>>===/space >>==>=<>==>/space >>=>>/space >>==|/space >>=||/space =>>=\012|====/space |===/space |==>>/space |===|/space |==||/space ==|==\012||===/space ||==/space ||=>>/space ||==|/space ||=||/space =||=\012|==<==<<==>>==>==|==||==|\012.=/space ..=/space :=/space ::=/space !=/space !==/space ?=/space #=/space \012=:=/space =!=/space =/space ==/space ===/space =//=>=/space <=/space ^=\012>==/space <||>\012", +"<---------------------<<\012-----/space ----/space --->>/space ----|/space ---||\012<----/space <---/space <-->>/space <---|/space <--||/space --<--\012<<---/space <<--/space <<->>/space <<--|/space <<-||/space -<<-\012>----/space >-----<--->/space >-->>/space >---|/space >--||/space -->--\012>>---/space >>-->-<>-->/space >>->>/space >>--|/space >>-||/space ->>-\012|----/space |---/space |-->>/space |---|/space |--||/space --|--\012||---/space ||--/space ||->>/space ||--|/space ||-||/space -||-\012|--<--<<-->>-->--|--||--|\012-/space --/space ---/space |>/space <|/space ||>/space <||/space ;; #346 <--> <---> |--| |---| @@ -130,10 +131,10 @@ (str " ignore sub [bracketleft less greater bar] hyphen' hyphen hyphen;\n" " ignore sub hyphen' hyphen hyphen [bracketright less greater bar];\n") - ;; #346 ||-|| + ;; #346 ||-|| ||=|| ["bar" "bar"] - (str " ignore sub hyphen bar' bar;\n" - " ignore sub bar' bar hyphen;\n") + (str " ignore sub [hyphen equal] bar' bar;\n" + " ignore sub bar' bar [hyphen equal];\n") }) @@ -252,7 +253,4 @@ (get counts 4) " quadruples, " (count ligas') " total" #_")")) - (glyphs/update-code font :features "calt" - #(str/replace % - #"### start of generated calt\n[^#]+\n### end of generated calt\n" - (str "### start of generated calt\n" calt "\n### end of generated calt\n"))))) + (glyphs/update-code font :features "calt" (constantly calt)))) diff --git a/clojure/fira_code/features.clj b/clojure/fira_code/features.clj new file mode 100644 index 0000000..497a75a --- /dev/null +++ b/clojure/fira_code/features.clj @@ -0,0 +1,16 @@ +(ns fira-code.features + (:require + [clojure.java.io :as io] + [clojure.string :as str] + [fira-code.glyphs :as glyphs])) + + +(defn append-features [font] + (let [features (->> (file-seq (io/file "features")) + (filter #(str/ends-with? (.getName %) ".fea")) + (sort-by #(.getName %)) + (map slurp) + (map str/trim) + (str/join "\n\n"))] + (glyphs/update-code font :features "calt" + #(str % "\n\n" features)))) \ No newline at end of file diff --git a/clojure/fira_code/main.clj b/clojure/fira_code/main.clj index 978d232..ac905c6 100644 --- a/clojure/fira_code/main.clj +++ b/clojure/fira_code/main.clj @@ -4,6 +4,7 @@ [fira-code.calt :as calt] [fira-code.coll :as coll] [fira-code.checks :as checks] + [fira-code.features :as features] [fira-code.glyphs :as glyphs] [fira-code.not-space :as not-space] [fira-code.spacers :as spacers] @@ -22,6 +23,7 @@ (str/split liga #"_")) ;; [ ["dash" "greater" "greater"] ... ] font' (-> font (calt/replace-calt ligas) + (features/append-features) (spacers/add-spacers ligas) (not-space/regen-not-space) (checks/widths))] diff --git a/features/arrows.fea b/features/arrows.fea new file mode 100644 index 0000000..d0f59ed --- /dev/null +++ b/features/arrows.fea @@ -0,0 +1,96 @@ +### Arbitrary-length arrows #346 + +lookup arrows { + # continue hyphen + sub [less_start.arw less_less_start.arw less_middle.arw less_less_middle.arw greater_start.arw greater_greater_start.arw greater_middle.arw greater_greater_middle.arw bar_start.arw bar_bar_start.arw bar_middle.arw bar_bar_middle.arw hyphen_start.arw hyphen_end.arw] hyphen' by hyphen_end.arw; + + # double middles + sub [hyphen_start.arw hyphen_end.arw] less.spacer less' hyphen by less_less_middle.arw; + sub [hyphen_start.arw hyphen_end.arw] less' less hyphen by less.spacer; + sub [hyphen_start.arw hyphen_end.arw] greater.spacer greater' hyphen by greater_greater_middle.arw; + sub [hyphen_start.arw hyphen_end.arw] greater' greater hyphen by greater.spacer; + sub [hyphen_start.arw hyphen_end.arw] bar.spacer bar' hyphen by bar_bar_middle.arw; + sub [hyphen_start.arw hyphen_end.arw] bar' bar hyphen by bar.spacer; + + # single middles + sub [hyphen_start.arw hyphen_end.arw] less' hyphen by less_middle.arw; + sub [hyphen_start.arw hyphen_end.arw] greater' hyphen by greater_middle.arw; + sub [hyphen_start.arw hyphen_end.arw] bar' hyphen by bar_middle.arw; + + # double ends + sub [hyphen_start.arw hyphen_end.arw] less.spacer less' by less_less_end.arw; + sub [hyphen_start.arw hyphen_end.arw] less' less by less.spacer; + sub [hyphen_start.arw hyphen_end.arw] greater.spacer greater' by greater_greater_end.arw; + sub [hyphen_start.arw hyphen_end.arw] greater' greater by greater.spacer; + sub [hyphen_start.arw hyphen_end.arw] bar.spacer bar' by bar_bar_end.arw; + sub [hyphen_start.arw hyphen_end.arw] bar' bar by bar.spacer; + + # single ends + sub [hyphen_start.arw hyphen_end.arw] less' by less_end.arw; + sub [hyphen_start.arw hyphen_end.arw] greater' by greater_end.arw; + sub [hyphen_start.arw hyphen_end.arw] bar' by bar_end.arw; + + # double beginnings + sub less.spacer less' hyphen by less_less_start.arw; + sub less' less hyphen by less.spacer; + sub greater.spacer greater' hyphen by greater_greater_start.arw; + sub greater' greater hyphen by greater.spacer; + sub bar.spacer bar' hyphen by bar_bar_start.arw; + sub bar' bar hyphen by bar.spacer; + + # single beginnings + sub less' hyphen by less_start.arw; + sub greater' hyphen by greater_start.arw; + sub bar' hyphen by bar_start.arw; + sub hyphen' [hyphen less greater bar] by hyphen_start.arw; +} arrows; + +lookup double_arrows { + # Disable >=< #548 + # ignore sub greater' equal less; + # ignore sub greater equal' less; + # ignore sub greater equal less'; + + # continue hyphen + sub [less_start.darw less_less_start.darw less_middle.darw less_less_middle.darw greater_start.darw greater_greater_start.darw greater_middle.darw greater_greater_middle.darw bar_start.darw bar_bar_start.darw bar_middle.darw bar_bar_middle.darw equal_start.darw equal_end.darw] equal' by equal_end.darw; + + # double middles + sub [equal_start.darw equal_end.darw] less.spacer less' equal by less_less_middle.darw; + sub [equal_start.darw equal_end.darw] less' less equal by less.spacer; + sub [equal_start.darw equal_end.darw] greater.spacer greater' equal by greater_greater_middle.darw; + sub [equal_start.darw equal_end.darw] greater' greater equal by greater.spacer; + sub [equal_start.darw equal_end.darw] bar.spacer bar' equal by bar_bar_middle.darw; + sub [equal_start.darw equal_end.darw] bar' bar equal by bar.spacer; + + # single middles + sub [equal_start.darw equal_end.darw] less' equal by less_middle.darw; + sub [equal_start.darw equal_end.darw] greater' equal by greater_middle.darw; + sub [equal_start.darw equal_end.darw] bar' equal by bar_middle.darw; + + # double ends + sub [equal_start.darw equal_end.darw] less.spacer less' by less_less_end.darw; + sub [equal_start.darw equal_end.darw] less' less by less.spacer; + sub [equal_start.darw equal_end.darw] greater.spacer greater' by greater_greater_end.darw; + sub [equal_start.darw equal_end.darw] greater' greater by greater.spacer; + sub [equal_start.darw equal_end.darw] bar.spacer bar' by bar_bar_end.darw; + sub [equal_start.darw equal_end.darw] bar' bar by bar.spacer; + + # single ends + sub [equal_start.darw equal_end.darw] less' by less_end.darw; + sub [equal_start.darw equal_end.darw] greater' by greater_end.darw; + sub [equal_start.darw equal_end.darw] bar' by bar_end.darw; + + # double beginnings + sub less.spacer less' equal by less_less_start.darw; + sub less' less equal by less.spacer; + sub greater.spacer greater' equal by greater_greater_start.darw; + sub greater' greater equal by greater.spacer; + sub bar.spacer bar' equal by bar_bar_start.darw; + sub bar' bar equal by bar.spacer; + + # single beginnings + sub less' equal by less_start.darw; + sub greater' equal by greater_start.darw; + sub bar' equal by bar_start.darw; + sub equal' [equal less greater bar] by equal_start.darw; +} double_arrows; diff --git a/features/case.fea b/features/case.fea new file mode 100644 index 0000000..e3d8f7c --- /dev/null +++ b/features/case.fea @@ -0,0 +1,31 @@ +### Lowercase/uppercase operators + +lookup lowercase_hyphen { + ignore sub @Tall \hyphen' @Lowercase; + ignore sub @Lowercase \hyphen' @Tall; + sub \hyphen' @Lowercase by \hyphen.lc; + sub @Lowercase \hyphen' by \hyphen.lc; +} lowercase_hyphen; + +lookup lowercase_plus { + ignore sub @Tall \plus' @Lowercase; + ignore sub @Lowercase \plus' @Tall; + sub \plus' @Lowercase by \plus.lc; + sub @Lowercase \plus' by \plus.lc; +} lowercase_plus; + +lookup lowercase_asterisk { + ignore sub @Tall \asterisk' @Lowercase; + ignore sub @Lowercase \asterisk' @Tall; + sub \asterisk' @Lowercase by \asterisk.lc; + sub @Lowercase \asterisk' by \asterisk.lc; +} lowercase_asterisk; + +lookup uppercase_colon { + ignore sub @Tall \colon' @Lowercase; + ignore sub @Lowercase \colon' @Tall; + sub @Tall \colon' by \colon.uc; + sub \colon' @Tall by \colon.uc; +# pos @Tall \colon' <0 160 0 0>; +# pos \colon' @Tall <0 160 0 0>; +} uppercase_colon; diff --git a/features/conj_disj.fea b/features/conj_disj.fea new file mode 100644 index 0000000..0e11569 --- /dev/null +++ b/features/conj_disj.fea @@ -0,0 +1,15 @@ +### Logical conjuntion/disjunction #738 + +lookup slash_backslash { + ignore sub @NotSpace slash' backslash; + ignore sub slash' backslash @NotSpace; + sub slash.spacer backslash' by slash_backslash.liga; + sub slash' backslash by slash.spacer; +} slash_backslash; + +lookup backslash_slash { + ignore sub @NotSpace backslash' slash; + ignore sub backslash' slash @NotSpace; + sub backslash.spacer slash' by backslash_slash.liga; + sub backslash' slash by backslash.spacer; +} backslash_slash; diff --git a/features/cross.fea b/features/cross.fea new file mode 100644 index 0000000..507e161 --- /dev/null +++ b/features/cross.fea @@ -0,0 +1,7 @@ +### 0xFF +sub [zero zero.zero] x' [@Digit @HexDigit] by x.multiply; +sub [zero.tosf zero.zero.tosf zero.tosf.zero] x' [@DigitTosf @HexDigit] by x.multiply.tosf; + +### 800x600 +sub @Digit x' @Digit by x.multiply; +sub @DigitTosf x' @DigitTosf by x.multiply.tosf; diff --git a/features/fi_fl.fea b/features/fi_fl.fea new file mode 100644 index 0000000..8325695 --- /dev/null +++ b/features/fi_fl.fea @@ -0,0 +1,4 @@ +### fi/fl #795 + +sub [f i.salt_low j.salt_low] [i j]' by [i.salt_low j.salt_low]; +sub [F T I l.salt_low] l' by l.salt_low; diff --git a/features/greek.fea b/features/greek.fea new file mode 100644 index 0000000..d6ed127 --- /dev/null +++ b/features/greek.fea @@ -0,0 +1,13 @@ +### Greek + +lookup caltGreekUCdiph { + sub @GreekUCdiphIOTA Iota' by Iotadieresis; + sub @GreekUCdiphUPSILON Upsilon' by Upsilondieresis; +} caltGreekUCdiph; + +lookup caltGreekUC { + sub @GreekUCAcc' @GreekUC by @GreekUCcalt; + sub @GreekUC @GreekUCAcc' by @GreekUCcalt; + sub @GreekUCAcc' space @GreekUC by @GreekUCcalt; + sub @GreekUC space @GreekUCAcc' by @GreekUCcalt; +} caltGreekUC; diff --git a/features/less_tilde_greater.fea b/features/less_tilde_greater.fea new file mode 100644 index 0000000..05c7687 --- /dev/null +++ b/features/less_tilde_greater.fea @@ -0,0 +1 @@ +sub less asciitilde' greater by asciitilde_asciitilde.liga; diff --git a/showcases/v3/showcases.txt b/showcases/v3/showcases.txt index 3f7c287..398c3c8 100644 --- a/showcases/v3/showcases.txt +++ b/showcases/v3/showcases.txt @@ -89,3 +89,30 @@ r 0 123456789 & && $ <$ <$> $> @ <= >= ⎜ 3 ⎟ ⎢ c ⎥ ⎨ z ⎬ ⎜ 4 ⎟ ⎢ d ⎥ ⎪ y ⎪ ⎝ 5 ⎠ ⎣ e ⎦ ⎩ x ⎭ + + +# Arbitrary-length arrows #346 + +<--------------------------------------------<< +----- ----< ---<< ----> --->> ----| ---|| +<---- <---< <--<< <---> <-->> <---| <--|| --<-- +<<--- <<--< <<-<< <<--> <<->> <<--| <<-|| -<<- +>---- >---< >--<< >---> >-->> >---| >--|| -->-- +>>--- >>--< >>-<< >>--> >>->> >>--| >>-|| ->>- +|---- |---< |--<< |---> |-->> |---| |--|| --|-- +||--- ||--< ||-<< ||--> ||->> ||--| ||-|| -||- +|--<--<<-->>-->--|--||--| +- -- --- |> <| ||> <||