Wakamai-Fondue / wakamai-fondue-site

Wakamai Fondue website
Apache License 2.0
37 stars 6 forks source link

Show sample text based on font's script(s) #111

Open RoelN opened 3 years ago

RoelN commented 3 years ago

Sample text is now:

  1. The sample text embedded in the font
  2. A fondue recipe in English

But we need to show something else when the font doesn't have its own sample text and doesn't support "Latin"/English. E.g. other scripts/languages, but also icon and emoji fonts.

Quick fix: if no "embedded sample text" and no "Basic Latin Unicode Block support" then dump the first 100 characters from the cmap. This will at least show something on the screen.

Better fix: detect script/language, and fetch a corresponding sample text.

(Also see https://github.com/Wakamai-Fondue/wakamai-fondue-site/issues/103)