Version 1.100
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*.zip
|
||||
Fira Code_liga.glyphs
|
514
FiraCode.glyphs
10
README.md
|
@ -2,7 +2,7 @@
|
|||
|
||||
<img src="https://dl.dropboxusercontent.com/u/561580/imgs/fira_code_logo.svg">
|
||||
|
||||
#### [Download Fira Code v1.000](https://github.com/tonsky/FiraCode/releases/download/1.000/FiraCode_1.000.zip)
|
||||
#### [Download Fira Code v1.100](https://github.com/tonsky/FiraCode/releases/download/1.100/FiraCode_1.100.zip)
|
||||
|
||||
### Problem
|
||||
|
||||
|
@ -96,6 +96,12 @@ Thanks Georg Seifert for providing a [Glyphs 2](https://glyphsapp.com) license.
|
|||
|
||||
### Changelog
|
||||
|
||||
#### 1.100
|
||||
|
||||
- Fixed calt table conflicts (`----` would incorrectly render as `<!--`)
|
||||
- Added centered `:` (between digits, e.g. `10:40`)
|
||||
- Added lowercase-aligned `-`, `*` and `+` (only between lowercase letters, e.g. kebab case `var-name`, pointers `*ptr` etc)
|
||||
|
||||
|
||||
#### 1.000
|
||||
|
||||
|
@ -114,7 +120,7 @@ Added:
|
|||
`<->` `<~~` `<~` `~~~` `~>` `~~>`
|
||||
`<$` `<+` `<*` `*>` `+>` `$>`
|
||||
`;;;` `:::` `!!!` `???` `%%` `%%%` `##` `###` `####`
|
||||
`.-` `#_(` `=<` `**/` `0x` `www` `[]`
|
||||
`.-` `#_(` `=<` `**/` `0x` `www` `[]`
|
||||
|
||||
Redrawn:
|
||||
|
||||
|
|
34
gen_calt.clj
|
@ -51,6 +51,23 @@
|
|||
[ a b c d] CR})))
|
||||
|
||||
|
||||
(defn any? [p & colls]
|
||||
(if colls
|
||||
(let [[coll & cs] colls]
|
||||
(some #(apply any? (partial p %) cs) coll))
|
||||
(p)))
|
||||
|
||||
|
||||
(defn conflicts? [r1 r2]
|
||||
(when (.startsWith (first r2) "CR.") ;; we accept that higher-len ligatures can override lower-length
|
||||
;; but once replacement has started (first glyph in rule is CR.*)
|
||||
;; there should be no possibility for conflits
|
||||
(let [l1 (count r1)
|
||||
l2 (count r2)
|
||||
prefix1 (subvec r1 0 l2)]
|
||||
(= r2 prefix1))))
|
||||
|
||||
|
||||
(def all-rules
|
||||
(reduce
|
||||
(fn [generated liga]
|
||||
|
@ -59,12 +76,13 @@
|
|||
;; with any of previous rules
|
||||
(some (fn [i]
|
||||
(let [CR (str "CR." (String/format "%02d" (to-array [i])))
|
||||
rs (liga->rules liga CR)]
|
||||
(when-not (some generated (keys rs))
|
||||
rs (liga->rules liga CR)]
|
||||
; (println (keys generated) (keys rs))
|
||||
(when-not (any? conflicts? (keys generated) (keys rs))
|
||||
rs)))
|
||||
(range))))
|
||||
{}
|
||||
ligas))
|
||||
(->> ligas (sort-by count) reverse)))
|
||||
|
||||
|
||||
(defn priority-fn [[from to]]
|
||||
|
@ -76,16 +94,8 @@
|
|||
(into from (repeat (- 4 (count from)) "z"))])
|
||||
|
||||
|
||||
(defn replace-keys [replacements coll]
|
||||
(reduce (fn [result [k v]]
|
||||
(conj result [(or (replacements k) k) v]))
|
||||
(empty coll) coll))
|
||||
|
||||
|
||||
(def table (->> all-rules
|
||||
(sort-by priority-fn)
|
||||
vec
|
||||
(replace-keys {["zero" "x"] ["zero" "x" "@HexDigit"]})))
|
||||
(sort-by priority-fn)))
|
||||
|
||||
|
||||
(defn rule->str [[from to]]
|
||||
|
|
Before Width: | Height: | Size: 213 KiB After Width: | Height: | Size: 229 KiB |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 77 KiB |
|
@ -15,15 +15,17 @@
|
|||
|
||||
\\ \\\ {- -} // ///
|
||||
/* /** **/ */
|
||||
</ <!-- --> />
|
||||
0xF www []
|
||||
</ <!-- www --> />
|
||||
0xF 9:45 m-x *ptr
|
||||
|
||||
;; ;;; :: ::: !! !!!
|
||||
?? ??? %% %%% && &&&
|
||||
|| ||| .. ... ..<
|
||||
|| ||| .. ... ..< []
|
||||
-- --- ++ +++ ** ***
|
||||
|
||||
~= ~- -~ =~ ~@
|
||||
^= ?= /= /== |= ||=
|
||||
## ### ####
|
||||
#{ #[ #( #? #_ #_(
|
||||
#{ #[ #( #? #_ #_(
|
||||
|
||||
|
||||
|
|