CUTCODEDOWN
Minimalist Semantic Markup

Welcome Guest
Please Login or Register

If you have registered but not recieved your activation e-mail in a reasonable amount of time, or have issues with using the registration form, please use our Contact Form for assistance. Include both your username and the e-mail you tried to register with.

Author Topic: iPhone Safari Load custom font...  (Read 1414 times)

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 792
  • Karma: +8/-0
    • Grumpy Young Man
iPhone Safari Load custom font...
« on: 1 Feb 2021, 04:30:46 pm »
HELP - again...

Code: [Select]
@font-face {
            font-family: "FriendsTVFont";
            src: url("./font/GABRWFFR.ttf");
        }
Doesn't seem to load the font in mobile iPhone Safari web browser although it works in Edge and Firefox?
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 792
  • Karma: +8/-0
    • Grumpy Young Man
Re: iPhone Safari Load custom font...
« Reply #1 on: 1 Feb 2021, 05:00:04 pm »
FIXED!!

It was incorrect case with a case sensitive operating system!  ::) ::) ::)
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

coothead

  • Sr. Member
  • ****
  • Posts: 391
  • Karma: +89/-0
  • I smile benignly
    • coothead's stuff ~ an eclectic collection
Re: iPhone Safari Load custom font...
« Reply #2 on: 1 Feb 2021, 08:33:59 pm »
Hi there GrumpyYoungMan,

Have you not considered using woff instead ofttf fonts?

There are three main benefits to using WOFF:

  • The font data is compressed, so sites using WOFF will use less bandwidth
    and will load faster than if they used equivalent uncompressed TrueType or
    OpenType files.
  • Many font vendors that are unwilling to license their TrueType or OpenType
    format fonts for use on the web will license WOFF format fonts. This
    improves availability of fonts to site designers.
  • Both proprietary and free software browser vendors like the WOFF format,
    so it has the potential of becoming a truly universal, interoperable font format
    for the web, unlike other current font formats.

Further reading:-

MDN - WOFF (the Web Open Font Format)

coothead
~ the original bald headed old fart ~

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 792
  • Karma: +8/-0
    • Grumpy Young Man
Re: iPhone Safari Load custom font...
« Reply #3 on: 2 Feb 2021, 01:58:45 am »
Hi there GrumpyYoungMan,

Have you not considered using woff instead ofttf fonts?

There are three main benefits to using WOFF:

  • The font data is compressed, so sites using WOFF will use less bandwidth
    and will load faster than if they used equivalent uncompressed TrueType or
    OpenType files.
  • Many font vendors that are unwilling to license their TrueType or OpenType
    format fonts for use on the web will license WOFF format fonts. This
    improves availability of fonts to site designers.
  • Both proprietary and free software browser vendors like the WOFF format,
    so it has the potential of becoming a truly universal, interoperable font format
    for the web, unlike other current font formats.

Further reading:-

MDN - WOFF (the Web Open Font Format)

coothead
I’ll have a look, I did actually convert the font to woff format, but it wouldn’t work - I bet the case was wrong again so will definitely look into that!

I only looked at this font as I was playing with different dot spacing with different colours every 3rd dot! 🤪😂😂

Thanks as always for taking the time to reply and keeping me on the right track I appreciate it and the continued patiences!
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 792
  • Karma: +8/-0
    • Grumpy Young Man
Re: iPhone Safari Load custom font...
« Reply #4 on: 2 Feb 2021, 04:11:05 am »
Hi there GrumpyYoungMan,

Have you not considered using woff instead ofttf fonts?

There are three main benefits to using WOFF:

  • The font data is compressed, so sites using WOFF will use less bandwidth
    and will load faster than if they used equivalent uncompressed TrueType or
    OpenType files.
  • Many font vendors that are unwilling to license their TrueType or OpenType
    format fonts for use on the web will license WOFF format fonts. This
    improves availability of fonts to site designers.
  • Both proprietary and free software browser vendors like the WOFF format,
    so it has the potential of becoming a truly universal, interoperable font format
    for the web, unlike other current font formats.

Further reading:-

MDN - WOFF (the Web Open Font Format)

coothead
Just because... - I was playing with the different colour dots...
« Last Edit: 2 Feb 2021, 04:32:01 am by GrumpyYoungMan »
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

Jason Knight

  • Administrator
  • Hero Member
  • *****
  • Posts: 1057
  • Karma: +188/-1
    • CutCodeDown -- Minimalist Semantic Markup
Re: iPhone Safari Load custom font...
« Reply #5 on: 2 Feb 2021, 11:31:36 am »
... and woff2 compresses even smaller.

Now, that said, your @font-face declaration is incomplete as you didn't state the default weight or style. Yes, that matters as it has to match your content's declarations.

the pointless use of the local reference ".\" could be screwing things up too.
We are all, we are all, we are all FRIENDS! For today we're all brothers, tonight we're all friends. Our moment of peace in a war that never ends.

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 792
  • Karma: +8/-0
    • Grumpy Young Man
Re: iPhone Safari Load custom font...
« Reply #6 on: 2 Feb 2021, 12:54:06 pm »
... and woff2 compresses even smaller.

Now, that said, your @font-face declaration is incomplete as you didn't state the default weight or style. Yes, that matters as it has to match your content's declarations.

the pointless use of the local reference ".\" could be screwing things up too.
The woff2 format saved 3k 🤪😂😂😂

What did I miss, Jason? As I thought that was optional?

 I honestly didn’t expect that answer from you, I expected a WHY? 🙊
« Last Edit: 2 Feb 2021, 12:57:13 pm by GrumpyYoungMan »
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 792
  • Karma: +8/-0
    • Grumpy Young Man
Re: iPhone Safari Load custom font...
« Reply #7 on: 2 Feb 2021, 03:03:49 pm »
What are you thoughts on this

My little test script works okay on mobile but isn’t so good on the desktop browsers...

Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

coothead

  • Sr. Member
  • ****
  • Posts: 391
  • Karma: +89/-0
  • I smile benignly
    • coothead's stuff ~ an eclectic collection
Re: iPhone Safari Load custom font...
« Reply #8 on: 2 Feb 2021, 05:42:24 pm »
Hi there GrumpyYoungMan,

this slightly amended CSS worked OK for me...

Code: [Select]
@font-face {
    font-family: FriendsTVFont;
    src: url( '/fonts/gabrwffr.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

html, body {
    margin: 0;
    padding: 0;
    font: normal 1em / 1.62em helvetica, sans-serif;
    background: #000;
    color: #fff;
    height: 100%;
}

body {
    display:flex;
    flex-direction: column;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

header, footer {
    flex: 0 0;
    background: #333;
    padding: 1em 0em;
}

footer {
    text-align: center;
}

main {
    margin: auto;
}

#friends ul {
    list-style: none;
    font: bold 4em FriendsTVFont;
}

#friends li {
    display: inline-block;
}

#friends li:nth-child(3n+1):not(:last-child):after {
    padding-left: 0.75em;
    font: normal 1em helvetica;
    content: '\2022';
    color: red;
}

#friends li:nth-child(3n+2):not(:last-child):after {
    padding-left: 0.75em;
    font: normal 1em helvetica;
    content: '\2022';
    color: yellow;
}

#friends li:nth-child(3n+3):not(:last-child):after {
    padding-left: 0.75em;
    font: normal 1em helvetica;
    content: '\2022';
    color: purple;
}

#friends ul:nth-child(2) {
    font-size: 1.75em;
    text-align: center;
    padding: 1em 0 0;
}

@media ( max-width:62em ) {
#friends ul {
    font-size: 3em;
 }
#friends ul:nth-child(2) {
    font-size: 1.3125em;
 }
#friends li:nth-child(3n+2):not(:last-child):after,
#friends li:nth-child(3n+3):not(:last-child):after {
    padding-left: 0.563em;
 }
}

@media ( max-width:48em ) {
#friends ul {
    font-size: 2.25em;
 }
#friends ul:nth-child(2) {
    font-size: 0.984em;
 }
#friends li:nth-child(3n+2):not(:last-child):after,
#friends li:nth-child(3n+3):not(:last-child):after {
    padding-left: 0.422em;
 } 
}

@media ( max-width:36em ) {
#friends ul {
    font-size: 1.688em;
 }
#friends ul:nth-child(2) {
    font-size: 0.738em;
 }
#friends li:nth-child(3n+2):not(:last-child):after,
#friends li:nth-child(3n+3):not(:last-child):after {
    padding-left: 0.317em;
 }     
}

@media ( max-width:25em ) {
#friends ul {
    font-size: 1.266em;
 }
#friends ul:nth-child(2) {
    font-size: 0.555em;
 }
#friends li:nth-child(3n+2):not(:last-child):after,
#friends li:nth-child(3n+3):not(:last-child):after {
    padding-left: 0.238em;
 }     
}

coothead
~ the original bald headed old fart ~

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 792
  • Karma: +8/-0
    • Grumpy Young Man
Re: iPhone Safari Load custom font...
« Reply #9 on: 2 Feb 2021, 05:55:03 pm »
Thanks again!!!! Appreciate it!

Did you see my problem? Looks like you fixed the issue by using extra media queries?

How are you? All good?


« Last Edit: 3 Feb 2021, 01:50:10 am by GrumpyYoungMan »
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

coothead

  • Sr. Member
  • ****
  • Posts: 391
  • Karma: +89/-0
  • I smile benignly
    • coothead's stuff ~ an eclectic collection
Re: iPhone Safari Load custom font...
« Reply #10 on: 2 Feb 2021, 06:03:06 pm »
Hi there GrumpyYoungMan,

I did not like this idea...

Different Stylesheets for Differently Sized Browser Windows

...and can see no good reason to follow it.  :(

coothead
~ the original bald headed old fart ~

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 792
  • Karma: +8/-0
    • Grumpy Young Man
Re: iPhone Safari Load custom font...
« Reply #11 on: 3 Feb 2021, 01:31:38 am »
Hi there GrumpyYoungMan,

I did not like this idea...

Different Stylesheets for Differently Sized Browser Windows

...and can see no good reason to follow it.  :(

coothead
Nor did I, hence why I asked here...

 I thought extra media queries could be the answer and it was by your example... appreciate the help and support!

Maybe you should write a HTML guide?

Thanks again!

Why did you use those break points in the media queries?
« Last Edit: 3 Feb 2021, 01:51:04 am by GrumpyYoungMan »
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

coothead

  • Sr. Member
  • ****
  • Posts: 391
  • Karma: +89/-0
  • I smile benignly
    • coothead's stuff ~ an eclectic collection
Re: iPhone Safari Load custom font...
« Reply #12 on: 3 Feb 2021, 06:05:40 am »
Quote from: GrumpyYoungMan
Why did you use those break points in the media queries?

I just use this simple manual method to ascertain them.

  • open the file in my test  browser Firefox
  • click >"Tools" > "Web Developer" > "Responsive Design Mode"
  • above the page will appear - information something like this...
    "Responsive 1302 x 568  ....."
  • move the cursor towards the right hand side of the page
  • when the cursor changes from "default" to "resize", then
    mouse down to grab the page
  • pull the page towards the left
  • when the page starts to break, check the width value displayed
    above add 16 to it to allow for possible scrollbar
  • convert the value to ems by dividing by 16
  • code your "@media( max-width: xxem ) { code }"
  • repeat the process to check the correctness of the coding
  • move on to the next break point
  • the aim is to make the page responsive at about 17em

I hope that helps.  :)

coothead
~ the original bald headed old fart ~

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 792
  • Karma: +8/-0
    • Grumpy Young Man
Re: iPhone Safari Load custom font...
« Reply #13 on: 3 Feb 2021, 06:55:45 am »
Quote from: GrumpyYoungMan
Why did you use those break points in the media queries?

I just use this simple manual method to ascertain them.

  • open the file in my test  browser Firefox
  • click >"Tools" > "Web Developer" > "Responsive Design Mode"
  • above the page will appear - information something like this...
    "Responsive 1302 x 568  ....."
  • move the cursor towards the right hand side of the page
  • when the cursor changes from "default" to "resize", then
    mouse down to grab the page
  • pull the page towards the left
  • when the page starts to break, check the width value displayed
    above add 16 to it to allow for possible scrollbar
  • convert the value to ems by dividing by 16
  • code your "@media( max-width: xxem ) { code }"
  • repeat the process to check the correctness of the coding
  • move on to the next break point
  • the aim is to make the page responsive at about 17em

I hope that helps.  :)

coothead
8) That helps massively - I didn't realise you could slide the window to resize the design!  ::)

I guess I should stick to my day job! lol

THANK YOU AGAIN!!  :)
« Last Edit: 3 Feb 2021, 10:56:18 am by GrumpyYoungMan »
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

coothead

  • Sr. Member
  • ****
  • Posts: 391
  • Karma: +89/-0
  • I smile benignly
    • coothead's stuff ~ an eclectic collection
Re: iPhone Safari Load custom font...
« Reply #14 on: 3 Feb 2021, 07:55:47 am »
Quote from: GrumpyYoungMan
I guess I should stick to my day job!

Why do you say that?

If you find coding pleasurable,  then code.  8)

Bugger what any one may say about your efforts.  ;D

coothead
~ the original bald headed old fart ~

 

SMF spam blocked by CleanTalk

Advertisement