J!Extensions Store™
Forum
Welcome, Guest
Please Login to access forum.
Google Font does not work if special characters are included (Example Roboto+Slab) (1 viewing) 
Go to bottom
TOPIC: Google Font does not work if special characters are included (Example Roboto+Slab)
#7711
camera obscura GmbH
Fresh Boarder
Posts: 4
User Offline
Google Font does not work if special characters are included (Example Roboto+Slab) Karma: 0  
Basically, Google fonts work. In my case, however, I would like to use the following font: Roboto and Robot Slab.

The code would then read as follows: Roboto+Slab|Roboto: 300,700.

That's not working. The source code says the following: Roboto%2BSlab%7CRoboto%3A300%2C700.

Any solution to the problem? The integration via @include under Custom CSS styles does not help either.
 
Logged Logged  
  The administrator has disabled public write access.
#7713
John Dagelmore
Admin
Posts: 3716
User Online Now
Re:Google Font does not work if special characters are included (Example Roboto+Slab) Karma: 79  
The google font encoding in this plugin supports only 1 single google font.

If you want to use a multiple syntax the code need to be customized.

You can change the line 959 in the file root/plugins/system/jamp/core/includes/helper.php from:

Code:

$fontEncoded = urlencode($customGoogleFont);
to:
Code:

$fontEncoded = str_replace(' ', '+', $customGoogleFont);
and specify the plugin parameter exactly as 'Roboto Slab|Roboto:300,700' so that the code will be: Roboto+Slab|Roboto:300,700 Other than this you can include the custom font family tag in the file root/plugins/system/jamp/core/includes/template/header.php
 
Logged Logged  
  The administrator has disabled public write access.
#7722
camera obscura GmbH
Fresh Boarder
Posts: 4
User Offline
Re:Google Font does not work if special characters are included (Example Roboto+Slab) Karma: 0  
Work, thank you.
 
Logged Logged  
  The administrator has disabled public write access.
Go to top