Skip to content

Commit

Permalink
add a few digits
Browse files Browse the repository at this point in the history
  • Loading branch information
cormullion committed Dec 30, 2021
1 parent 0d91cfc commit 671ad32
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Zalgo"
uuid = "5b351978-c8a9-11e9-2467-a1bfb30aea0b"
authors = ["cormullion <[email protected]>"]
version = "1.1.0"
version = "1.2.0"

[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
11 changes: 9 additions & 2 deletions src/Zalgo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ frakturdict = Dict{String, Char}()
[frakturdict[string(Char(i + 96))] = vcat('\U1D586':'\U1D59F')[i] for i = 1:26]
frakturdict[" "] = ' '

# build the blackboard dict
# build the blackboard (double-struck) dict
blackboarddict = Dict{String, Char}()
[blackboarddict[string(Char(i + 64))] = vcat(
'\U1D538', # A
Expand Down Expand Up @@ -123,6 +123,9 @@ blackboarddict = Dict{String, Char}()
'\u2124' # Z !
)[i] for i = 1:26]
[blackboarddict[string(Char(i + 96))] = vcat('\U1D552':'\U1D56B')[i] for i = 1:26]
# digits
[blackboarddict[string(Char(i + 48))] = vcat('\U1D7D8':'\U1D7E1')[i + 1] for i in 0:9]

blackboarddict[" "] = ' '

# build the Script dict
Expand All @@ -146,6 +149,7 @@ scriptdict[" "] = ' '
boldromandict = Dict{String, Char}()
[boldromandict[string(Char(i + 64))] = vcat('\U1D400':'\U1D419')[i] for i = 1:26]
[boldromandict[string(Char(i + 96))] = vcat('\U1D41a':'\U1D433')[i] for i = 1:26]
[boldromandict[string(Char(i + 48))] = vcat('\U1D7CE':'\U1D7D7')[i + 1] for i = 0:9]
boldromandict[" "] = ' '

# build the italic dict
Expand Down Expand Up @@ -176,12 +180,14 @@ boldfrakturdict[" "] = ' '
sansdict = Dict{String, Char}()
[sansdict[string(Char(i + 64))] = vcat('\U1D5A0':'\U1D5B9')[i] for i = 1:26]
[sansdict[string(Char(i + 96))] = vcat('\U1D5ba':'\U1D5d3')[i] for i = 1:26]
[sansdict[string(Char(i + 48))] = vcat('\U1D7E2':'\U1D7EB')[i + 1] for i = 0:9]
sansdict[" "] = ' '

# build the boldsans dict
boldsansdict = Dict{String, Char}()
[boldsansdict[string(Char(i + 64))] = vcat('\U1D5d4':'\U1D5ed')[i] for i = 1:26]
[boldsansdict[string(Char(i + 96))] = vcat('\U1D5ee':'\U1D607')[i] for i = 1:26]
[boldsansdict[string(Char(i + 48))] = vcat('\U1D7EC':'\U1D7F5')[i + 1] for i = 0:9]
boldsansdict[" "] = ' '

# build the italicsans dict
Expand All @@ -200,6 +206,7 @@ bolditalicsansdict[" "] = ' '
ttdict = Dict{String, Char}()
[ttdict[string(Char(i + 64))] = vcat('\U1D670':'\U1D689')[i] for i = 1:26]
[ttdict[string(Char(i + 96))] = vcat('\U1D68a':'\U1D6a3')[i] for i = 1:26]
[ttdict[string(Char(i + 48))] = vcat('\U1D7F6':'\U1D7FF')[i + 1] for i = 0:9]
ttdict[" "] = ' '

# build the boxed dict
Expand All @@ -213,7 +220,7 @@ circleddict = Dict{String, Char}()
[circleddict[string(Char(i + 64))] = vcat('\u24b6':'\u24cf')[i] for i = 1:26]
[circleddict[string(Char(i + 96))] = vcat('\u24d0':'\u24e9')[i] for i = 1:26]
[circleddict[string(Char(i + 0x30))] = vcat('\u2460':'\u2468')[i] for i = 1:9]
# 24EA 0 CIRCLED DIGIT ZERO is separate
# 24EA 0 CIRCLED DIGIT ZERO is separate !!!
circleddict[string(Char(0x30))] = '\u24ea'
circleddict[" "] = ' '

Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ s = "Julia is really cool"
@test circled(string('w'), negative=true)[1] |> Int == 127366
@test segmented(string('1'))[1] |> Int == 130033
@test segmented(string('0'))[1] |> Int == 130032
@test length(blackboard("Figure 2")) == 8
@test length(blackboard("Figure 22")) == 9

#=
# build
for f in (boldscript, boldfraktur, bolditalic, bolditalicsans, boldroman, boldsans, italic, italicsans, sans, script, teletype, upsidedown, blackboard, fraktur)
ch = 'w'
ff = f(string(ch))
Expand Down

0 comments on commit 671ad32

Please sign in to comment.