Nativecript Fontawesome 5 iphone not working
I'm trying to get Font Awesome 5 to work on android but it's not working. Using the https://github.com/NathanWalker/nativescript-ngx-fonticon package.
My folder structure
- src
-- assets
-- fonts
-- app
The assets folder contains the fontawesome css (font-awesome.css), I've removed everything above the "Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
readers do not read off random characters that represent icons" remark.
The fonts folder contains all the fontfiles (eot / svg / ttf / woff / woff2) I've downloaded from Font Awesome 5 website (fa-brands / fa-regular / fa-solid)
In my main scss file I have a line :
.fa
font-family: FontAwesome, fontawesome-webfont;
.fas
font-family: FontAwesome, fa-solid-900;
In my app.module.ts :
import TNSFontIconModule , TNSFontIconService from 'nativescript-ngx-fonticon';
TNSFontIconService.debug = true;
and import :
TNSFontIconModule.forRoot(
'fa': './assets/font-awesome.css'
)
Now in my HTML:
<Label class="fas" [text]="'fa-bars' | fonticon" color="#2c0239"></Label>
I've also modified my webpack config to copy and watch the src/assets/ folder:
new CopyWebpackPlugin([
from: "assets/**",
from: "fonts/**" ,
from: "**/*.jpg" ,
from: "**/*.png" ,
], ignore: [`$relative(appPath, appResourcesFullPath)/**`] ),
So when I run this on my iPhone I get [?]
android iphone font-awesome nativescript
add a comment |
I'm trying to get Font Awesome 5 to work on android but it's not working. Using the https://github.com/NathanWalker/nativescript-ngx-fonticon package.
My folder structure
- src
-- assets
-- fonts
-- app
The assets folder contains the fontawesome css (font-awesome.css), I've removed everything above the "Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
readers do not read off random characters that represent icons" remark.
The fonts folder contains all the fontfiles (eot / svg / ttf / woff / woff2) I've downloaded from Font Awesome 5 website (fa-brands / fa-regular / fa-solid)
In my main scss file I have a line :
.fa
font-family: FontAwesome, fontawesome-webfont;
.fas
font-family: FontAwesome, fa-solid-900;
In my app.module.ts :
import TNSFontIconModule , TNSFontIconService from 'nativescript-ngx-fonticon';
TNSFontIconService.debug = true;
and import :
TNSFontIconModule.forRoot(
'fa': './assets/font-awesome.css'
)
Now in my HTML:
<Label class="fas" [text]="'fa-bars' | fonticon" color="#2c0239"></Label>
I've also modified my webpack config to copy and watch the src/assets/ folder:
new CopyWebpackPlugin([
from: "assets/**",
from: "fonts/**" ,
from: "**/*.jpg" ,
from: "**/*.png" ,
], ignore: [`$relative(appPath, appResourcesFullPath)/**`] ),
So when I run this on my iPhone I get [?]
android iphone font-awesome nativescript
Try removingfas
class definition and see if that helps, as they share same name.
– Manoj
Nov 14 '18 at 11:19
actually the .fas class made it worked on android :)
– fransyozef
Nov 14 '18 at 11:22
add a comment |
I'm trying to get Font Awesome 5 to work on android but it's not working. Using the https://github.com/NathanWalker/nativescript-ngx-fonticon package.
My folder structure
- src
-- assets
-- fonts
-- app
The assets folder contains the fontawesome css (font-awesome.css), I've removed everything above the "Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
readers do not read off random characters that represent icons" remark.
The fonts folder contains all the fontfiles (eot / svg / ttf / woff / woff2) I've downloaded from Font Awesome 5 website (fa-brands / fa-regular / fa-solid)
In my main scss file I have a line :
.fa
font-family: FontAwesome, fontawesome-webfont;
.fas
font-family: FontAwesome, fa-solid-900;
In my app.module.ts :
import TNSFontIconModule , TNSFontIconService from 'nativescript-ngx-fonticon';
TNSFontIconService.debug = true;
and import :
TNSFontIconModule.forRoot(
'fa': './assets/font-awesome.css'
)
Now in my HTML:
<Label class="fas" [text]="'fa-bars' | fonticon" color="#2c0239"></Label>
I've also modified my webpack config to copy and watch the src/assets/ folder:
new CopyWebpackPlugin([
from: "assets/**",
from: "fonts/**" ,
from: "**/*.jpg" ,
from: "**/*.png" ,
], ignore: [`$relative(appPath, appResourcesFullPath)/**`] ),
So when I run this on my iPhone I get [?]
android iphone font-awesome nativescript
I'm trying to get Font Awesome 5 to work on android but it's not working. Using the https://github.com/NathanWalker/nativescript-ngx-fonticon package.
My folder structure
- src
-- assets
-- fonts
-- app
The assets folder contains the fontawesome css (font-awesome.css), I've removed everything above the "Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
readers do not read off random characters that represent icons" remark.
The fonts folder contains all the fontfiles (eot / svg / ttf / woff / woff2) I've downloaded from Font Awesome 5 website (fa-brands / fa-regular / fa-solid)
In my main scss file I have a line :
.fa
font-family: FontAwesome, fontawesome-webfont;
.fas
font-family: FontAwesome, fa-solid-900;
In my app.module.ts :
import TNSFontIconModule , TNSFontIconService from 'nativescript-ngx-fonticon';
TNSFontIconService.debug = true;
and import :
TNSFontIconModule.forRoot(
'fa': './assets/font-awesome.css'
)
Now in my HTML:
<Label class="fas" [text]="'fa-bars' | fonticon" color="#2c0239"></Label>
I've also modified my webpack config to copy and watch the src/assets/ folder:
new CopyWebpackPlugin([
from: "assets/**",
from: "fonts/**" ,
from: "**/*.jpg" ,
from: "**/*.png" ,
], ignore: [`$relative(appPath, appResourcesFullPath)/**`] ),
So when I run this on my iPhone I get [?]
android iphone font-awesome nativescript
android iphone font-awesome nativescript
edited Nov 14 '18 at 11:20
fransyozef
asked Nov 14 '18 at 10:17
fransyozeffransyozef
1408
1408
Try removingfas
class definition and see if that helps, as they share same name.
– Manoj
Nov 14 '18 at 11:19
actually the .fas class made it worked on android :)
– fransyozef
Nov 14 '18 at 11:22
add a comment |
Try removingfas
class definition and see if that helps, as they share same name.
– Manoj
Nov 14 '18 at 11:19
actually the .fas class made it worked on android :)
– fransyozef
Nov 14 '18 at 11:22
Try removing
fas
class definition and see if that helps, as they share same name.– Manoj
Nov 14 '18 at 11:19
Try removing
fas
class definition and see if that helps, as they share same name.– Manoj
Nov 14 '18 at 11:19
actually the .fas class made it worked on android :)
– fransyozef
Nov 14 '18 at 11:22
actually the .fas class made it worked on android :)
– fransyozef
Nov 14 '18 at 11:22
add a comment |
2 Answers
2
active
oldest
votes
Finally have it :
.fas
font-family: "Font Awesome 5 Free", fa-solid-900;
The first one ("Font Awesome 5 Free") is needed for iPhone and fa-solid-900 is needed for Android.
But can you get both normal and bold to work on iPhone? I've only been able to get one or the other. Android works fine as it uses the fa-regular-400 and fa-regular-900 to find the font.
– bradrice
Nov 14 '18 at 16:23
yes working on both iphone and android
– fransyozef
Nov 14 '18 at 17:35
"bold" I know what you mean.
– fransyozef
Nov 14 '18 at 17:38
I can’t have bold icons and plain icons in my iphone app, only one or the other
– bradrice
Nov 14 '18 at 17:42
add a comment |
This is how I did it because that didn't worked for me.
I'm using Nativescript and VueJs
Version of Font Awesome: 5.4.2
You will need to following fonts:
fa-regular-400
fa-brands-400
fa-solid-900
You need to place them app>fonts
Add this to app>app.css
.far
font-family: 'Font Awesome 5 Free', fa-regular-400;
font-size: 40em;
.fab
font-family: 'Font Awesome 5 Brands', fa-brands-400;
font-size: 40em;
.fas
font-family: 'Font Awesome 5 Free', fa-solid-900;
font-size: 40em;
You can change the font-size
.
So how to use in the template?
A few examples:
<Label class="fab" :text="'uf060' | unescape"></Label>
<Label class="fab" :text="'uf170' | unescape"></Label>
<Label class="fab" :text="'uf36e' | unescape"></Label>
filters:
unescape: v => unescape(v)
If you search an icon you will see the unicode.
You need to copy that.
Example the Unicode for moon is f186
So to use it you will need to typ uunicode
=> uf186
it will only work if use the attribute :text
and the function unescape
.
Multi line buttons
<Button class="btn">
<FormattedString>
<span class="fas" :text="'u[ICONCODE]' | unescape" ></span>
<span :text="'n [TEXT]' | unescape" ></span>
</FormattedString>
</Button>
filters:
unescape: v => unescape(v)
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53297794%2fnativecript-fontawesome-5-iphone-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Finally have it :
.fas
font-family: "Font Awesome 5 Free", fa-solid-900;
The first one ("Font Awesome 5 Free") is needed for iPhone and fa-solid-900 is needed for Android.
But can you get both normal and bold to work on iPhone? I've only been able to get one or the other. Android works fine as it uses the fa-regular-400 and fa-regular-900 to find the font.
– bradrice
Nov 14 '18 at 16:23
yes working on both iphone and android
– fransyozef
Nov 14 '18 at 17:35
"bold" I know what you mean.
– fransyozef
Nov 14 '18 at 17:38
I can’t have bold icons and plain icons in my iphone app, only one or the other
– bradrice
Nov 14 '18 at 17:42
add a comment |
Finally have it :
.fas
font-family: "Font Awesome 5 Free", fa-solid-900;
The first one ("Font Awesome 5 Free") is needed for iPhone and fa-solid-900 is needed for Android.
But can you get both normal and bold to work on iPhone? I've only been able to get one or the other. Android works fine as it uses the fa-regular-400 and fa-regular-900 to find the font.
– bradrice
Nov 14 '18 at 16:23
yes working on both iphone and android
– fransyozef
Nov 14 '18 at 17:35
"bold" I know what you mean.
– fransyozef
Nov 14 '18 at 17:38
I can’t have bold icons and plain icons in my iphone app, only one or the other
– bradrice
Nov 14 '18 at 17:42
add a comment |
Finally have it :
.fas
font-family: "Font Awesome 5 Free", fa-solid-900;
The first one ("Font Awesome 5 Free") is needed for iPhone and fa-solid-900 is needed for Android.
Finally have it :
.fas
font-family: "Font Awesome 5 Free", fa-solid-900;
The first one ("Font Awesome 5 Free") is needed for iPhone and fa-solid-900 is needed for Android.
answered Nov 14 '18 at 11:35
fransyozeffransyozef
1408
1408
But can you get both normal and bold to work on iPhone? I've only been able to get one or the other. Android works fine as it uses the fa-regular-400 and fa-regular-900 to find the font.
– bradrice
Nov 14 '18 at 16:23
yes working on both iphone and android
– fransyozef
Nov 14 '18 at 17:35
"bold" I know what you mean.
– fransyozef
Nov 14 '18 at 17:38
I can’t have bold icons and plain icons in my iphone app, only one or the other
– bradrice
Nov 14 '18 at 17:42
add a comment |
But can you get both normal and bold to work on iPhone? I've only been able to get one or the other. Android works fine as it uses the fa-regular-400 and fa-regular-900 to find the font.
– bradrice
Nov 14 '18 at 16:23
yes working on both iphone and android
– fransyozef
Nov 14 '18 at 17:35
"bold" I know what you mean.
– fransyozef
Nov 14 '18 at 17:38
I can’t have bold icons and plain icons in my iphone app, only one or the other
– bradrice
Nov 14 '18 at 17:42
But can you get both normal and bold to work on iPhone? I've only been able to get one or the other. Android works fine as it uses the fa-regular-400 and fa-regular-900 to find the font.
– bradrice
Nov 14 '18 at 16:23
But can you get both normal and bold to work on iPhone? I've only been able to get one or the other. Android works fine as it uses the fa-regular-400 and fa-regular-900 to find the font.
– bradrice
Nov 14 '18 at 16:23
yes working on both iphone and android
– fransyozef
Nov 14 '18 at 17:35
yes working on both iphone and android
– fransyozef
Nov 14 '18 at 17:35
"bold" I know what you mean.
– fransyozef
Nov 14 '18 at 17:38
"bold" I know what you mean.
– fransyozef
Nov 14 '18 at 17:38
I can’t have bold icons and plain icons in my iphone app, only one or the other
– bradrice
Nov 14 '18 at 17:42
I can’t have bold icons and plain icons in my iphone app, only one or the other
– bradrice
Nov 14 '18 at 17:42
add a comment |
This is how I did it because that didn't worked for me.
I'm using Nativescript and VueJs
Version of Font Awesome: 5.4.2
You will need to following fonts:
fa-regular-400
fa-brands-400
fa-solid-900
You need to place them app>fonts
Add this to app>app.css
.far
font-family: 'Font Awesome 5 Free', fa-regular-400;
font-size: 40em;
.fab
font-family: 'Font Awesome 5 Brands', fa-brands-400;
font-size: 40em;
.fas
font-family: 'Font Awesome 5 Free', fa-solid-900;
font-size: 40em;
You can change the font-size
.
So how to use in the template?
A few examples:
<Label class="fab" :text="'uf060' | unescape"></Label>
<Label class="fab" :text="'uf170' | unescape"></Label>
<Label class="fab" :text="'uf36e' | unescape"></Label>
filters:
unescape: v => unescape(v)
If you search an icon you will see the unicode.
You need to copy that.
Example the Unicode for moon is f186
So to use it you will need to typ uunicode
=> uf186
it will only work if use the attribute :text
and the function unescape
.
Multi line buttons
<Button class="btn">
<FormattedString>
<span class="fas" :text="'u[ICONCODE]' | unescape" ></span>
<span :text="'n [TEXT]' | unescape" ></span>
</FormattedString>
</Button>
filters:
unescape: v => unescape(v)
add a comment |
This is how I did it because that didn't worked for me.
I'm using Nativescript and VueJs
Version of Font Awesome: 5.4.2
You will need to following fonts:
fa-regular-400
fa-brands-400
fa-solid-900
You need to place them app>fonts
Add this to app>app.css
.far
font-family: 'Font Awesome 5 Free', fa-regular-400;
font-size: 40em;
.fab
font-family: 'Font Awesome 5 Brands', fa-brands-400;
font-size: 40em;
.fas
font-family: 'Font Awesome 5 Free', fa-solid-900;
font-size: 40em;
You can change the font-size
.
So how to use in the template?
A few examples:
<Label class="fab" :text="'uf060' | unescape"></Label>
<Label class="fab" :text="'uf170' | unescape"></Label>
<Label class="fab" :text="'uf36e' | unescape"></Label>
filters:
unescape: v => unescape(v)
If you search an icon you will see the unicode.
You need to copy that.
Example the Unicode for moon is f186
So to use it you will need to typ uunicode
=> uf186
it will only work if use the attribute :text
and the function unescape
.
Multi line buttons
<Button class="btn">
<FormattedString>
<span class="fas" :text="'u[ICONCODE]' | unescape" ></span>
<span :text="'n [TEXT]' | unescape" ></span>
</FormattedString>
</Button>
filters:
unescape: v => unescape(v)
add a comment |
This is how I did it because that didn't worked for me.
I'm using Nativescript and VueJs
Version of Font Awesome: 5.4.2
You will need to following fonts:
fa-regular-400
fa-brands-400
fa-solid-900
You need to place them app>fonts
Add this to app>app.css
.far
font-family: 'Font Awesome 5 Free', fa-regular-400;
font-size: 40em;
.fab
font-family: 'Font Awesome 5 Brands', fa-brands-400;
font-size: 40em;
.fas
font-family: 'Font Awesome 5 Free', fa-solid-900;
font-size: 40em;
You can change the font-size
.
So how to use in the template?
A few examples:
<Label class="fab" :text="'uf060' | unescape"></Label>
<Label class="fab" :text="'uf170' | unescape"></Label>
<Label class="fab" :text="'uf36e' | unescape"></Label>
filters:
unescape: v => unescape(v)
If you search an icon you will see the unicode.
You need to copy that.
Example the Unicode for moon is f186
So to use it you will need to typ uunicode
=> uf186
it will only work if use the attribute :text
and the function unescape
.
Multi line buttons
<Button class="btn">
<FormattedString>
<span class="fas" :text="'u[ICONCODE]' | unescape" ></span>
<span :text="'n [TEXT]' | unescape" ></span>
</FormattedString>
</Button>
filters:
unescape: v => unescape(v)
This is how I did it because that didn't worked for me.
I'm using Nativescript and VueJs
Version of Font Awesome: 5.4.2
You will need to following fonts:
fa-regular-400
fa-brands-400
fa-solid-900
You need to place them app>fonts
Add this to app>app.css
.far
font-family: 'Font Awesome 5 Free', fa-regular-400;
font-size: 40em;
.fab
font-family: 'Font Awesome 5 Brands', fa-brands-400;
font-size: 40em;
.fas
font-family: 'Font Awesome 5 Free', fa-solid-900;
font-size: 40em;
You can change the font-size
.
So how to use in the template?
A few examples:
<Label class="fab" :text="'uf060' | unescape"></Label>
<Label class="fab" :text="'uf170' | unescape"></Label>
<Label class="fab" :text="'uf36e' | unescape"></Label>
filters:
unescape: v => unescape(v)
If you search an icon you will see the unicode.
You need to copy that.
Example the Unicode for moon is f186
So to use it you will need to typ uunicode
=> uf186
it will only work if use the attribute :text
and the function unescape
.
Multi line buttons
<Button class="btn">
<FormattedString>
<span class="fas" :text="'u[ICONCODE]' | unescape" ></span>
<span :text="'n [TEXT]' | unescape" ></span>
</FormattedString>
</Button>
filters:
unescape: v => unescape(v)
answered Nov 15 '18 at 10:35
StevenSteven
525525
525525
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53297794%2fnativecript-fontawesome-5-iphone-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try removing
fas
class definition and see if that helps, as they share same name.– Manoj
Nov 14 '18 at 11:19
actually the .fas class made it worked on android :)
– fransyozef
Nov 14 '18 at 11:22