Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

[IOS] : Font Awesome 5 PRO - Light icon always displayed as solid #22

Closed
kefahB opened this issue Dec 15, 2018 · 2 comments
Closed

[IOS] : Font Awesome 5 PRO - Light icon always displayed as solid #22

kefahB opened this issue Dec 15, 2018 · 2 comments

Comments

@kefahB
Copy link

kefahB commented Dec 15, 2018

Hi,

On Android work as expected.

On IOSall Lighticon are dispalyed as solid

RESULT :

capture d ecran 2018-12-15 a 14 47 35

Css file located in app/fontawesome.css

In app.ts:

import {TNSFontIcon, fonticon} from 'nativescript-fonticon';

TNSFontIcon.debug = false;
TNSFontIcon.paths = {
  'fa': 'fontawesome.css'
};
TNSFontIcon.loadCss();

In app/fonts :

capture d ecran 2018-12-15 a 14 39 55

In app/_app-common.scss :

@font-face {
  font-family: 'Font Awesome 5 Pro';
  font-style: normal;
  font-weight: 300;
  src: url("~/fonts/fa-light-300.ttf") format("truetype")}

.fa {
  font-family: Font Awesome 5 Pro, fa-light-300;
  font-weight: 300;
}

@font-face {
  font-family: 'Font Awesome 5 Pro';
  font-style: normal;
  font-weight: 300;
  src: url("~/fonts/fa-solid-900.ttf") format("truetype")}

.fas {
  font-family: Font Awesome 5 Pro, fa-solid-900;
  font-weight: 900;
}

@font-face {
  font-family: 'Font Awesome 5 Pro';
  font-style: normal;
  font-weight: 400;
  src: url("~/fonts/fa-regular-400.ttf") format("truetype")}

.far {
  font-family: Font Awesome 5 Pro, fa-regular-400;
}

Thank you :-)

@markosole
Copy link

markosole commented Aug 17, 2019

Hi @kefahB it's been a long time since you reported this. Just wondering did you make it work eventually? I am having problem with Font 5 Pro, where all icons are displayed as squares on iOS, but Android works fine. I am using JS of NS.

UPDATE:
This actually works, I just had another app.ios.scss font definition and it overrides app_common.scss file.

@kefahB
Copy link
Author

kefahB commented Dec 10, 2019

Hi @markosole, Yes I did .. you should add the css font-weight for each one to mak it work on IOS :

.fa {
  font-family: Font Awesome 5 Pro, fa-light-300;
  font-weight: 300;
}
.fas {
  font-family: Font Awesome 5 Pro, fa-solid-900;
  font-weight: 900;
}
.fab {
  font-family: Font Awesome 5 Pro, fa-brands-400;
  font-weight: 400;
}
.far {
  font-family: Font Awesome 5 Pro, fa-regular-400;
  font-weight: 400;
}
.fad {
  font-family: Font Awesome 5 Pro, fa-dutone-900;
  font-weight: 900;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants