things+stuff

This commit is contained in:
Kim Ravn Hansen
2025-09-10 12:36:42 +02:00
parent 5d0cc61cf9
commit ba293d08b3
39 changed files with 3425 additions and 2713 deletions

View File

@@ -1,7 +1,9 @@
Here are some ASCII and UTF-8 characters commonly used for "shading" effects in text art or terminal displays. These characters provide varying levels of density or shading:
### ASCII Shading Characters
These are basic ASCII characters often used for shading:
```
Light shade: ░ (U+2591)
Medium shade: ▒ (U+2592)
@@ -11,7 +13,9 @@ Half block: ▄ (U+2584), ▀ (U+2580)
```
### Additional UTF-8 Block Characters
These Unicode characters offer more granular shading or block patterns:
```
Light block: ░ (U+2591)
Medium block: ▒ (U+2592)
@@ -26,7 +30,9 @@ Checkerboard: ▚ (U+259A), ▞ (U+259E)
```
### Example Usage
Heres an example of a simple shading gradient using some of these characters:
```
Light to Dark: ░ ▒ ▓ █
Half blocks: ▀ ▄ ▌ ▐
@@ -34,16 +40,17 @@ Quadrant pattern: ▖ ▗ ▘ ▝
```
### Notes
- Not all terminals or text editors display Unicode characters consistently, so ASCII characters like `.:;#+` are sometimes used for basic shading in simpler environments.
- If you want to create specific patterns or need more complex ASCII art, let me know, and I can generate or suggest more detailed designs!
- If you meant something specific by "shading" (e.g., for a particular programming context or art style), please clarify, and Ill tailor the response further.
Below is a collection of ASCII and UTF-8 characters suitable for creating frames, borders, or "windows" in a text-based user interface (TUI), such as those built with ncurses. These characters can be used to draw boxes, lines, and corners to simulate window-like structures in a terminal.
Below is a collection of ASCII and UTF-8 characters suitable for creating frames, borders, or "windows" in a text-based user interface (TUI), such as those built with ncurses. These characters can be used to draw boxes, lines, and corners to simulate window-like structures in a terminal.
### ASCII Characters for Frames
These are basic ASCII characters that work universally in most terminals:
```
Horizontal line: - (U+002D)
Vertical line: | (U+007C)
@@ -56,6 +63,7 @@ Corners:
```
Example simple ASCII window:
```
+----------+
| Content |
@@ -63,9 +71,11 @@ Example simple ASCII window:
```
### UTF-8 Box-Drawing Characters
Unicode provides a dedicated **Box Drawing** block (U+2500U+257F) for creating more refined frames. These are widely supported in modern terminals and ncurses:
#### Single-Line Box Drawing
```
Horizontal line: ─ (U+2500)
Vertical line: │ (U+2502)
@@ -83,6 +93,7 @@ Intersections:
```
Example single-line window:
```
┌──────────┐
│ Content │
@@ -90,6 +101,7 @@ Example single-line window:
```
#### Double-Line Box Drawing
```
Horizontal line: ═ (U+2550)
Vertical line: ║ (U+2551)
@@ -107,6 +119,7 @@ Intersections:
```
Example double-line window:
```
╔══════════╗
║ Content ║
@@ -114,7 +127,9 @@ Example double-line window:
```
#### Mixed and Other Box-Drawing Characters
For more complex designs, you can mix single and double lines or use specialized characters:
```
Single to double transitions:
Horizontal single to double: ╼ (U+257C)
@@ -127,6 +142,7 @@ Rounded corners (less common, not always supported):
```
Example with rounded corners:
```
╭──────────╮
│ Content │
@@ -134,7 +150,9 @@ Example with rounded corners:
```
### Additional UTF-8 Characters for Decoration
These can enhance the appearance of your TUI:
```
Block elements for borders or shading:
Full block: █ (U+2588)
@@ -145,7 +163,9 @@ Dark shade: ▓ (U+2593)
```
### Example TUI Window with Content
Heres a sample of a more complex window using single-line box-drawing characters:
```
┌────────────────────┐
│ My TUI Window │
@@ -156,12 +176,14 @@ Heres a sample of a more complex window using single-line box-drawing charact
```
### Notes for ncurses
- **ncurses Compatibility**: ncurses supports both ASCII and UTF-8 box-drawing characters, but you must ensure the terminal supports Unicode (e.g., `LANG=en_US.UTF-8` environment variable). Use `initscr()` and `start_color()` in ncurses to handle rendering.
- **Terminal Support**: Some older terminals may not render UTF-8 characters correctly. Test your TUI in the target environment (e.g., xterm, gnome-terminal, or Alacritty).
- **Fallback**: If Unicode support is unreliable, stick to ASCII (`-`, `|`, `+`) for maximum compatibility.
- **ncurses Functions**: Use `box()` in ncurses to draw a border around a window automatically, or manually print characters with `mvaddch()` for custom designs.
### Tips
- Combine single and double lines for visual hierarchy (e.g., double lines for outer windows, single lines for inner sections).
- If you need specific examples (e.g., a multi-window layout or a dialog box), let me know, and I can provide a detailed ASCII/UTF-8 mockup or even pseudocode for ncurses.
- If you want a particular style (e.g., heavy lines, dashed lines, or specific layouts), please clarify, and Ill tailor the response.