Archived topic
Custom font now showing on Android devices
5 replies · Started by dorian on September 13, 2021
Hi, i have installed custom fonts and it works on PC/iOS but does not show on Android/Chrome at all.
URL is attached in the private area.
CSS added:
.demo{
font-family:"Pixelar Regular W01 Regular" !important;
font-size:16px;font-style:normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;}
@font-face {font-family: "Pixelar Regular W01 Regular";
src: url("http://url/wp-content/uploads/2021/09/b2e75c336df191233b3096682c9ee6be.eot"); /* IE9*/
src: url("http://url/wp-content/uploads/2021/09/b2e75c336df191233b3096682c9ee6be.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
url("http://url/wp-content/uploads/2021/09/b2e75c336df191233b3096682c9ee6be.woff2") format("woff2"), /* chrome、firefox */
url("http://url/wp-content/uploads/2021/09/b2e75c336df191233b3096682c9ee6be.woff") format("woff"), /* chrome、firefox */
url("http://url/wp-content/uploads/2021/09/b2e75c336df191233b3096682c9ee6be.ttf") format("truetype"), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
url("http://url/wp-content/uploads/2021/09/b2e75c336df191233b3096682c9ee6be.svg#Pixelar Regular W01 Regular") format("svg"); /* iOS 4.1- */
}
PHP added:
add_filter( 'generate_typography_default_fonts', function( $fonts ) {
$fonts[] = 'Pixelar Regular W01 Regular';
return $fonts;
} );
Hi Dorian,
Are you loading the httpssite on your android while loading the http site on your other devices?
Here's another topic for your reference:
https://generatepress.com/forums/topic/custom-font-now-showing-on-mobile/#post-886461
Let me know :)
Thanks Ying, SSL is not enabled yet. I noticed it works in Chrome on Android but not on Opera.
When I do the migration to the original domain and enable SSL - I'll see if it will get sorted out.
Hum. Weird...
If it works on Chrome, it should've worked on Opera as well.
Keep us updated :)
Just migrated it to my domain, enabled SSL and Opera shows it now as well!
Awesome!!!
Glad to hear that :)