Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable fonts: some files or file references are missing #107

Closed
tremby opened this issue Dec 9, 2020 · 2 comments
Closed

Variable fonts: some files or file references are missing #107

tremby opened this issue Dec 9, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@tremby
Copy link

tremby commented Dec 9, 2020

Describe the bug
Some files are missing, or referenced wrongly.

To Reproduce
Steps to reproduce the behavior:

  1. Install fontsource-public-sans

  2. Import fontsource-public-sans/variable-full.css

  3. Build project

  4. See error

     ./node_modules/fontsource-public-sans/variable-full.css (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-5-1!./node_modules/next/dist/compiled/postcss-loader/cjs.js??ref--5-oneOf-5-2!./node_modules/fontsource-public-sans/variable-full.css)
     Error: Can't resolve './files/public-sans-latin-variable-full-italic.woff2' in '<...>/node_modules/fontsource-public-sans'
    

Expected behavior
File is found, font loads.

Additional context
The published package has these files containing variable in their name in its files directory:

  • public-sans-latin-ext-variable-wghtOnly-italic.woff2
  • public-sans-latin-ext-variable-wghtOnly-normal.woff2
  • public-sans-latin-variable-wghtOnly-italic.woff2
  • public-sans-latin-variable-wghtOnly-normal.woff2

Yet the variable-full.css file is referencing

  • ./files/public-sans-latin-variable-full-italic.woff2
  • ./files/public-sans-latin-ext-variable-full-italic.woff2
  • ./files/public-sans-latin-variable-full-normal.woff2
  • ./files/public-sans-latin-ext-variable-full-normal.woff2

This problem appears to exist in other variable fonts too, such as fontsource-work-sans.

@tremby tremby added the bug Something isn't working label Dec 9, 2020
@mshuster
Copy link

mshuster commented Dec 9, 2020

One additional artifact I've found is that obviously invalid filename references are being generated in some cases by some variable font families e.g.

src: url('./files/inter-cyrillic-variable-full-oblique 0deg 10deg.woff2') format('woff2');
https://github.com/fontsource/fontsource/blob/master/packages/inter/variable-full-normal.css#L7

Seems most related to oblique variants.

@ayuhito
Copy link
Member

ayuhito commented Dec 12, 2020

Resolved in #110. There no longer is any 'full' variant generated for fonts that do not need it since they only have a wght and ital axis.

@ayuhito ayuhito closed this as completed Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants