Jump to content
d.stukanov@gmail.com

How to add additional font subset (cyrrilic for example) when i use google webfonts

Recommended Posts

Hello. When i`m trying to apply google fonts to my content (navigation, page etc) it does not work despite the selected font have cyrillic subset. PL add the string into header like:

@import url(http://fonts.googleapis.com/css?v2&family=Patua+One:400|Andika:regular|Marck+Script:400); 
but to get russian fonts working correctly we need somethin like this:
@import url(http://fonts.googleapis.com/css?v2&subset=cyrrillic,latin&family=Patua+One:400|Andika:regular|Marck+Script:400);

How can i add subset without code modification ? P.S. Right now i`ve added hack to includes/class.typography.php (it does not work in base theme when moved to). Thank you.

Share this post


Link to post
Share on other sites

JFYI plugins/pagelines-googlefonts/fonts.json contains all information about fonts subsets.

	{
	   "kind": "webfonts#webfont",
	   "family": "Marck Script",
	   "variants": [
	    "400"
	   ],
	   "subsets": [
	    "cyrillic",
	    "latin",
	    "latin-ext"
	   ]
	  },
	

Share this post


Link to post
Share on other sites
Rob

I will forward this request to our developers to include these fonts in our next update. Is there any particular other font you would use?


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Thank you but It is possible that i will use any fonts available in google fonts plugin, it`s a bit complicated to build any plans about. May be you could handle font description (from font author) ?

Share this post


Link to post
Share on other sites
Rob

There are different ways of adding fonts. However, our developers are pretty good about including Google Fonts in our plugin when clients request them. In Dashboard > PageLines > Settings > Typography, there's an option to use either Cufon or Typekit to add different fonts. I'm not sure how this is actually done. This might help with Typekit: http://help.typekit.com/customer/portal/articles/6780-adding-fonts-to-your-site


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Sorry, but i did not understand your answer. I think it is just a bug i found in pagelines googlefont plugin that have to be fixed. So strange idea in adding fonts (400+) one by one or PL is focused only on english speaking customer (in this case sign that plugin does now work with other languages)? I don`t like to use Typekit or anything else, it was not my question.

Share this post


Link to post
Share on other sites
Henry Perkins

This is copied from another post I had made, but I believe this will work for you. Just select the font you want from google fonts and add them to your collection, then use the code google gives you. IE REPLACE: Alfa Slab One with the font(s) you would like to appear on your site.


---------------------

Okay, here's your solution Mr. :]

In plugins/pagelines-customize/functions.php add the following code:

 // add_action ('hook_name','function name'); add_action('pagelines_header_before','add_googlefonts'); // function name function add_googlefonts(){ ?>

 

Then, in your plugins/pagelines-customize/style.css, add this CSS:

 

h1, h2, h3 { font-family: 'Alfa Slab One', cursive; }

Share this post


Link to post
Share on other sites
justinroffmarsh

Can you please add the google font: Noticia Text in the next update too? When does the next update come out?

Share this post


Link to post
Share on other sites
Danny

Hi, The font Noticia is already available in the Google Webfonts plug-in.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
WebWerx

@[email protected]: I added the code as part of the site's Header script like this: "http://fonts.googleapis.com/css?family=Alfa+Slab+One|Montserrat' rel='stylesheet' type='text/css'>" (Change the font names to suit your needs). This way, even if the fine folks at PL have not added a new Google font, you still can! See @hperkins... I am still thinking about this nasty issue! ;-) CC @justinroffmarsh & @rangelone

Share this post


Link to post
Share on other sites
Jenny

@Henry 's suggestion will add the Googlefont to the nice little dropdown list shown in PageLines. Makes it easy to implement where the font dropdown is available. :) For the original poster, if you consider this topic resolved, please "accept" an answer - thanks!


Jenny :: Web designer at Simple Mama (follow me at @simplemamacom)

Check out Share Me, a social sharing add-on for DMS that is super simple to set up.

Share this post


Link to post
Share on other sites
Henry Perkins

I just want to add that using the @import method is bad practice as it blocks parallel downloads, meaning that the browser will wait for the imported file to finish downloading before it starts downloading the rest of the content.

  • Like 1

Share this post


Link to post
Share on other sites
elijahworkz

I have the same issue as topic starter and I don't think it's been resolved

The problem is not in adding fonts that have cyrillic subset - the problem is that pagelines does not specify it. You have to have subset specified in $gfont_base_uri - otherwise it will only work for latin

So the question is how to do it without editing the code itself. I manually change class.typography.php every time after upgrade so I can have cyrillic support for google fonts. Is there a way to use pagelines customize plugin to change it?

Share this post


Link to post
Share on other sites
seeyou30

Pagelines must elaborate this issue asap. We need full Cyrilic support. Period.

  • Like 1

Share this post


Link to post
Share on other sites
Simon

There is nothing to elaborate, there are numerous google font plugins on wordpress.org, someone has already given a couple of solutions, there is also a filter provided in the pagelines-customize plugin.
 

 

add_filter ( 'pagelines_foundry', 'my_google_font' );
function my_google_font( $thefoundry ) {
$myfont = array( 'Ubuntu' => array(
'name' => 'Ubuntu',
'family' => '"Ubuntu", arial, serif',
'web_safe' => true,
'google' => true,
'monospace' => false
)
);
return array_merge( $thefoundry, $myfont );
}

Share this post


Link to post
Share on other sites
elijahworkz

There is nothing to elaborate, there are numerous google font plugins on wordpress.org, someone has already given a couple of solutions, there is also a filter provided in the pagelines-customize plugin.

add_filter ( 'pagelines_foundry', 'my_google_font' );

function my_google_font( $thefoundry ) {

$myfont = array( 'Ubuntu' => array(

'name' => 'Ubuntu',

'family' => '"Ubuntu", arial, serif',

'web_safe' => true,

'google' => true,

'monospace' => false

)

);

return array_merge( $thefoundry, $myfont );

}

All this does is adds google fonts so you can pick them within pagelines site options. You seem to be missing the point - even if I add a google font that has cyrillic subset - it will not be displayed correctly by pagelines. All the text in english will use the font but all the text in cyrillic will not! In order for this to work it has to be specified in the @import url to use cyrillic subset - like this
@import url(http://fonts.googleapis.com/css?v2&subset=latin,cyrillic&family=PT+Sans+Narrow|PT+Sans+Caption);

It's this part that is missing - &subset=latin,cyrillic - and there is no way (that I found) how to add it. Like I said - I have been doing it manually in class.typography.php by just changing $gfont_base_uri variable
class PageLinesFoundry {


var $gfont_base_uri = 'fonts.googleapis.com/css?v2&subset=latin,cyrillic&family=';

but I have to do it after every upgrade.

If it's too hard to add an option to set a subset through site settings may be you can add a hook so it's possible to change the base uri variable?!

  • Like 1

Share this post


Link to post
Share on other sites
elijahworkz

Come on, guys... Can someone say something?!... Anything?!... I paid for Pagelines - can't I at least be acknowledged?!

Part of Pagelines functionality - i.e. ability to use google fonts - right now is limited only to the english language. Anyone who buys Pagelines and wants to use it in their language - Russian, Hebrew or Vietnamese (and wants to have google fonts) won't be able to without source hacking...

If you think it's OK and you don't want to fix it - at least say so... Any answer is better than silence...

Share this post


Link to post
Share on other sites
scanlondesign

I need museo slab and museo sans - purchased typekit but can't get it to register in the ozone theme.

Share this post


Link to post
Share on other sites
Rob

Please address the issue of Typekit not working on Ozone at the Ozone page in Comments. That developer should be made aware of it.  Typekit does work in PageLines Framework. http://www.pagelines.com/store/themes/ozone/

 

Nick is very good about replying to the comments.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×