nternetinspired/OneWeb

Google fonts option in Backend

Closed this issue · 3 comments

When I try to delete the reference to Google Font Lato in backend, it gets filled in again after saving beacause the Lato font is defined as default text in templateDetails.xml, line 49.

I suggest adding 2 radio buttons in backend where we can choose whether to use Google fonts or not.

EDIT: I made a pull request that reflects these changes.

Not a big issue, really. But many sites use custom webfonts that don't come from Google. In that case we have to comment out the whole Google font stuff in logic.php.

If I may suggest it, you may find what I did for the Construct framework useful here. It uses Google's API to populate and up-to-date list of available Google web fonts, with a none selected option. You can see the code at https://github.com/construct-framework/bootstruct/blob/master/elements/googlewebfont.php.

If there is interest in this, I can see about adding it here via a pull request.

@betweenbrain I did previously use the same method, taken from Construct Pro. The reason I switched was a) to reduce the amount of logic required to grab a css url from Google and b) to allow the use of collections with specified font-weights.

Doing it this way means I can link to any number of font families / weights with a single URL and a single template option. It also means that fonts from different providers can also be used (provinding it's a css link).

For v4 I think I'll simply make this an 'insert custom link' option that will allow the use of any hosted webfonts, including those requiring a .js link in the head, like TypeKit or Adobe Edge fonts.

I think calling webfonts like you propose for v4 is a good idea.

If the 'insert custom link' is left empty then it will be ignored,
right?

That way we could use @font-face in our css without linking
to external font sources at all.

I'm asking because I often get web fonts (from WebFontKit and the like)
for projects delivered from my customer and put them into the fonts
folder.

Am Tue, 03 Dec 2013 01:24:09 -0800
schrieb Seth Warburton notifications@github.com:

@betweenbrain I did previously use the same method, taken from
Construct Pro. The reason I switched was a) to reduce the amount of
logic required to grab a css url from Google and b) to allow the use
of collections with specified font-weights.

Doing it this way means I can link to any number of font families /
weights with a single URL and a single template option. It also means
that fonts from different providers can also be used (provinding it's
a css link).

For v4 I think I'll simply make this an 'insert custom link' option
that will allow the use of any hosted webfonts, including those
requiring a .js link in the head, like TypeKit or Adobe Edge fonts.


Reply to this email directly or view it on GitHub:
#2 (comment)