I have success installing and configuring the module, very easy. The enabled font (Google) displays in the admin theme and all standard themes that come with Drupal install but not in my custom Drupal theme. I added the line "fonts[google_fonts_api][] = "Coming Soon&subset=latin#regular" into my theme.info file but no luck. I'm sure I am missing something simple.
Also, after importing a local font (which I would ideally like to do) it displays in all the standard Drupal themes but not my custom theme (as above). And when I go to get code to add to the theme.info file it says, "Local font 'Burst My Bubble normal normal' can not be included in a theme.info file because it can not be loaded via URL."
I've looked through documentation and issues here but not found a solution.
This is for site farmforklife.com. Hoping you can help and point out what I am missing. Thanks in advance!
Comments
Comment #1
sreynen commentedI think the first issue might be covered here: #1444708: Fonts enabled in theme .info are never disabled. If not, please set this issue back to "active" and explain what exactly you mean by "no luck."
For local fonts, there is no solution. We don't have any way to load those files from the theme. If your theme is for a specific site, you could maybe load them via the module and not include them in the theme at all. If you need it to load in the theme, probably your best bet is to actually put the font files and the CSS in the theme directory and skip the module entirely, though that's more complicated.
If any of this is unclear, please ask for clarification and set this back to "active."
Comment #2
alaugh commentedThanks for getting back to me so quickly! Sorry I wan unclear with "no luck". Let me try to explain more clearly, ignoring the issue of local fonts as there is no solution.
After I install the module and enable the font, the enabled font does display within the standard themes that come with the Drupal install. But it does not appear in the theme I created for the site.
When in Appearance I click on "In Theme" and grab the syntax there which is: fonts[google_fonts_api][] = "Coming Soon&subset=latin#regular"
I then paste that into my theme.info file, but the font still does not apply in that theme.
I read through the link you sent me to the other issue but am not seeing my solution in there.
Comment #3
alaugh commentedI just figured it out. I needed to make a tweak to my CSS file for the theme. While copy and pasting the syntax to theme.info I needed to change the font-family lines in the CSS.
Comment #4
sreynen commentedThanks for following up.
Comment #5
geekyMoa commentedI'm having what seems to be the exact same problem.
aleclaughlin, could you explain #3?
What exactly did you write in your CSS file? I have changed the font-family lines in the CSS to the font name, but the font is still not showing up in my custom theme, it's only visible in the admin theme (Seven). I do, however, get another, locally uploaded font to show.
Random musing: The font is Six Caps, could it be related to an issue about Google fonts with spaces in their names not working properly? I vaguely recall seeing something about this being a problem, but I can't find anything about it.
Comment #6
sreynen commentedThat's because no one opened an issue. Your comment was the first I've heard about this problem, thanks. You should put quotes around "Six Caps" in your CSS. The UI should be suggesting quotes, and I opened an issue to fix that bug: #1475146: "add selector in theme CSS" should suggest quotes around font names that include spaces.
Comment #8
Tokoh commentedI'm not sure if I should start a new thread for this but I have a problem that I think is related.
I have created a local font "Bank Gothic" for my site and I want to apply it to a theme other than a core theme but on the same site.
So I use the MAYO theme and its located in sites/all/themes. The @font-your-face module is in sites/all/modules and the local font has been loaded by @font-your-face and is in sites\default\files\fontyourface\local_fonts\Bank_Gothic-normal-normal.
I want to use the local font with the sites MAYO theme, so...
When I go to Appearance, click the @font-your-face tab and click the In Theme link I get the message:
; Local font 'Bank Gothic normal normal' can not be included in a theme.info file,
; because it can not be loaded via URL.
I can sort of understand why a link cannot be provided to a site remote from the server if the server is not public, but in this case the font and the theme are on the same machine. Isn't there a way to add the font's css files to the theme's info file?
Comment #9
sreynen commentedHi Tokoh,
Make sure you change the status when commenting in a closed thread. It's very easy for such comments to get lost.
Applying the font in your theme's CSS is different from loading the font files within your theme. The terminology is a little confusing, but it sounds like all you want to do is select "add selector in theme CSS" under "Enabled Fonts" -> "By font".