pop-os / cosmic-text

Pure Rust multi-line text handling
https://pop-os.github.io/cosmic-text/cosmic_text/
Apache License 2.0
1.6k stars 102 forks source link

[bug report + feature request] issues with weights for some fonts #320

Open blind-confused opened 1 week ago

blind-confused commented 1 week ago

[bug report] I installed the latest COSMIC updates where font settings were introduced. I downloaded a few fonts (namely Moderustic, Onest and Rubik) from Google Fonts to try them out on COSMIC. I extracted the .zip using File Roller, then opened the extracted .ttf files in GNOME Fonts, and installed them that way (I'm not sure how else to do install fonts on Linux). All the fonts installed successfully, except for Rubik - it installed in GNOME Fonts but is missing in COSMIC Settings). when trying the fonts out in COSMIC Settings, I can see that medium and semibold are not working correctly with either of the said fonts. It just reverts to some sort of default system font which looks very differently. The said fonts are supposed to have support for medium and semibold weights, I checked it on their websites. But still, any segment of COSMIC apps that uses the said weights, reverts to the default system font. All the other weights are working correctly. none of this happens with a font called Inter - all of it's weights are working correctly. The difference here is that I installed Inter through my distro's package manager (I'm not on Pop!_OS). The other fonts are not packaged in our repos, so I had to get them manually, the way I described.

[feature request] speaking of font weights, some people (at least me, haha) might be interested in using fonts on COSMIC that don't have support for medium, semibold or other weight, for example GNOME's current default font, Cantarell. When I use it, any segment of COSMIC that uses the missing weights, also reverts to a different looking default system font. If there is no other workaround, would you consider making some sort of a "fallback" for fonts like that, which would make them use other available weights? For example, semibold could fallback to bold, and medium could fallback to either normal/regular or bold too.

not sure this is the correct repo for this, I'm sorry if it's not.

blind-confused commented 1 week ago

edit: I guess I'm wrong. The official Cantarell page from the GNOME website showcases support for medium, semibold and more weights. I initially thought it doesn't support them, because when opening Cantarell's description in GNOME Fonts, it says that it only supports thin, light, regular, bold and extra bold. I didn't install the font manually; it was just preinstalled because I have the GNOME DE installed. I guess perhaps the Cantarell version shipped with GNOME is limited or outdated? I'm not sure. I could try installing the website version of Cantarell and see if that fixes the weights, but I'm not sure how to install fonts properly on Linux.

blind-confused commented 4 days ago

as a side note, I'm not sure if this is going on just on COSMIC or not, but all of Cantarell's natively supported weights (thin, light, normal/regular, bold and extra bold) are noticeably smaller in size than other weights, which just looks weird, for example, when using COSMIC Files and looking at the pathway, the name of the current directory is bigger than the rest of the directory.

kenmcd commented 3 days ago

The Cantarell VF font only has named instances for Thin (100), Light (200), Regular (400), Bold (700, at 600.4), and ExtraBold (800). On the website they are displaying text using weights 100 to 800 and giving them names. All those pre-defined instances do not exist in the variable font. Just the ones above. And they are different. The named instance in the font is ExtraBold at 800. On the web page they call the text Black and set the variable weight to 800. So what they are displaying is confusing (and dumb).

blind-confused commented 2 days ago

I originally thought that, when I select non-native weights for Cantarell in COSMIC Settings, it somehow works, because they looked similar to Cantarell. but I just tried doing it with Lobster (because that's a font that you can't confuse for another font, it looks way too different). And it looks like it also has some sort of fallback options. When you select any weight for Lobster that is not "regular/normal", it uses some other font, which looks a lot like Cantarell at bold and bigger weights. just saying this in case any of this info is helpful.