Paul Paul - 9 days ago 7
iOS Question

font-family not being applied on mobile devices

I have a problem with the font-family property in my

css
. I have a title that I want to style using a particular font. I am using
@fontface
. On my desktop it works fine, but on
iPhone
and
iPad
I get some standard font (I think it might be times but I am not sure). I did some research and tried different formats otf ttf etc... but still wasn't working. Finally, fed up, I've tried just changing fonts on my css to other system fonts and the phone is still not recognising them. Basically it's stuck with one font. Here is a couple of examples of fonts on the desktop:

enter image description here

The three first images are different font-families I have applied on the desktop version. There is a system font, a google font and a custom font using
@fontface
. All work.

The fourth image is what shows both on
iPhone
and
iPad
for each one of the fonts. Always the same one. What on earth is happening? Any suggestions appreciated.

My code for the custom font is:

@font-face {font-family: QuaestorSans;
src: url("fonts/QuaestorSans-Rg.otf") format("opentype"),
url("fonts/QuaestorSans.ttf") format("opentype");
}


.title{
font-family: QuaestorSans;
font-size: 2em;
letter-spacing: 1.4px;
}


the html




alice soyer



sky on earth



There is a little animation that fades the letters in, but I wouldn't have thought that would interfere with the font-family (and only on mobile devices?).

If you want the check out the web site it's alicesoyer.com

there is only one rule for the font-family, but if you test the site on desktop and on mobile (i am testing on iPhone and iPad for now) you will see different families. Thanks

Answer

Most likely caused by not having the right font format for mobile devices, try using a service like https://www.fontsquirrel.com/tools/webfont-generator to generate the correct code for the fonts you're using