rM2-stuff
rM2-stuff copied to clipboard
Change font size in Yaft
It seems that Yaft currently has its glyphs hardcoded in glyph.h, with a pixel size of 16×32 per glyph.
For the sake of legibility and accessibility a larger font size would be great.
Would it be possible to create generate different glyph sets (larger ones) and switch between them with a configuration parameter?
Config options would be ideal but I'd be happy with just instructions on how to recompile it with a larger font if options aren't possible.
I agree, I won't have time to implement this soon though. For compiling with your own fonts, it's been a while, but this guide from the original upstream yaft should still work: https://uobikiemukot.github.io/yaft/#how-to-use-your-favorite-fonts
I was able to confirm that recompiling with fonts generated as per the above link works great :)
Here's a walkthrough of the steps I took since I had some troubles (and maybe other people will as well), but keep in mind I'm a hobbyist who doesn't know what they're doing, so some of these steps may be bad form.
- make sure you're using cmake >= version 3.19. ~~debian 12's is too old, for example.~~
- run
which cmake
and take note of what it says for later - install the right version of the remarkable toolchain for your device version ( https://remarkable.guide/devel/toolchains.html#installer )
- once installed, source it (at the end of the installer it'll tell you the command you need)
- clone the non-remarkable yaft repo ( https://github.com/uobikiemukot/yaft )
- generate your font with a command like
./mkfont_bdf table/alias path/to/your/bdf > glyph.h
- clone the repo with remarkable yaft in it ( https://github.com/timower/rM2-stuff )
- copy your glyph.h you generated to vendor/libYaft/glyph.h [ you might not need to do this next step, but I did! ]
- edit the CMakePresets.json so that under the dev preset, CMAKE_BUILD_WITH_INSTALL_RPATH is set to true
- the version of cmake in the remarkable toolchain is too old, so for all of these commands, replace
cmake
with the path to cmake you wrote down before:
cmake --preset dev
cmake --build build/dev --target yaft
- if all went well, copy the build/dev/apps/yaft/yaft file to your remarkable (e.g.
scp build/dev/apps/yaft/yaft [email protected]:/home/root/
, or however you like to copy your files) - for testing, see if it works by running
env LD_PRELOAD=/opt/lib/librm2fb_client.so.1.0.1; path/to/yaft
- if you see your terminal with the font you picked, it probably works! - i have yet to learn the "proper" way to install it so it appears in your launcher, but do that (i bodged it by editing /etc/draft/yaft.draft to point to my yaft instead)
- hopefully, success?