|
@@ -15,18 +15,18 @@ When using this font, you may notice that characters with similar pronunciations
|
|
|
This is because fonts on Linux TTY are generally changed using the `setfont` tool from the kbd package, which supports a maximum of 512 glyphs. However, a single glyph can map to multiple Unicode code points.
|
|
This is because fonts on Linux TTY are generally changed using the `setfont` tool from the kbd package, which supports a maximum of 512 glyphs. However, a single glyph can map to multiple Unicode code points.
|
|
|
Therefore, Xibo maps all characters with the same pronunciation (ignoring tones) to the same glyph, allowing for Chinese character display within the limited number of glyphs.
|
|
Therefore, Xibo maps all characters with the same pronunciation (ignoring tones) to the same glyph, allowing for Chinese character display within the limited number of glyphs.
|
|
|
|
|
|
|
|
-### TUI display optimization
|
|
|
|
|
|
|
+### Terminal User Inerface Display Optimization
|
|
|
|
|
|
|
|
This font also optimizes the mapping of commonly used graphical symbols in terminals to make them more suitable for terminal use. Some examples:
|
|
This font also optimizes the mapping of commonly used graphical symbols in terminals to make them more suitable for terminal use. Some examples:
|
|
|
|
|
|
|
|
- Original symbols:
|
|
- Original symbols:
|
|
|
|
|
|
|
|
```plaintext
|
|
```plaintext
|
|
|
- ┌─┬─┐
|
|
|
|
|
- │ │ │
|
|
|
|
|
- ├─┼─┤
|
|
|
|
|
- │ │ │
|
|
|
|
|
- └─┴─┘
|
|
|
|
|
|
|
+ ┌───┬───┐
|
|
|
|
|
+ │ │ │
|
|
|
|
|
+ ├───┼───┤
|
|
|
|
|
+ │ │ │
|
|
|
|
|
+ └───┴───┘
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
- Before optimization:
|
|
- Before optimization:
|
|
@@ -36,18 +36,41 @@ This font also optimizes the mapping of commonly used graphical symbols in termi
|
|
|
- After optimization:
|
|
- After optimization:
|
|
|
|
|
|
|
|
```plaintext
|
|
```plaintext
|
|
|
- r-T-┐
|
|
|
|
|
- | | |
|
|
|
|
|
- ├-+-┤
|
|
|
|
|
- | | |
|
|
|
|
|
- L-┴-J
|
|
|
|
|
|
|
+ r---T---┐
|
|
|
|
|
+ | | |
|
|
|
|
|
+ ├---+---┤
|
|
|
|
|
+ | | |
|
|
|
|
|
+ L---┴---J
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
Among these, `┌` is mapped to the letter `r`, `┬` is mapped to the letter `T`, `┘` is mapped to the letter `J`, etc.
|
|
Among these, `┌` is mapped to the letter `r`, `┬` is mapped to the letter `T`, `┘` is mapped to the letter `J`, etc.
|
|
|
- This type of mapping maximizes the improvement of display quality without occupying more glyphs.
|
|
|
|
|
|
|
+ This type of mapping maximizes the improvement of display quality without occupying more glyphs (:-D).
|
|
|
|
|
|
|
|

|
|

|
|
|
|
|
|
|
|
|
|
+### Character Width Display Optimization
|
|
|
|
|
+
|
|
|
|
|
+In regular text display scenarios:
|
|
|
|
|
+
|
|
|
|
|
+- **Full-width characters** (such as Chinese characters and symbols in GB2312) have a display width of two units (occupying two character positions) and a height of one character line (occupying one line height);
|
|
|
|
|
+- **Half-width characters** (such as English letters, Arabic numerals, and ASCII punctuation) have a display width of one unit and the same height as one character line.
|
|
|
|
|
+
|
|
|
|
|
+This means: Chinese characters and symbols in GB2312 encoding are full-width, while ASCII characters and English symbols (such as commas, periods) are typically half-width.
|
|
|
|
|
+
|
|
|
|
|
+However, PC Screen Font 2 (PSF2) is a fixed-width bitmap font format that does not support characters of different sizes (widths) within a single font.
|
|
|
|
|
+This leads to:
|
|
|
|
|
+
|
|
|
|
|
+- If all characters are displayed with a width of one unit: full-width characters only show the left half, with the right half displaying the [thirty-second character](#thirty-second-character);
|
|
|
|
|
+- If all characters are displayed with a width of two units: all half-width characters occupy two columns, but visually only have a width of one unit, resulting in [large gaps between half-width characters](assets/display_old.png).
|
|
|
|
|
+
|
|
|
|
|
+Given the high difficulty of finding or designing "tall and narrow half-width monospace Chinese fonts" or "compatible full-width English letter fonts",
|
|
|
|
|
+font-xibo maps all English letters, Arabic numerals, ASCII punctuation, and other characters to full-width characters in the UTF-8 high range.
|
|
|
|
|
+Although each Chinese character is still separated by a [thirty-second character](#thirty-second-character), font-xibo achieves a relatively balanced visual appearance overall.
|
|
|
|
|
+
|
|
|
|
|
+### Thirty-second Character
|
|
|
|
|
+
|
|
|
|
|
+The thirty-second character in Linux TTY fonts defaults to `U+20`, which is a space. This character is used to fill positions in the background where no character is present.
|
|
|
|
|
+
|
|
|
## Building the Font
|
|
## Building the Font
|
|
|
|
|
|
|
|
1. Clone the repository:
|
|
1. Clone the repository:
|
|
@@ -85,6 +108,8 @@ Place `xibo.psfu.gz` in the `consolefonts` directory (located at `/usr/share/con
|
|
|
|
|
|
|
|
## License
|
|
## License
|
|
|
|
|
|
|
|
|
|
+> Thanks to [oldherl](https://github.com/oldherl) for their forward-looking technical exploration project [syllazh](https://github.com/oldherl/syllazh/);
|
|
|
|
|
+>
|
|
|
> Thanks to **TakWolf** and their team for providing the `fusion-pixel-font` font.
|
|
> Thanks to **TakWolf** and their team for providing the `fusion-pixel-font` font.
|
|
|
|
|
|
|
|
The script files `build.bash`, `build_font_from_bdf.py`, and all files in the `scripts/` directory in this repository follow the [GNU GENERAL PUBLIC LICENSE Version 3](LICENSE),
|
|
The script files `build.bash`, `build_font_from_bdf.py`, and all files in the `scripts/` directory in this repository follow the [GNU GENERAL PUBLIC LICENSE Version 3](LICENSE),
|