There are more Google fonts now. Maybe it's better let user to input the font name rather than select in limited options.


Jeff Burnz’s picture

Status: Active » Closed (won't fix)

Instead in 7.x-3.x I built integration with @font-your-face module which solves many issues, it gives access to all Google fonts, font variants (such as Latin and Greek), previews and handles all the font loading itself.

Jeff Burnz’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Closed (won't fix) » Active

I think this could work if the user is not inputting the font name but rather the entire link element as supplied by Google Fonts, e.g.:

<link href=',latin-ext' rel='stylesheet' type='text/css'>

That I think can work, this gives access to all character sets and removes the necessity to maintain a list, and removes a tonne of code from 7.x-3.x.

The one very small issue with this is supporting https, however user can simply change the protocol to suit, I think this can work.

Jeff Burnz’s picture

I will test with various ideas around this, how to make this clean and workable. I usually dislike working with strings and user input at this level but I can see if I can make this work in a sensible way.

Jeff Burnz’s picture

Category: feature » task

This runs into some pretty immediate issues:

  • harder for end users to understand what needs to be done.
  • how to support multiple fonts without compromizing performance for the end user, we don't want to force multiple http requests when Google can accept one and return all fonts, this means the original idea of just adding the font name is more workable, because...
  • #states makes this tricky in Drupal 7.12, in 7.13 #states will support the OR option, this could be important depending how it will work in the UI and when 7.13 will ship

So, I think the original idea of adding the Font Name only could be the way to go, we have never provided a way to declare a fall back font-family for these fonts, aka inputting cursive, sans serif etc, so I don't see that as a major issue we really need to deal with.

I'm gonna test with just the Font name and see how that goes, there is substantial code for supporting this in the theme already and would get us away from having to deal with strings really late in the page request, we can use drupal_add_css() in our normal google font loader, albeit with some modifications (and likely performance benefits).

Right now I am pretty sold on this, its a good idea, despite my initial reluctant feelings.

Jeff Burnz’s picture

Status: Active » Needs review

I committed an implimentation to DEV, it uses the Font name and allows for adding extra styles and character sets. I am reasonably happy with it:

- like the new flexibility, styles, character sets and its faster (better performance)

- dislike the added complexity and additional form elements

Its a trade off, more complexity for more flexibility, although I would like to keep an open mind to the UI and see if we can reduce the complexity of it even more, to make it less intimidating to new users but not loose any of the features.

Jeff Burnz’s picture

Status: Needs review » Fixed

Done, had good feedback from some other users and this is working pretty good. Its going forward and into the RC today.

Jeff Burnz’s picture

Status: Fixed » Closed (fixed)

Cleaning up.