redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

Googlefont problem: Wrong stylesheet link in Header when using only Standard-Fonts

Open FrankyG opened this issue 12 years ago • 9 comments

I have googlefonts enabled at my typography fields. But when I select only Standard fonts (let's say Arial, Helvetica...) at all Typography fields the googlefont stylesheet link is still set into the header:

<link rel="stylesheet" id="options-google-fonts" href="//fonts.googleapis.com/css?family=Arial,+Helvetica,+sans-serif:400&v=1389725499" type="text/css" media="all">

FrankyG avatar Jan 14 '14 18:01 FrankyG

Confirmed. I see this as well. I'm on it.

kprovance avatar Jan 14 '14 19:01 kprovance

Okay, updated field_typography. See if that does it.

kprovance avatar Jan 14 '14 21:01 kprovance

Thanks for the quick change, but it doesn't seem to work. I have one typo field with Arial and one with Google-Font (f.e. 'Abel'). Now I do not see any <link rel="stylesheet" ... in header any more and the google font is not loaded.

FrankyG avatar Jan 15 '14 11:01 FrankyG

Let me post my configuration for type fields. Maybe I miss something?

        array(
            "title"         => _x("Typography H1 Headline", "backend", "xxx-theme"),
            "desc"      => _x("Pick the Typo for H1 Headlines", "backend", "xxx-theme"),
            "id"            => "opt_mainh1font",
            "default"    => array(
                                'color'=>"#ccc", 
                                'font-style'=>'400', 
                                'font-family'=>'Arial, Helvetica, sans-serif', 
                                'font-size'=>'1.500em', 
                                'line-height'=>'1',
                                ),
            "type"      => "typography",
            "google"     => true,
              "font-backup" => true,
            "units"      => 'em',

FrankyG avatar Jan 15 '14 11:01 FrankyG

So I understand you correctly: You are selecting 'Abel' in the primary font selector, and Arial, etc in the backup font selector?

kprovance avatar Jan 15 '14 17:01 kprovance

No Kevin, I have 2 Typo fields (Let's say: H1 Headline and H2 Headline). In the first I select Arial and in the second Abel.

FrankyG avatar Jan 15 '14 18:01 FrankyG

Okay, @FrankyG. I just pushed another build. I think I have it this time. With so many different conditions to test under, it difficult to say with 100% accuracy. That said, if this doesn't nail it, let me know! Also, font-backup should now also work. FYI, it should not append to Google fonts CSS in your HTML. It will only append to font-family via output or compiler, which I think was the original intent.

kprovance avatar Jan 15 '14 20:01 kprovance

@kprovance Thanks, Kevin. It works now. The only thing I was wondering about and I had to change was the 'default' 'font-family' content. I had to get rid of all blanks, because my default was 'Arial, Helvetica, sans-serif' and has to be 'Arial,Helvetica,sans-serif' (without blanks) now. I think, this could happen to a lot of users - It's not compatible... But thanks a lot for the quick fix.

FrankyG avatar Jan 15 '14 22:01 FrankyG

3.1.5 now fixes the comma space issue.

kprovance avatar Jan 16 '14 00:01 kprovance