Skip to content

Commit c913347

Browse files
authored
Support Unicode-16 octant characters (#8)
* Support Unicode-16 octant characters * Update README and tests * Add quadrant and sextant modes * Add quadrant and sextant test cases * Update README and CHANGELOG * Update documentation
1 parent 109f79b commit c913347

File tree

11 files changed

+498
-10
lines changed

11 files changed

+498
-10
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# UnicodeGraphics.jl
2+
## Version `v0.2.2`
3+
* ![Feature][badge-feature] Added support for plotting via quadrants,
4+
sextants, and octants. Octants requires Unicode 16 font support and
5+
is in 2024 not yet widely available. Things will work but the result
6+
will look bad. ([#8][pr-8])
7+
28
## Version `v0.2.1`
39
* ![Feature][badge-feature] Added support for multidimensional arrays ([#7][pr-7])
410

@@ -22,6 +28,7 @@
2228

2329
[pr-5]: https://github.com/JuliaGraphics/UnicodeGraphics.jl/pull/5
2430
[pr-7]: https://github.com/JuliaGraphics/UnicodeGraphics.jl/pull/7
31+
[pr-8]: https://github.com/JuliaGraphics/UnicodeGraphics.jl/pull/8
2532

2633
[badge-breaking]: https://img.shields.io/badge/BREAKING-red.svg
2734
[badge-deprecation]: https://img.shields.io/badge/deprecation-orange.svg

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "UnicodeGraphics"
22
uuid = "ebadf6b4-db70-5817-83da-4a19ad584e34"
33
authors = ["Rafael Schouten <[email protected]>"]
4-
version = "0.2.1"
4+
version = "0.2.2"
55

66
[compat]
77
julia = "1.6"

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,21 @@ julia> uprint(pac, :block)
5555
▀█████████████████
5656
▀██████████████▀
5757
▀▀██████▀▀
58+
59+
julia> uprint(pac, :sextant)
60+
 🬞🬵🬻██🬺🬱🬏
61+
🬞███🬕🬨███🬓
62+
🬻█████🬝🬆🬀
63+
█████🬲🬏  🬇
64+
🬨██████🬺🬱🬏
65+
 🬬██████🬝🬀
66+
  🬁🬊🬎🬎🬆🬀
5867
```
68+
Other drawing modes include `:quadrant` and `:octant`. While `:block`
69+
splits each character cell in two, the quadrants, sextants, and
70+
octants split a cell into 4, 6, or 8 "pixels". Octant mode requires
71+
Unicode 16 support in fonts and is not yet (as of late 2024) widely
72+
available.
5973

6074
When passing a filtering function,
6175
UnicodeGraphics will fill all values for which the function returns `true`,

src/api.jl

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
Write to `io` (or to the default output stream `stdout` if `io` is not given) a binary
55
unicode representation of `A` , filling values that are `true` or greater than zero.
66
7-
The printing method can be specified by passing either `:braille` or `:block`.
8-
The default is `:$DEFAULT_METHOD`.
7+
The printing method can be specified by passing either `:braille`,
8+
`:block`, `:quadrant`, `:sextant`, or `:octant`. The default is
9+
`:$DEFAULT_METHOD`. (Note that `:octant` requires either a font or a
10+
terminal emulator that supports Unicode 16; otherwise the output will
11+
look strange.)
912
1013
# Example
1114
```julia-repl
@@ -41,8 +44,11 @@ end
4144
Write to `io` (or to the default output stream `stdout` if `io` is not given) a binary
4245
unicode representation of `A` , filling values for which `f` returns `true`.
4346
44-
The printing method can be specified by passing either `:braille` or `:block`.
45-
The default is `:$DEFAULT_METHOD`.
47+
The printing method can be specified by passing either `:braille`,
48+
`:block`, `:quadrant`, `:sextant`, or `:octant`. The default is
49+
`:$DEFAULT_METHOD`. (Note that `:octant` requires either a font or a
50+
terminal emulator that supports Unicode 16; otherwise the output will
51+
look strange.)
4652
4753
# Example
4854
```julia-repl
@@ -80,8 +86,11 @@ end
8086
Return a string containing a binary unicode representation of `A` , filling values that are
8187
`true` or greater than zero.
8288
83-
The printing method can be specified by passing either `:braille` or `:block`.
84-
The default is `:$DEFAULT_METHOD`.
89+
The printing method can be specified by passing either `:braille`,
90+
`:block`, `:quadrant`, `:sextant`, or `:octant`. The default is
91+
`:$DEFAULT_METHOD`. (Note that `:octant` requires either a font or a
92+
terminal emulator that supports Unicode 16; otherwise the output will
93+
look strange.)
8594
8695
# Example
8796
```julia-repl
@@ -113,8 +122,11 @@ end
113122
Return a string containing a binary unicode representation of `A`, filling values for which
114123
`f` returns `true`.
115124
116-
The printing method can be specified by passing either `:braille` or `:block`.
117-
The default is `:$DEFAULT_METHOD`.
125+
The printing method can be specified by passing either `:braille`,
126+
`:block`, `:quadrant`, `:sextant`, or `:octant`. The default is
127+
`:$DEFAULT_METHOD`. (Note that `:octant` requires either a font or a
128+
terminal emulator that supports Unicode 16; otherwise the output will
129+
look strange.)
118130
119131
# Example
120132
```julia-repl

0 commit comments

Comments
 (0)