-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
find a way to generate fonts like google does #1
Comments
Metrics that are used by Google's version of font that matter: unitsPerEm: 512 Problem with FontForge is when it generates font in TTF, WOFF or WOFF2 format, it changes ascent and lineGap values. For TTF it sets ascent to 469, for WOFF to 470. Simple way to test generated metrics:
So far I had success with this process:
Problem is this process is too complex, it would be nice to have one tool to generate fonts from SVG. |
thanks for the info.
guessing google uses https://github.com/google/woff2 to generate woff2 |
seems they use fontforge to generate the fonts. some traces from the compiled font info my guess - they have a template icon and in their build process they copy it and populate with icons. then export a font files (ttf + woff) they goat icon probably is the only thing in the template, preserving some settings |
Possibly, but that tool only compresses/decompresses fonts, font has to be created first. I did some more tests on WOFF and WOFF2 files. FontForge generates mess. WOFF2 files are actually bigger than WOFF, so there is definitely something fishy going on. Files generated by FontForge:
Then I found these packages: https://github.com/fontello/svg2ttf https://github.com/fontello/ttf2woff and https://github.com/nfroidure/ttf2woff2 Using those packages to convert SVG font (generated by FontForge + custom fixes) to other formats, sizes make more sense:
So I think way to go is this:
|
I think we can do it 100% fontforge. for instance the representation of
|
struggling to understand how to properly convert an svg file (specifically the shape) to this is baseline-wallpaper-24px.svg from material.io
this is the matching part in the
haven't found a good way to convert a shape/svg to the fontforge
the result is different :/
|
I think using FontForge's importOutlines is best way to go. Shapes are not always simple, there are masks in some icons, multiple paths. FontForge seem to be able to handle them very well. |
asked here https://stackoverflow.com/q/56506104/3191896 |
Just letting you know that I haven't abandoned this, just didn't have any time to work on it yet. Also I'm working on icon finder script that can be used to list and search icons that will be very useful for this set. |
👍 |
There are some good news. Google has published new meta data for icons in easy to use format. URL: https://fonts.google.com/metadata/icons It is up to date with font, so instead of parsing font you can just grab meta data to get list of available icons. They have also fixed all broken icons. No more black squares. |
I've made a script for pulling latest icons and building font. Here is result (font, css, sample file): For import I've used this method:
Take a look at sample. Most icons are working correctly. However many have weird circles. So there are issues. But at least process is working and every step is separate so its easy to adjust. |
Done! Fixed everything. Broken icons were because of bug in FontForge. It doesn't support compressed arcs in shapes. Also found few other bugs. I'll clean up and publish everything this week. Current plan is to make several repositories:
For svg repository I'll just rename my old repository. No point in duplicating. |
Published build scripts, font, moved my old SVG and PNG repositories to this organisation. Later will update readme files and create pages for list of icons. SVG: https://github.com/material-icons/material-icons Closing this issue. |
nice! good job mate! |
No, unfortunately its not possible for two tone icons. |
Updated everything. Check out readme for syntax: https://github.com/material-icons/material-icons-font Also test page with all icons: https://material-icons.github.io/material-icons-font/samples/test.html |
bravo man. impressive. regarding syntax
I can offer help making a demo page |
Codepoints are stored in data.json in font repository, so builds always return same code points. Class names: that makes sense. I do like that. It would be easy to transition to such class names from ligatures. For font variations then maybe additional classes like material-icons-outline instead of current md-? Demo page: thanks, that would be nice. |
Class names won't work for some icons such as "3d_rotation" because class name cannot start with number. So icons must have some prefix. |
Created new build. Icon class names are changed to use underscore, like in old ligatures, but with md- prefix: <i class="material-icons md-signal_wifi_4_bar"></I> Also changed class names for font variations a bit. Instead of adding extra class, main class can be changed to use font variations, like material-icons-twotone for two tone icon: <i class="material-icons-twotone md-videocam_off"></i> |
About directory structure of fonts repository. Do you think it would be a good idea to change it to match your font's repository, generate files like _variables.scss that exist in your repo? That way if you don't mind, your font repository can be moved here and new font added as new version. You currently have version 5.0.1 in package.json, this could be version 6.0.0 with slightly changed syntax, but same file names. It could give project more exposure and people might start requesting custom icons here instead of opening issues at google's unmaintained repository. |
see |
I see two issues with that idea:
|
good point, let's chat this weekend (hangouts) |
Can't. Tomorrow I'm leaving for almost a week. Maybe weekend after that? |
sure thing.
…On Thu, Oct 17, 2019 at 2:26 PM Vjacheslav Trushkin < ***@***.***> wrote:
Can't. Tomorrow I'm leaving for almost a week. Maybe weekend after that?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#1?email_source=notifications&email_token=AAJ2HOXGIALBGFZMY7CE7UTQPBDVTA5CNFSM4HPVKAY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBPYDDI#issuecomment-543129997>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ2HOVIG3PXZWCBMWHUL5LQPBDVTANCNFSM4HPVKAYQ>
.
|
:-D Any update ? |
Forgot about that and got distracted with other work. Everything in this repository should be working, including font. It doesn't use ligatures because as far as I know, it isn't possible to implement ligatures for two tone icons without some browser specific shenanigans, so it is similar to other icon fonts and works in older browsers. That is it uses classes and placeholders. See https://github.com/material-icons/material-icons-font I'll run update script to make sure all latest icons will be included. |
No description provided.
The text was updated successfully, but these errors were encountered: