Skip to content
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

Allow to import character subsets other than Latin #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

erykpiast
Copy link

@erykpiast erykpiast commented Dec 6, 2017

Solves #21

@erykpiast
Copy link
Author

@KyleAMathews could you look at this, please?

@koutsenko
Copy link

koutsenko commented Dec 18, 2017

@KyleAMathews , any progress? Please add font subsets

@erykpiast
Copy link
Author

@KyleAMathews ping :)

Copy link
Owner

@KyleAMathews KyleAMathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

@@ -13,8 +13,8 @@ const { packageJson, fontFace, readme } = require(`./templates`)
const download = require(`./download-file`)
const commonWeightNameMap = require(`./common-weight-name-map`)

//const baseurl = `https://google-webfonts-helper.herokuapp.com/api/fonts/`
const baseurl = `http://localhost:9000/api/fonts/`
const baseurl = `https://google-webfonts-helper.herokuapp.com/api/fonts/`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! Done :)

@KyleAMathews
Copy link
Owner

Tried it locally but it doesn't seem to be working.

Try running it locally:

  1. clone https://github.com/majodev/google-webfonts-helper
  2. Install its dependencies and start its server by running npm start
  3. Try creating a google font file — node scripts/create-package-from-google-font-id.js roboto

@erykpiast
Copy link
Author

Okay, I admit I didn't test with local URL, I'll try this.

@KyleAMathews
Copy link
Owner

👍

Please post h ere the diff you get when it works.

@erykpiast
Copy link
Author

@KyleAMathews, which version of node do you use?

@KyleAMathews
Copy link
Owner

8

@erykpiast
Copy link
Author

erykpiast commented Dec 22, 2017

Alright, I cannot make google-webfonts-helper working with node v8, it's works on v0.10 though (typefaces repository works great on v8 and v9). I cannot say more than it works for me :P Clean node modules installation. Here is a video to prove it (maybe you will notice if I do something differently than you?)

@KyleAMathews
Copy link
Owner

Video link isn't working.

@erykpiast
Copy link
Author

Agrr, sorry for this. Privacy settings. Try it now.

@KyleAMathews
Copy link
Owner

Oh hmmm sorry — I ran yarn in typefaces and it started working, oops!

So yeah, managed to generate a bunch of new css files.

I'm not familiar with loading font files for additional languages. Can you really just require the latin & greek versions together? And the browser will figure it out? Looking at the CSS files, it seems they'd clash with each other since the @font-face stuff is the same except for which file it's pointing to.

@erykpiast
Copy link
Author

Yeah, this solution has a major flaw - it's not possible to include Greek AND Cyrillic charsets on the same page. I've copied default behavior of google-webfonts-helper, that means cyrillic.css contains Cyrillic and Latin characters, greek.css includes Greek and Latin and so on. This info is included in updated README of each font package I believe.

Well, there is probably better (I mean "ultimate") solution for this issue, like dynamically created CSS files for every possible combination of charsets, but until we want to stick to static files (which is quite good in my opinion, because it's simple), this one is the best approach I came with. Notice this one isn't breaking change, it shouldn't be major version update even :) So next iteration may be making it more generic/elastic.

The other idea I have is to create second sets of packages, like typeface-roboto-multilang and keep this one as it is for now, so it could be extended in more universal manner once we find out how.

@erykpiast
Copy link
Author

@KyleAMathews Is there a chance for you to come back to it this week? :)

@erykpiast
Copy link
Author

@KyleAMathews ping

@erykpiast
Copy link
Author

Hey, it's now more than two months since I've opened the PR. Could we do something with it, just move on?

@erykpiast
Copy link
Author

It's three months now :(

@erykpiast erykpiast closed this Mar 12, 2018
@erykpiast erykpiast reopened this Mar 12, 2018
@ryall
Copy link

ryall commented Mar 13, 2018

Just a note, while waiting for this to be merged, would be useful to add usage instructions to the README.md

@erykpiast
Copy link
Author

@ryall It is in README. The one inside generated package :) Look at scripts/templates.js.

@ryall
Copy link

ryall commented Mar 13, 2018

Ah sorry! I didn't realise it was generated :)

@jsardev
Copy link

jsardev commented Apr 18, 2018

Would love to see this feature too. Waiting for ya, Kyle!

@koutsenko
Copy link

koutsenko commented May 15, 2018

And what we must to do now to install specific subsets?
For example, roboto cyrillic?

@erykpiast
Copy link
Author

@koutsenko you can get this particular one through this package: https://www.npmjs.com/package/typeface-roboto-multilang. I've published it with code from this PR.

@koutsenko
Copy link

koutsenko commented May 15, 2018

@erykpiast thnx, but i already switched to roboto-fontface package.
The only reason i tried to use typeface-roboto package was an material-ui-next project recommendations.
Why your work wasn't merged here?

@erykpiast
Copy link
Author

erykpiast commented May 15, 2018

Yeah, I also found this project because of Material UI :)

@dusek
Copy link

dusek commented Jul 12, 2018

@KyleAMathews ping about merging this please? Lack of support for Latin Extended stopped me from using typeface-hind (which looked really promising to streamline font installation and deployment), having to unfortunately devise some manual method of downloading and importing fonts which I am doing right now. Life would be just so much easier if I could use typeface-hind for Latin Extended (and not only for Latin). Thanks.

@chpio
Copy link

chpio commented Sep 25, 2018

how about including just the "full" source font file and let the user build the needed fonts by them self? you could include a simple Promise based tool, this should be a simple solution for this issue.

import gulp from 'gulp';
import fontUbuntu from 'typeface-ubuntu';

gulp.task('font', () => fontUbuntu({
  charsets: ['greek', 'latin'],
  styles: ['regular', '300'],
  dest: 'path_to_dest_directory',
}));

@davelab6
Copy link

@KyleAMathews one of the issues with not using GF API is that the API now uses unicode-range; it would be good to avoid this whole issue by doing the same :)

@cezarneaga
Copy link

@KyleAMathews could this PR work? would need this too!
thanks!

@erykpiast
Copy link
Author

@cezarneaga I've published this version of the project (Roboto font only) as the [separate package] (https://www.npmjs.com/package/typeface-roboto-multilang). Readme is not adjusted, so use it like require('typeface-roboto-multilang/latin-ext.css');

@cezarneaga
Copy link

I need koho not roboto

@xuhcc
Copy link

xuhcc commented Dec 6, 2019

@cezarneaga Take a look at this fork https://github.com/bedlaj/openfonts/tree/master/packages/koho_all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants