-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
[SOLVED] Local webfonts not working #3665
Comments
Update : The path resolution of css urls seems to be case sensitive. I did put "Roboto" with an uppercase "R" inside the url() of font-face in fonts.css, whereas the files names have a lowercase "r" for "roboto". I corrected it, but the fonts were still not loading. I tried deleting this line in fonts.css : And then used relative paths in @font-face urls, such as :
And the problem seems to be solved. Sorry for this. You can close the case :) |
Hi, it is actually work in my project.. |
In the vuejs project I am working on, This one did not worked:
This worked:
And I've observed that if we use the solution without double quote for one single time and then add double quotes, it again works! If anyone know what's happening here, please do answer. Solution: |
closes vuejs#2547 closes vuejs#5032 I'm still very hesitant on adding this feature, though. First, this change allows project creation in a folder with uppercase letters in its name. It is strongly discouraged and may cause many weird issues all over the ecosystem. For example, vuejs#5022, vuejs#4424, vuejs#3665, vuejs#4174#issuecomment-569709494 are all caused by case issues. Adding support for uppercase project names will only worsen this situation. Secondly, it adds a lot of maintenance burden to us. As noted in the comments, these prompts are hard to test right now (because `createTestProject` runs in another process so it's hard to intercept the prompts). Even if such test utilities are added in the future, it's still very tedious to take care of all the case issues in the test suite. What's worse is that we can affect the project folders created by @vue/cli by converting the project name to lower case. But for `vue create .`, we cannot change the current folder's name. So, we'll have another edge case to test.
This worked for me as well |
This also worked for me. Happy new year! |
Version
3.5.1
Environment info
Steps to reproduce
Hello everyone,
I made a simple Vue Cli project using default configuration.
In src/assets I created both a "css" and a "fonts" folders.
In the "fonts" folder I pasted those font files :
These font files have been generated via https://www.fontsquirrel.com/tools/webfont-generator ...
But for an easier reproduction, I guess you can use any kind of font file you want. For my example I'll keep it to Roboto regular and black.
In the "css" folder I created those files :
fonts.css contain this code :
Then I edited the src/App.vue like this :
Then I did a npm run serve to test it.
What is expected?
On localhost website :
"Hello," should use Roboto font regular. "World" should use Roboto font black.
What is actually happening?
No fonts seems to be deployed via Dev Tool > Sources, thus, the website shows no custom local webfonts...
My fonts are stored in "./src/assets/fonts/"
I call the css inside the App.vue.
The css "fonts.css" should call the fonts but it doesn't.
When I build the project, the fonts aren't copied in the dist folder.
I'm a neophyte trying to code my own portfolio with Vue Cli 3 and I can't get past this issue.
I don't understand where the problem is... Does anyone have an idea why the fonts doesn't load when served or build ?
Thanks in advance !
The text was updated successfully, but these errors were encountered: