danth / stylix

System-wide colorscheming and typography for NixOS
https://stylix.danth.me/
MIT License
912 stars 107 forks source link

allow combining fonts #276

Open KiaraGrouwstra opened 4 months ago

KiaraGrouwstra commented 4 months ago

css unit unicode-range allows specifying fonts by character range. it would be nice if stylix were to facilitate such a use-case, so as to e.g. allow specifying different fonts for different languages.

danth commented 4 months ago

Possibly related to #201

KiaraGrouwstra commented 4 months ago

fyi as to the linked thread, the current proposal is more granular - one of my use-cases was combining a font pretty for latin (that also has CJK) with one pretty for CJK but less legible for latin. in this particular scenario just having fallback fonts would fail as all codepoints would already be covered in the original font.

that said, i would see additional use-cases as well, e.g. mixing and matching emojis from different fonts.

danth commented 4 months ago

Yes, what you're requesting will require more than what the current PR provides.

It may already be possible to build you're requesting on top of Stylix by merging the fonts into a single font (using pkgs.runCommand), giving that font a different name, and passing that package and name into the Stylix options.