Recently Written · git

recentlywritten

my writings (done recently)

git clone https://github.com/equwal/recentlywritten

Log | Files | Refs


git/alt-hack0/commit/2ef7da977eec04f4c9dab41074d8b26a18235564.html (9774 bytes)

1 <!DOCTYPE html>
2 <html lang="en"><head><meta charset="UTF-8" />
3 <meta name="viewport" content="width=device-width, initial-scale=1" />
4 <title>alt-hack0 2ef7da97 - Recently Written</title>
5 <link rel="stylesheet" href="../../stagit.css" />
6 </head><body>
7 <div id="top"><a href="../../../index.html">Recently Written</a> &middot; <a href="../../index.html">git</a></div>
8 <h1>alt-hack0</h1><span class="desc">The Hack font family with a non-weird zero, and other variants.</span><p class="url">git clone https://github.com/equwal/alt-hack0</p><p><a href="../../alt-hack0/index.html">Log</a> | <a href="../../alt-hack0/files.html">Files</a> | <a href="../../alt-hack0/refs.html">Refs</a></p><hr/>
9 <div id="content">
10 <pre>commit 2ef7da977eec04f4c9dab41074d8b26a18235564
11 Spenser Truex &lt;web@spensertruex.com&gt;
12 2019-11-18 17:08:17 -0800
13 
14 Roswell (not working yet) script and symlinks.
15 
16 </pre><pre> generator.ros | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
17  glyphs        |   1 +
18  hack          |   1 +
19  source        |   1 +
20  tt-hinting    |   1 +
21  5 files changed, 121 insertions(+)
22 </pre><pre>diff --git a/generator.ros b/generator.ros
23 new file mode 100755
24 index 0000000..deb203c
25 --- /dev/null
26 +++ b/generator.ros
27 <span class="h">@@ -0,0 +1,117 @@</span>
28 <span class="a">+#!/bin/sh</span>
29 <span class="a">+#|-*- mode:lisp -*-|#</span>
30 <span class="a">+#|</span>
31 <span class="a">+exec ros -Q -- $0 &quot;$@&quot;</span>
32 <span class="a">+|#</span>
33 <span class="a">+(progn ;;init forms</span>
34 <span class="a">+  (ros:ensure-asdf)</span>
35 <span class="a">+  #+quicklisp(ql:quickload &#x27;(:alexandria :str :uiop) :silent t)</span>
36 <span class="a">+  (asdf:load-system :utils) ;My utilities, has the COLLECT macro.</span>
37 <span class="a">+  )</span>
38 <span class="a">+</span>
39 <span class="a">+(defpackage :ros.script.generator.3783095582</span>
40 <span class="a">+  (:use :cl :alexandria)</span>
41 <span class="a">+  (:import-from :str :concat)</span>
42 <span class="a">+  (:import-from :utils :collect :group)</span>
43 <span class="a">+  (:import-from</span>
44 <span class="a">+   :uiop</span>
45 <span class="a">+   :directory-files</span>
46 <span class="a">+   :subdirectories</span>
47 <span class="a">+   :launch-program))</span>
48 <span class="a">+(in-package :ros.script.generator.3783095582)</span>
49 <span class="a">+;;; Uses a magic symlinks to deal with directories. Make sure they exist in your</span>
50 <span class="a">+;;; toplevel:</span>
51 <span class="a">+;;; - tt-hinting (in hack/post_processing)</span>
52 <span class="a">+;;; - glyphs (in alt-hack)</span>
53 <span class="a">+;;; - source (in hack)</span>
54 <span class="a">+;;; - hack</span>
55 <span class="a">+(defvar *weights* &#x27;(&quot;Bold&quot; &quot;BoldItalic&quot; &quot;Italic&quot; &quot;Regular&quot;))</span>
56 <span class="a">+</span>
57 <span class="a">+(defun canonicalize-groups (groups)</span>
58 <span class="a">+  (loop for g in groups</span>
59 <span class="a">+        collect (mapcar #&#x27;car (group g 2))))</span>
60 <span class="a">+(defvar *groups* (canonicalize-groups</span>
61 <span class="a">+                  &#x27;((&quot;u0028-curved&quot; &quot;(&quot;</span>
62 <span class="a">+                     &quot;u0028-rounder&quot; &quot;(&quot;</span>
63 <span class="a">+                     &quot;u0029-curved&quot; &quot;)&quot;</span>
64 <span class="a">+                     &quot;u0029-rounder&quot; &quot;)&quot;)</span>
65 <span class="a">+                    (&quot;u0030-backslash&quot; &quot;0&quot;</span>
66 <span class="a">+                     &quot;u0030-diamond&quot; &quot;0&quot;</span>
67 <span class="a">+                     &quot;u0030-dotted&quot; &quot;0&quot;</span>
68 <span class="a">+                     &quot;u0030-forwardslash&quot; &quot;0&quot;)</span>
69 <span class="a">+                    (&quot;u0031-noslab&quot; &quot;1&quot;)</span>
70 <span class="a">+                    (&quot;u0033-flattop&quot; &quot;3&quot;)</span>
71 <span class="a">+                    (&quot;u003C-wider&quot; &quot;&lt;&quot;)</span>
72 <span class="a">+                    (&quot;u003E-wider&quot; &quot;&gt;&quot;)</span>
73 <span class="a">+                    (&quot;u0066-knife&quot; &quot;f&quot;)</span>
74 <span class="a">+                    (&quot;u0069-slab&quot; &quot;i&quot;</span>
75 <span class="a">+                     &quot;u00EC-slab&quot; &quot;ì&quot;</span>
76 <span class="a">+                     &quot;u00ED-slab&quot; &quot;í&quot;</span>
77 <span class="a">+                     &quot;u00EE-slab&quot; &quot;î&quot;</span>
78 <span class="a">+                     &quot;u00EF-slab&quot; &quot;ï&quot;</span>
79 <span class="a">+                     &quot;u0129-slab&quot; &quot;ĩ&quot;</span>
80 <span class="a">+                     &quot;u012B-slab&quot; &quot;ī&quot;</span>
81 <span class="a">+                     &quot;u012D-slab&quot; &quot;ĭ&quot;</span>
82 <span class="a">+                     &quot;u012F-slab&quot; &quot;į&quot;</span>
83 <span class="a">+                     &quot;u0131-slab&quot; &quot;ı&quot;</span>
84 <span class="a">+                     &quot;u0456-slab&quot; &quot;і&quot;</span>
85 <span class="a">+                     &quot;u0457-slab&quot; &quot;ї&quot;)))</span>
86 <span class="a">+  &quot;Things you actually want to permute together.&quot;)</span>
87 <span class="a">+</span>
88 <span class="a">+(defun pprint-letters (letter-alist)</span>
89 <span class="a">+  (dolist (p letter-alist)</span>
90 <span class="a">+    (format t &quot;~S ~S~%&quot;</span>
91 <span class="a">+            (car p) (string (cdr p)))))</span>
92 <span class="a">+</span>
93 <span class="a">+(defun show-characters ()</span>
94 <span class="a">+  (let ((dirs (subdirectories &quot;glyphs&quot;)))</span>
95 <span class="a">+    (pprint-letters</span>
96 <span class="a">+     (collect (d dirs)</span>
97 <span class="a">+       (let ((mat (car (last (pathname-directory d)))))</span>
98 <span class="a">+         (cons mat</span>
99 <span class="a">+               (code-char (read (make-string-input-stream</span>
100 <span class="a">+                                 (concat &quot;#x&quot;</span>
101 <span class="a">+                                         (subseq mat 1 (search &quot;-&quot; mat))))))))))))</span>
102 <span class="a">+</span>
103 <span class="a">+(defun help ()</span>
104 <span class="a">+  (format t &quot;~@{~A~%~}&quot;</span>
105 <span class="a">+          &quot;generator.ros {ALT-GLYPH-DIRNAME+ | show}&quot;</span>
106 <span class="a">+          &quot;`show&#x27; demonstrates each variant code with its character.&quot;</span>
107 <span class="a">+          &quot;ALT-GLYPH-DIRNAME is something like u0028-curved&quot;</span>
108 <span class="a">+          &quot;Each glyph is put into the hack directory.&quot;))</span>
109 <span class="a">+(defun remove-hints ()</span>
110 <span class="a">+  (let ((files (uiop:directory-files #P&quot;tt-hinting&quot;)))</span>
111 <span class="a">+    (dolist (f files)</span>
112 <span class="a">+      (with-open-file (s f :direction :io)</span>
113 <span class="a">+        (let ((line (read-line s nil nil)))</span>
114 <span class="a">+          (when (and line (char/= #\#(elt line 0)))</span>
115 <span class="a">+            (write-line (format nil &quot;# ~S~%&quot; line) s)))))))</span>
116 <span class="a">+</span>
117 <span class="a">+(defun put-glyphs (ufolders)</span>
118 <span class="a">+  (dolist (arg ufolders)</span>
119 <span class="a">+    (dolist (weight *weights*)</span>
120 <span class="a">+      (launch-program (concat &quot;cp &quot; &quot;glyphs/&quot; arg &quot;/&quot;</span>
121 <span class="a">+                              (string-downcase weight)</span>
122 <span class="a">+                              &quot;/*&quot; &quot; &quot; &quot;source/Hack-&quot; weight</span>
123 <span class="a">+                              &quot;.ufo/glyphs/&quot;)))))</span>
124 <span class="a">+(defun build (permutation)</span>
125 <span class="a">+  (put-glyphs permutation)</span>
126 <span class="a">+  (launch-program &quot;make ttf &amp;&amp; make woff&quot;</span>
127 <span class="a">+                  :directory #P&quot;hack&quot;))</span>
128 <span class="a">+</span>
129 <span class="a">+(defun main (&amp;rest argv)</span>
130 <span class="a">+  (declare (ignorable argv))</span>
131 <span class="a">+  (cond ((null argv) (help)</span>
132 <span class="a">+         (sb-ext:exit :code 0))</span>
133 <span class="a">+        ((string-equal (first argv) &quot;show&quot;)</span>
134 <span class="a">+         (print (show-characters))</span>
135 <span class="a">+         (sb-ext:exit :code 0)))</span>
136 <span class="a">+  (progn (remove-hints)</span>
137 <span class="a">+         (map-permutations (compose #&#x27;build #&#x27;flatten) *groups*)))</span>
138 <span class="a">+</span>
139 <span class="a">+</span>
140 <span class="a">+</span>
141 <span class="a">+</span>
142 <span class="a">+</span>
143 <span class="a">+</span>
144 <span class="a">+;;; vim: set ft=lisp lisp:</span>
145 diff --git a/glyphs b/glyphs
146 new file mode 120000
147 index 0000000..b44b72b
148 --- /dev/null
149 +++ b/glyphs
150 <span class="h">@@ -0,0 +1 @@</span>
151 <span class="a">+/home/jose/src/github.com/source-foundry/alt-hack/glyphs/</span>
152 \ No newline at end of file
153 diff --git a/hack b/hack
154 new file mode 120000
155 index 0000000..535ab1c
156 --- /dev/null
157 +++ b/hack
158 <span class="h">@@ -0,0 +1 @@</span>
159 <span class="a">+/home/jose/src/github.com/source-foundry/hack</span>
160 \ No newline at end of file
161 diff --git a/source b/source
162 new file mode 120000
163 index 0000000..4df09a0
164 --- /dev/null
165 +++ b/source
166 <span class="h">@@ -0,0 +1 @@</span>
167 <span class="a">+/home/jose/src/github.com/source-foundry/hack/source/</span>
168 \ No newline at end of file
169 diff --git a/tt-hinting b/tt-hinting
170 new file mode 120000
171 index 0000000..3a4409a
172 --- /dev/null
173 +++ b/tt-hinting
174 <span class="h">@@ -0,0 +1 @@</span>
175 <span class="a">+/home/jose/src/github.com/source-foundry/hack/postbuild_processing/tt-hinting</span>
176 \ No newline at end of file</pre>
177 </div></body></html>