Open kettanaito opened 8 years ago
I think that with webfont loader you can use also custom fonts, we use webfont loader on Zindulka website I think
Of course. I am talking here more about folder structure. Where and how to store the fonts, concating them, etc. Later they may be loaded via WebFont or other loader.
It would be good to make some gulp automatization for type conversion too, but I don't know if it's possible (like fontsquirrel does), to translate one font format into all required (ttf => otf, woff, etc.)
đź‘Ť to including fonts into dev-stack. Take a look into this article. As a first step we could implement FOUT with class solution.
After talking with @ronaldruzicka, it is a good point for us to discuss which font loader to use. We can do that on Front-end meetings :)
Just discuss it here. Please prepare some pros and cons. Thanks
A much bigger question is independent script including.
What I mean I mean that for a proper work, both FaceObserver and WebFront should be included the following way:
<head>
...
<script src="js/webfontloader.js" async></script>
</head>
I have, actually, implemented a similar vendor javascript usage on eContracting, where we have 3 separate JS files, which we need to reference separately. We may use that approach, and then include font loader in the head directly.
Regarding the aforementioned question, I have implemented a solution to take each JS file in /app/vendor/
folder, run it through babel and browserify, exporting a single bundle for each file. This allows us to use those on-demand files separately when needed, while still keeping comfort during development with ECMAScript and all the other great features.
@kettanaito Is this one still relevant?
@vbulant I haven't got much time to finish this. I know @janpanschab has provided the solution, so maybe try asking him if this issue may be covered by it. Thanks.
Implemented solution is basically for fonts from CDN - google fonts, etc.
OK so to move into some direction…
This issue is about self-hosted fonts. Regarding FOUT/FOIT/whatever – let’s open a separate issue for that once needed.
Back to @kettanaito’s proposal (the original on the very top): It looks neat but do we really need that? What is the benefit? Usually we define fonts once and then use them so I think having a pipeline is quite extraneous.
I have been working on one project recently, and it turned out our gulp dev stack does not provide support to easily include self-hosted fonts. While the most options may be imported via Google Fonts or Typekit, sometimes clients use their own fonts.
Suggestion: We can add something similar that I have implemented on one of the projects:
Overall example structure looks like this:
With a respective tasks it makes adding new fonts pretty easy:
What do you think of that?