-
Notifications
You must be signed in to change notification settings - Fork 763
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
The 'medium' is an incorrect font-weight and fonts with it doesn't preloaded #246
Comments
I just discovered that as a workaround I can just rename the file @font-face {
font-family: 'Merel';
font-style: normal;
font-weight: 500;
src: local('Merel 500'), url('/fonts/merel/Merel-500.woff2') format('woff2');
} |
Glad you found a solution! This does sound more like a browser related issue. PreloadJS just downloads the file, its up to the browser to use & render it. |
Hello! I want to revive this issue. I bumped into the same behavior and I found the issue lies in the absence of the "medium" name into the font weight map for the I have created a PR #270 that fix this issue. Please review at your soonest. |
Sorry about the late response. I don't think that's a browser problem. I see the problem with the css produced by PreloadJS. In the case of 'Merel', 'Medium' is a part of the font name, rather then weight. And |
And I can confirm that the #270 did the job. |
I also recommend adding other missing names from the specification to the dictionary:
|
Hi @TrueXakeP! Thanks for your valuable input. It seemed that most of the definitions were already there but I added "normal" and "bold" anyway, for the sake of completeness. Let me know your thoughts. Hopefully, CreateJS authors will be ok to incorporate this. |
Hi @elussich! I appreciate your contribution. I didn't have time to dig into this before. Now I see that only "Medium" was missing. I think that the names of the weights that are the correct values of 'font-weight' property can be kept as-is (as words). So let me take back what I said in #246 (comment) |
By that, I mean, they don't even have to be on the list. I also hope that your PR will be accepted soon. I have no power over this. |
First sorry for my english.
I have a font 'Merel'. I use it in my web-app in two weights 500 and 300.
With PreloadJS 1.0.0 this JS code:
produces this CSS:
But regarding to MDN the
medium
is an incorrect value for thefont-weight
property. And I see in the console of myChromium 64.0.3254.0
andFirefox Nightly 59.0a1
that Merel-Medium is loaded only after I make a visible element that uses it. And also I see that "Flash Of Unstyled Text" in that moment.This is also happened when I specify 'medium' as a weight in a css or object definition.
When I specify font-weight as the '500' then the font preloads correct. But in that case I can not use short array definition as a list of files.
The MDN says that correct font weights are:
normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
Also the PHPStorm tells me that 'medium' is invalid value for the 'font-weight' property when I try to use it in my styles.
The text was updated successfully, but these errors were encountered: