martinstoeckli / SilentNotes

SilentNotes is a simple note taking app which respects your privacy.
https://www.martinstoeckli.ch/silentnotes
Mozilla Public License 2.0
238 stars 35 forks source link

Configurable font for displaying notes #212

Open martinstoeckli opened 1 year ago

martinstoeckli commented 1 year ago

There was a user request to be able to choose a custom font for displaying the notes. The request was about the note content and would not include the GUI (menu, dialogs).

Using a standard font which is available on all platforms has its advantages, e.g. similar looking notes on different devices, but the notes are structured by content (title, paragraph, list) anyway, and different display sizes will result in different looking notes. There is no reason against offering a custom font in the settings.

Since not all devices offer the same fonts, this setting would be made individually for each device and is not shared together with the notes.

martinstoeckli commented 1 year ago

It seems that there is no easy way to get a list of font-families on Android, which could be used by the editor CSS. From Android v10 upwards, there exists a new API [SystemFonts.getAvailableFonts()](https://developer.android.com/reference/android/graphics/fonts/SystemFonts#getAvailableFonts()) to list installed fonts, but it just lists all ttf files. Grouping them to the correct font-family (several ttf files can represent different variations of the same font) and extracting the font-name seems to be guesswork and therefore not a solid solution, at least I didn't find an obvious way. Found other projects with similar problems.

We leave this issue open, and as soon as we can find a way to solve the font listing problem on Android, it will be implemented.