Skip to content

Support Unicode-16 octant characters #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# UnicodeGraphics.jl
## Version `v0.2.2`
* ![Feature][badge-feature] Added support for plotting via quadrants,
sextants, and octants. Octants requires Unicode 16 font support and
is in 2024 not yet widely available. Things will work but the result
will look bad. ([#8][pr-8])

## Version `v0.2.1`
* ![Feature][badge-feature] Added support for multidimensional arrays ([#7][pr-7])

Expand All @@ -22,6 +28,7 @@

[pr-5]: https://github.com/JuliaGraphics/UnicodeGraphics.jl/pull/5
[pr-7]: https://github.com/JuliaGraphics/UnicodeGraphics.jl/pull/7
[pr-8]: https://github.com/JuliaGraphics/UnicodeGraphics.jl/pull/8

[badge-breaking]: https://img.shields.io/badge/BREAKING-red.svg
[badge-deprecation]: https://img.shields.io/badge/deprecation-orange.svg
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "UnicodeGraphics"
uuid = "ebadf6b4-db70-5817-83da-4a19ad584e34"
authors = ["Rafael Schouten <[email protected]>"]
version = "0.2.1"
version = "0.2.2"

[compat]
julia = "1.6"
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,21 @@ julia> uprint(pac, :block)
▀█████████████████
▀██████████████▀
▀▀██████▀▀

julia> uprint(pac, :sextant)
 🬞🬵🬻██🬺🬱🬏
🬞███🬕🬨███🬓
🬻█████🬝🬆🬀
█████🬲🬏  🬇
🬨██████🬺🬱🬏
 🬬██████🬝🬀
  🬁🬊🬎🬎🬆🬀
```
Other drawing modes include `:quadrant` and `:octant`. While `:block`
splits each character cell in two, the quadrants, sextants, and
octants split a cell into 4, 6, or 8 "pixels". Octant mode requires
Unicode 16 support in fonts and is not yet (as of late 2024) widely
available.

When passing a filtering function,
UnicodeGraphics will fill all values for which the function returns `true`,
Expand Down
28 changes: 20 additions & 8 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
Write to `io` (or to the default output stream `stdout` if `io` is not given) a binary
unicode representation of `A` , filling values that are `true` or greater than zero.

The printing method can be specified by passing either `:braille` or `:block`.
The default is `:$DEFAULT_METHOD`.
The printing method can be specified by passing either `:braille`,
`:block`, `:quadrant`, `:sextant`, or `:octant`. The default is
`:$DEFAULT_METHOD`. (Note that `:octant` requires either a font or a
terminal emulator that supports Unicode 16; otherwise the output will
look strange.)

# Example
```julia-repl
Expand Down Expand Up @@ -41,8 +44,11 @@ end
Write to `io` (or to the default output stream `stdout` if `io` is not given) a binary
unicode representation of `A` , filling values for which `f` returns `true`.

The printing method can be specified by passing either `:braille` or `:block`.
The default is `:$DEFAULT_METHOD`.
The printing method can be specified by passing either `:braille`,
`:block`, `:quadrant`, `:sextant`, or `:octant`. The default is
`:$DEFAULT_METHOD`. (Note that `:octant` requires either a font or a
terminal emulator that supports Unicode 16; otherwise the output will
look strange.)

# Example
```julia-repl
Expand Down Expand Up @@ -80,8 +86,11 @@ end
Return a string containing a binary unicode representation of `A` , filling values that are
`true` or greater than zero.

The printing method can be specified by passing either `:braille` or `:block`.
The default is `:$DEFAULT_METHOD`.
The printing method can be specified by passing either `:braille`,
`:block`, `:quadrant`, `:sextant`, or `:octant`. The default is
`:$DEFAULT_METHOD`. (Note that `:octant` requires either a font or a
terminal emulator that supports Unicode 16; otherwise the output will
look strange.)

# Example
```julia-repl
Expand Down Expand Up @@ -113,8 +122,11 @@ end
Return a string containing a binary unicode representation of `A`, filling values for which
`f` returns `true`.

The printing method can be specified by passing either `:braille` or `:block`.
The default is `:$DEFAULT_METHOD`.
The printing method can be specified by passing either `:braille`,
`:block`, `:quadrant`, `:sextant`, or `:octant`. The default is
`:$DEFAULT_METHOD`. (Note that `:octant` requires either a font or a
terminal emulator that supports Unicode 16; otherwise the output will
look strange.)

# Example
```julia-repl
Expand Down
Loading
Loading