Skip to content

Allow to import character subsets other than Latin#45

Open
erykpiast wants to merge 2 commits into
KyleAMathews:masterfrom
erykpiast:master
Open

Allow to import character subsets other than Latin#45
erykpiast wants to merge 2 commits into
KyleAMathews:masterfrom
erykpiast:master

Conversation

@erykpiast

@erykpiast erykpiast commented Dec 6, 2017

Copy link
Copy Markdown

Solves #21

@erykpiast

Copy link
Copy Markdown
Author

@KyleAMathews could you look at this, please?

@koutsenko

koutsenko commented Dec 18, 2017

Copy link
Copy Markdown

@KyleAMathews , any progress? Please add font subsets

@erykpiast

Copy link
Copy Markdown
Author

@KyleAMathews ping :)

@KyleAMathews KyleAMathews left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looking good!


//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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Author

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

@KyleAMathews

Copy link
Copy Markdown
Owner

👍

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

@erykpiast

Copy link
Copy Markdown
Author

@KyleAMathews, which version of node do you use?

@KyleAMathews

Copy link
Copy Markdown
Owner

8

@erykpiast

erykpiast commented Dec 22, 2017

Copy link
Copy Markdown
Author

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
Copy Markdown
Owner

Video link isn't working.

@erykpiast

Copy link
Copy Markdown
Author

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

@KyleAMathews

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Author

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

@erykpiast

Copy link
Copy Markdown
Author

@KyleAMathews ping

@erykpiast

Copy link
Copy Markdown
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
Copy Markdown
Author

It's three months now :(

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

ryall commented Mar 13, 2018

Copy link
Copy Markdown

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

@erykpiast

Copy link
Copy Markdown
Author

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

@ryall

ryall commented Mar 13, 2018

Copy link
Copy Markdown

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

@jsardev

jsardev commented Apr 18, 2018

Copy link
Copy Markdown

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

@koutsenko

koutsenko commented May 15, 2018

Copy link
Copy Markdown

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

@erykpiast

Copy link
Copy Markdown
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

koutsenko commented May 15, 2018

Copy link
Copy Markdown

@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

erykpiast commented May 15, 2018

Copy link
Copy Markdown
Author

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

@dusek

dusek commented Jul 12, 2018

Copy link
Copy Markdown

@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

chpio commented Sep 25, 2018

Copy link
Copy Markdown

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
Copy Markdown

@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
Copy Markdown

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

@erykpiast

Copy link
Copy Markdown
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
Copy Markdown

I need koho not roboto

@xuhcc

xuhcc commented Dec 6, 2019

Copy link
Copy Markdown

@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.

10 participants