I am looking at the source code of a project where a licensed font from myfonts.com is used.
The css file contains this -
/* @import must be at top of file, otherwise CSS will not work */ @import url("//hello.myfonts.net/count/123d4d"); @font-face { font-family: 'SoliPx'; src: url('webfonts/123D4D_1_0.eot'); src: url('webfonts/123D4D_1_0.eot?#iefix') format('embedded-opentype'),url('webfonts/123D4D_1_0.woff') format('woff'),url('webfonts/123D4D_1_0.ttf') format('truetype'); }
And as mentioned in the source urls - there are eot, woff, ttf files in the local webfonts folder of project.
I know how @font-face and webfonts work in general.
But in the case above where a licensed/commercial font is used, I don't see any font files downloaded in Dev Tools, but the text is rendered with the specified font.
There is a net request that goes to hello.myfonts.net/count/123d4d
with status 200 and response content-type
of "text/css" but nothing in the response body.
What is happening internally? How this is working?
Webfont licenses allow you to embed that font in the code for a website or email. So, whereas you might use a desktop license to create a static image (like a . jpeg) you upload to your website, a webfont license facilitates the implementation of the font in the actual code of your website.
Font rendering is the process by which operating systems take text and turn it into display text. It has stayed relatively static for decades, but big things are happening-learn about how web fonts are turning the game upside-down.
I've dealt with this before, and here is what that imported file does:
As far as actually loading the fonts, it does nothing. I've left it out before (while testing) and the fonts load fine from my server.
It counts the number of times the files is imported by your CSS (hence the /count/
in the URL). If you read the myfonts.com webfont license, most of the webfonts come with a monthly pageview cap. If you pass that cap myfonts will want to charge your account again, or suggest you purchase a new license with a higher cap.
So what we really have here is an API endpoint that returns an empty CSS file. Every time that CSS file is loaded, myfonts adds a +1 to the number of monthly page views to the account that corresponds with the hash at the end, in your case 123d4d
.
Once again, it has nothing to do with loading the fonts themselves. You have the files on your server, and they will load when referenced—full stop.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With