- This topic has 7 replies, 2 voices, and was last updated 6 years, 9 months ago by Tom.
-
AuthorPosts
-
July 26, 2017 at 10:01 am #355318arabsworks
Hi Tom,
I try to add google arabic subset fonts in the child theme function.php nothing show in the typography google list with with following code:
add_filter(‘generate_fonts_subset’,’generate_change_fonts_subset’);
function generate_change_fonts_subset()
{
return ‘arabic’;
}The google subset fonts it’s from here:
https://fonts.google.com/?subset=arabicI use and follow:
https://generatepress.com/forums/topic/problems-with-polish-fonts/
https://docs.generatepress.com/article/customizing-the-google-font-list/So how I can display and use the arabic subset fonts list in the typography add-on.
With Thanks,
July 26, 2017 at 10:11 am #355323TomLead DeveloperLead DeveloperHi there,
Adding that function to set the subset should be all that is required. Now if the font you choose has an Arabic subset, it will use it.
July 26, 2017 at 10:32 am #355339arabsworksHow I can use a font from that subset if really nothing apply in the typography google list,what I meant is how to find the subset font from the typography menu if the font not there you can choose.
by the way the google subset fonts it’s from here:
https://fonts.google.com/?subset=arabicNO fonts show in the typography add-on from google subset from the url above so how I can use a font subset if is still not in the menu. did i miss something!!!
July 26, 2017 at 11:07 am #355358arabsworksOk to be fair and after we check ALL typography add-on google fonts we find only one font there from the subset which is the following
https://fonts.google.com/specimen/Amiri/Now we need four more fonts from that subset :
https://fonts.google.com/specimen/Cairo/
https://fonts.google.com/specimen/Lateef/
https://fonts.google.com/specimen/Changa/
https://fonts.google.com/specimen/Scheherazade/So how we can pick and choose a google font which not (visible ) in typography add-on short list although the fonts available and exist in the google fonts repository.
July 26, 2017 at 11:12 am #355366TomLead DeveloperLead DeveloperThis should help: https://docs.generatepress.com/article/customizing-the-google-font-list/
Let me know 🙂
July 26, 2017 at 11:21 am #355373arabsworksWe did the following :
add_filter( ‘generate_typography_customize_list’,’tu_add_google_fonts’ );
function tu_add_google_fonts( $fonts )
{
$fonts[ ‘Cairo’ ] = array( ‘name’ => ‘Cairo’ );
$fonts[ ‘Lateef’ ] = array( ‘name’ => ‘Lateef’ );
$fonts[ ‘Changa’ ] = array( ‘name’ => ‘Changa’ );
$fonts[ ‘Scheherazade’ ] = array( ‘name’ => ‘Scheherazade’ );
return $fonts;
}Nothing (visible ) in typography add-on short list!!!
July 26, 2017 at 11:33 am #355376arabsworksOk the code it works fine now thanks, but the four fonts go to the bottom of the typography add-on list so how we make the fonts go to the top and can we minimise and delete any google fonts from the list which not required so can speed the site.
July 26, 2017 at 11:34 am #355377TomLead DeveloperLead DeveloperThere’s no way to re-organize them right now. Deleting more fonts from the list won’t speed up your website, but you can show as many in the list as you like: https://docs.generatepress.com/article/customizing-the-google-font-list/#showing-a-different-number-of-google-fonts
-
AuthorPosts
- You must be logged in to reply to this topic.