I saw somewhere on the web that one can add custom font families to the Typography fonts list using add_filter(‘x_fonts_data’, ‘my_custom_font’) etc. I havent been able to do so successfully. Is there any documentation or is this not supported.
I would really want to be able to use the Font Manager with my custom fonts that I include with my child theme or everything is more messy trying to use classes to assign fonts everywhere.
Thanks.
This was my code:
function my_custom_font($data){
$data['mywebfont1'] = array(
'source' => 'Custom',
'family' => 'Avenir Light',
'stack' => 'AvenirLTStd-Light, sans-serif',
'weights' => array( '300' )
);
array_push($data, $data['mywebfont1']);
$data['mywebfont2'] = array(
'source' => 'Custom',
'family' => 'Acta Display Black',
'stack' => 'ActaDisplay, serif',
'weights' => array( '900' )
);
array_push($data, $data['mywebfont2']);
return $data;
}
add_filter('x_fonts_data', 'my_custom_font');