Skip to content

Commit 31de06e

Browse files
committedMar 7, 2025
Actually store modified versions of renaissance fonts as diacritics needed a LOT of changing to fit in the smaller size
1 parent 97e9846 commit 31de06e

13 files changed

+2678
-3627
lines changed
 

‎libs/graphics/font/README.md

+23-8
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,30 @@ The vector font is stored in `fontmap_13x19.svg` and is decoded with `build_vect
2929

3030
## renaissance Fonts
3131

32-
These fonts are used by Bangle.js 2. These are turned into Espruino files (embedded `pbf` fonts) with the following commands:
32+
These fonts are used by Bangle.js 2. They're based on the fonts from https://github.com/pebble-dev/renaissance
33+
but have had the line height reduced (ASCII chars render the same, but some characters with diacritics have
34+
had to be compressed vertically).
35+
36+
These are turned into Espruino files (embedded `pbf` fonts) with the following commands:
3337

3438
```
35-
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_28.pbff --range All --height 22 --shiftUp 10 --nudge --debug --spaceWidth 4 --opbfc 22 --test "Hello World"
36-
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_24_bold.pbff --range All --height 17 --shiftUp 10 --nudge --debug --spaceWidth 3 --opbfc 17 --test "Hello World"
37-
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_18_bold.pbff --range All --height 14 --shiftUp 7 --nudge --debug --spaceWidth 3 --opbfc 14 --test "Hello World"
38-
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_18_doubled.pbff --range All --height 28 --spaceWidth 6 --opbfc 28 --test "Hello World"
39+
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_crop_28.pbff --range All --spaceWidth 6 --opbfc 28 --test "Hello World"
40+
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_crop_22.pbff --range All --spaceWidth 4 --opbfc 22 --test "Hello World"
41+
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_crop_17.pbff --range All --spaceWidth 3 --opbfc 17 --test "Hello World"
42+
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_crop_14.pbff --range All --spaceWidth 3 --opbfc 14 --test "Hello World"
43+
mv jswrap_font_* ..
3944
```
4045

41-
`renaissance_18_doubled.pbff` was originally created with:
46+
`renaissance_crop_*` were originally created with:
4247

4348
```
44-
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_18.pbff --range All --height 15 --shiftUp 7 --nudge --doubleSize --opbff renaissance_18_doubled.pbff
49+
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_28.pbff --range All --height 22 --shiftUp 10 --nudge --debug --spaceWidth 4 --opbff renaissance_crop_22.pbff
50+
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_24_bold.pbff --range All --height 17 --shiftUp 10 --nudge --debug --spaceWidth 3 --opbff renaissance_crop_17.pbff
51+
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_18_bold.pbff --range All --height 14 --shiftUp 7 --nudge --debug --spaceWidth 3 --opbff renaissance_crop_14.pbff
52+
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_18.pbff --range All --height 15 --shiftUp 7 --nudge --doubleSize --opbff renaissance_crop_28.pbff
4553
```
4654

47-
And then patched up by hand to attempt to smooth it out. Some glyphs are still not complete.
55+
And then patched up by hand. Some glyphs are still not complete so PRs hugely appreciated!
4856

4957
## Testing
5058

@@ -63,3 +71,10 @@ for (var y=0;y<16;y++) {
6371
g.drawImage(b.asImage());
6472
b.dump();
6573
```
74+
75+
You can also use EspruinoWebTools to write out text in the font. For example to check positioning of some of the characters:
76+
77+
```
78+
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_18_doubled.pbff --range All --test "AÁÉÍÓÚÝÀÈÌÒÙÂÊÎÔÛÄËÏÖÜŸŶÃÑÕOZŹŻŽĆĈĊĎ"
79+
node ~/workspace/EspruinoWebTools/cli/fontconverter.js renaissance_18_doubled.pbff --range All --test "aáéíóúýàèìòùâêîôûãñõäëïöüÿzźżžćĉċ"
80+
```

0 commit comments

Comments
 (0)