nuxt / fonts

Plug-and-play web font optimization and configuration for Nuxt apps.

Home Page:https://fonts.nuxt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adobe font provider does not support dynamic subset

dungsil opened this issue · comments

@nuxt/font is fetching CSS files from Adobe Typekit. However, for fonts with East Asian languages, it is unable to fetch the CSS extensions.

const css = await fontCSSAPI<string>(`${fonts.kits[kit]!.id}.css`)

Below is the difference in the Adobe fonts screen:

Inter Variable ( css file include )
image

Pretendard ( javascript file include )
image

East Asian characters (especially CJK) seem to have a large size, so Adobe can't import the entire font by default or all characters.
image

If you look at the actual API being called, you'll see that East Asian languages don't come with css files.

Can you add support for these areas?
If not, you can update the documentation to avoid confusing Asian users.

In the logs, it looks like this, making it difficult to determine the cause.
image

Reference:

  1. Adobe fonts docs: https://helpx.adobe.com/kr/fonts/using/dynamic-subsetting.html
  2. Test font (Pretendard): https://fonts.adobe.com/fonts/pretendard

This is tricky - adding support for east Asian characters is indeed possible, actually I've already figured out a bit, but I don't think Adobe will be happy with this as the code they provide is clearly obfuscated and is not documented anywhere. So I guess we should just add a note in the docs to either directly use the script or use the local provider in such cases. @danielroe What do you think? If we do need to implement this feature, I would be interested to work on it.