font-files icon indicating copy to clipboard operation
font-files copied to clipboard

feat(font): add fusion pixel

Open OverflowCat opened this issue 1 year ago • 7 comments

Fusion Pixel Font is an open-source sans-serif pixel font designed to support Chinese, Japanese, and Korean (CJK) characters. It offers clear and sharp readability at 8, 10, and 12-pixel sizes.

The font has 3 pixel sizes, 2 styles (monospace and proportional), and 5 locales, resulting in a total of 30 combinations. Although I have added the locales using subsets, I am not entirely certain if they are functioning correctly (e.g., whether the family names are correctly assigned), as font files are renamed from different, separate locale-specific files.

Fonts added

fusion-pixel-8px-monospaced
fusion-pixel-8px-proportional
fusion-pixel-10px-monospaced
fusion-pixel-10px-proportional
fusion-pixel-12px-monospaced
fusion-pixel-12px-proportional

They are added using a script. I didn't include it here; check this branch. You need to run it using Bun.

OverflowCat avatar Jun 30 '24 19:06 OverflowCat

In fact, the subsets here are not actually subsetting. Each individual subset contains the entire font (e.g., the other four contain Latin). For CJK, due to Han unification in Unicode, many characters that look slightly different in different locales are assigned to a single Unicode code point. Therefore, we cannot combine fonts from different locales. So the question is actually if users have the option to manually specify the subsets they wish to utilize.

My original plan was to create a font name for each locale, but that would result in 6 * 5 = 30 packages.

(Nevertheless, there is no need to worry about size - this is a pixel font, much smaller than typical CJK fonts.)

OverflowCat avatar Jul 02 '24 21:07 OverflowCat

My original plan was to create a font name for each locale, but that would result in 6 * 5 = 30 packages.

To my understanding, that is exactly what Google Fonts does.

  • Noto Sans TC/Noto Sans SC/Noto Sans KR etc.
  • IBM Plex Sans JP/IBM Plex Sans KR

And more.

I'm not against adding a large number of packages. Google doesn't seem to be either looking at the newest fonts added to Fontsource:

image

But I wonder if all 30 packages are necessary? If you have any ideas to reduce that, that will be great to hear about. But if they are all uniquely different, I think it is okay to introduce these packages separately.

ayuhito avatar Jul 03 '24 12:07 ayuhito

We could also remove the individual latin subset entirely, and only ship 4 * 6 = 24 packages as one way.

ayuhito avatar Jul 03 '24 12:07 ayuhito

Since the glyphs for Latin and symbols differ between mono and proportional fonts, and 8/10/12px sizes can indeed be considered as separate fonts, I don't think there's a way to further reduce the count. I will modify my build script to generate 24 packages.

8px 10px 12px

Before that, I'd like to confirm that fontsource should be using fontface to import our fonts, so the family name I specified in the metadata is irrelevant to the font files (woff and woff2, if they have built-in family names). Is it correct?

OverflowCat avatar Jul 03 '24 13:07 OverflowCat

You need to give each package metadata a different family name, as it will then generate a different @font-face name which will take precedence over any built-in family names.

There are times we regenerate the CSS in this repository using only the metadata, thus the metadata has to be accurate. Any custom edits to the CSS would be removed in such cases.

ayuhito avatar Jul 03 '24 14:07 ayuhito

The test likely failed due to the absence of -latin- in the font files, for which I will make adjustments later.

Google uses JP, KR, TC, SC for the shortened names

The naming follows the font file's family name, which I checked using FontForge. If changing the names does not cause any issues, then I will proceed with that.

Btw Fusion Kai in the repository (not by the same author) uses G / T / J, following font author's naming. Fusion Pixel doesn't explicitly call their variants "Fusion Pixel zh-hant", "Fusion Pixel ja", etc. in their website so I think renaming is fine (?)

OverflowCat avatar Jul 25 '24 10:07 OverflowCat

I think we should change the names for consistency. We're already modifying the fonts by subsetting it separately like this, so it should be fine.

ayuhito avatar Jul 25 '24 16:07 ayuhito