Archived topic
Problems with Arabic Google subset fonts
7 replies · Started by arabsworks on July 26, 2017
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=arabic
I 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,
Hi 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.
How 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=arabic
NO 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!!!
Ok 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.
This should help: https://docs.generatepress.com/article/customizing-the-google-font-list/
Let me know :)
We 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!!!
Ok 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.
There'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