Skip to content

Commit

Permalink
Merge pull request #367 from ty-porter/master
Browse files Browse the repository at this point in the history
Patch all default fonts for backwards K support
  • Loading branch information
ty-porter authored Apr 22, 2022
2 parents a0d6cc8 + 6074be8 commit 9ddfe6a
Show file tree
Hide file tree
Showing 25 changed files with 915,277 additions and 22 deletions.
55 changes: 55 additions & 0 deletions assets/fonts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Fonts

The scoreboard attempts to render a backwards K (`` -- unicode A4D8) whenever a batter strikes out looking.

The scoreboard patches all the default fonts found in `rpi-rgb-led-matrix`. You can find patched fonts located in `assets/fonts/patched`.

If you are using a custom font, most likely it does not include this special character.

## Including ``

If you would like to add `uniA4D8` support for a custom font you are using, it's usually as simple as horizontally mirroring the standard K character (italic fonts typically do not work well). In BDF fonts, you can do this as follows. `4x6.bdf` will be used as an example.

1. Locate the K `STARTCHAR` tag in your font file:

```
STARTCHAR K
ENCODING 75
SWIDTH 1000 0
DWIDTH 4 0
BBX 3 5 0 0
BITMAP
A0
A0
C0
A0
A0
ENDCHAR
```

2. Create a copy of this character, changing the `STARTCHAR` and `ENCODING` to the correct values:

```
STARTCHAR uniA4D8
ENCODING 42200
SWIDTH 1000 0
DWIDTH 4 0
BBX 3 5 0 0
BITMAP
A0
A0
C0
A0
A0
ENDCHAR
```

3. Horizontally mirror the bitmap. You can convert the hex values by hand, or find one of the tools exist to convert this for you. Bear in mind the latest BDF 2.2 specification was introduced in 1993, so tooling may be limited.

4. Increment the `CHARS` tag to include the correct number of characters.

```
CHARS 206 -> CHARS 207
```

5. Save the file and restart the scoreboard.
Loading

0 comments on commit 9ddfe6a

Please sign in to comment.