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

[Next] Allow importing font files directly #93

Open
mwskwong opened this issue Mar 8, 2024 · 0 comments
Open

[Next] Allow importing font files directly #93

mwskwong opened this issue Mar 8, 2024 · 0 comments
Labels
bug Something isn't working where: package The issue corresponds to the distribution package

Comments

@mwskwong
Copy link

mwskwong commented Mar 8, 2024

This is not a bug, but a RFC. Since there isn't a way to open a GitHub issue or discussion for topics other than bugs, I guess this is the only way.

I would like to propose allowing users to directly import the font files. i.e. .ttf and .woff2 files in the geist package. This can be done by adding a new entry on the package.json, e.g.:

diff --git a/node_modules/geist/package.json b/node_modules/geist/package.json
index a18fe0d..6860b2c 100644
--- a/node_modules/geist/package.json
+++ b/node_modules/geist/package.json
@@ -49,7 +49,8 @@
       "import": "./dist/sans-non-variable.js",
       "require": "./dist/sans-non-variable.js",
       "default": "./dist/index.d.ts"
-    }
+    },
+    "./assets/fonts/*": "./dist/fonts/*"
   },
   "license": "SIL OPEN FONT LICENSE",
   "peerDependencies": {

This is beneficial when the users need to refer to the font files themselves. e.g. when creating opengraph-image.tsx.

@mwskwong mwskwong added the bug Something isn't working label Mar 8, 2024
@guidoferreyra guidoferreyra added the where: package The issue corresponds to the distribution package label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working where: package The issue corresponds to the distribution package
Projects
None yet
Development

No branches or pull requests

2 participants