Google fonts with spaces in their name are not quoted

edited March 2022 in Fonts

Hello,

Can you please make a change to your style.php file to ensure all fonts are surrounded by quote marks, handling Google fonts which have spaces in them?

For example, "Baloo 2" is represented as follows:

font-family:Baloo 2,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif

Which breaks in the browser due to the space.

Adding quotes on line 70 of style.php resolves the issue:

$fonts[$font_k] = str_replace('#', '', $font_v) .',';

becomes

$fonts[$font_k] = '"'.str_replace('#', '', $font_v) .'",';


Thanks

Comments

Sign In or Register to comment.