Radicals
1. Radicals?
In the Brutalist Gesture Notation system, the radical
is a 4x4 block of 1-bit pixels. It is considered the
core building block for things
like L-Glyphs and Diacritics. They are considered
a core building block for these components.
The name "radical" is a term borrowed from the Chinese writing system. Chinese characters, especially those in simplified chinese, are often made up of smaller parts called radicals.
2. Tangled File Output
Radicals are saved in a text file, to be parsed by utilities found in loadtiles.
<<radicals>>
3. Janet Macros
Assuming this is loaded into a 6x6 tilemap, this janet file provides names for each radical, as well as their location.
(def radicals @{
<<entries>>
})
(defn radicals-bp []
(def loadtiles-file (dofile "loadtiles/loadtiles.janet"))
(def gen-tilemap ((loadtiles-file 'gen-tilemap) :value))
(def tmap
(gen-tilemap "radicals/radicals.txt" 4 4 6 6))
(def canvas @[0 0 (* 48 6) (* 48 6)])
(def bp (btprnt/new (canvas 2) (canvas 3)))
(def zoom 2)
(def geneva9 (btprnt/macfont-load "fonts/geneva_9"))
(each k (keys radicals )
(def glyph (radicals k))
(def grid (btprnt/grid
bp canvas 6 6 (glyph 0) (glyph 1)))
(def text (string k))
(btprnt/macfont-textbox
bp geneva9
grid
(math/floor
(- (/ (grid 2) 2)
(/ (btprnt/macfont-linewidth geneva9 text) 2)))
(- (grid 3) 13) text 1)
(def center (btprnt/centerbox
bp
grid
(+ (* 4 zoom) 2)
(+ (* 4 zoom) 2)))
(btprnt/outline bp center 1)
(btprnt/tile
bp tmap
center
1 1
(glyph 0) (glyph 1)
4 4
zoom 1)
)
(btprnt/del tmap)
bp)
4. Radicals
4.1. Empty Space
It is a natural choice to set the initial tile to be an empty space.
----
----
----
----
:empty @[0 0]
4.2. Dot
The "dot" serves as a wonderful ornamentation. It is completely centered, and as a nice 2x2 size to it.
----
-##-
-##-
----
:dot @[1 0]
4.3. Block
A block is the opposite of empty space. It's completely filled. This can sometimes be useful for debugging. Otherwise, it probably should be avoided. This one tends to be too bulky.
####
####
####
####
:block @[2 0]
4.4. Box
A box outlines the area wit a 1 pixel border. It also happens to be the inverse of a dot.
####
#--#
#--#
####
:box @[3 0]
4.5. Tees
A "T" shape. These make for good end points.
4.5.1. Top/Bottom Tee
----
####
####
-##-
-##-
####
####
----
:ttee @[4 0]
:btee @[5 0]
4.5.2. Left/Right Tee
-##-
-###
-###
-##-
-##-
###-
###-
-##-
:ltee @[0 1]
:rtee @[1 1]
4.6. Stubs
Stubs are understated ways to end paths.
4.6.1. Top/Bottom Stub
----
-##-
-##-
-##-
-##-
-##-
-##-
----
:tstub @[2 1]
:bstub @[3 1]
4.6.2. Left/Right Stub
----
-###
-###
----
----
###-
###-
----
:lstub @[4 1]
:rstub @[5 1]
4.7. Stripes and Pipes
Stripes produce a center line, both vertically and horizontally.
-##-
-##-
-##-
-##-
----
####
####
----
:vstripe @[0 2]
:hstripe @[1 2]
Pipes are the inverse of stripes. They get their name because their edges make it look like a pipe.
#--#
#--#
#--#
#--#
####
----
----
####
:vpipe @[2 2]
:hpipe @[3 2]
4.8. Knees
Knees add a bend to a path. They particularly useful for L-Glyphs.
4.8.1. Top Knees
Top Left.
----
-###
-###
-##-
Top Right.
----
###-
###-
-##-
:tlknee @[4 2]
:trknee @[5 2]
4.8.2. Bottom Knees
Bottom Left.
-##-
-###
-###
----
Bottom Right.
-##-
###-
###-
----
:blknee @[0 3]
:brknee @[1 3]
4.9. Squiggles
Squiggles are S or Z shapes that can be connected together to from a suiqggly line. These are typically used for diacritics.
Squiggle 1:
-###
-###
###-
###-
Squiggle 2:
###-
###-
-###
-###
:squig1 @[2 3]
:squig2 @[3 3]
4.10. Brackets
These are another "capper" for paths.
4.10.1. Top/Bottom Bracket
Top Bracket.
----
####
#--#
#--#
Bottom Bracket.
----
#--#
#--#
####
:tbrack @[4 3]
:bbrack @[5 3]
4.10.2. Left/Right Bracket
Left Bracket.
-###
-#--
-#--
-###
Right Bracket.
-###
---#
---#
-###
:lbrack @[0 4]
:rbrack @[1 4]
4.11. Lines
Occasionally, one needs lines that are off to the side. But only occasionally.
4.11.1. Top/Bottom
Top Line.
####
####
----
----
Bottom Line.
----
----
####
####
:tline @[2 4]
:bline @[3 4]
4.11.2. Left/Right
Left Line.
##--
##--
##--
##--
Right Line.
--##
--##
--##
--##
:lline @[4 4]
:rline @[5 4]
5. Demo
Here's the tile map of all the diacritics. It would be very cool to turn this into an image map at some point.
(do
(def loadtiles-file (dofile "loadtiles/loadtiles.janet"))
(def gen-tilemap ((loadtiles-file 'gen-tilemap) :value))
(def rmap
(gen-tilemap "radicals/radicals.txt" 4 4 6 6))
(def bp (btprnt/new 256 256))
(def canvas @[0 0 256 256])
(def padding 2)
(def zoom 4)
(def sz (+ 5 (* 6 (+ (* 4 zoom) (* 2 padding)))))
(def main (btprnt/centerbox bp canvas sz sz))
(def border
(btprnt/centerbox bp canvas
(+ sz 36)
(+ sz 36)))
(btprnt/outline bp main 1)
(for x 0 6
(btprnt/vline
bp main
(+ (* 4 zoom)
(* 2 padding)
(* (+ (* 4 zoom) (* 2 padding) 1) x))
0
(main 3)
1))
(for y 0 6
(btprnt/hline
bp main
0
(+ (* 4 zoom)
(* 2 padding)
(* (+ (* 4 zoom) (* 2 padding) 1) y))
(main 3)
1))
(for y 0 6
(for x 0 6
(btprnt/tile
bp rmap main
(+ padding (* (+ (* 4 zoom) (* 2 padding) 1) x))
(+ padding (* (+ (* 4 zoom) (* 2 padding) 1) y))
x y
4 4 zoom 1)))
(def chicago_12 (btprnt/macfont-load "fonts/chicago_12"))
(def text "Core Radicals")
(btprnt/macfont-textbox
bp chicago_12
border
(math/floor
(- (/ (border 2) 2)
(/ (btprnt/macfont-linewidth chicago_12 text) 2)))
0 text 1)
(bpimg bp "radicals")
(btprnt/del bp)
(btprnt/del rmap))