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

UWP fonts #13

Closed
alllohaaa opened this issue May 21, 2016 · 17 comments · Fixed by #43
Closed

UWP fonts #13

alllohaaa opened this issue May 21, 2016 · 17 comments · Fixed by #43
Assignees
Labels

Comments

@alllohaaa
Copy link

Can't get fonts on UWP, at least FontAwesome and Ionicons. Probably you should follow this advise http://stackoverflow.com/a/35476577/2987062 and check "Generate library layout" option in the Build configuration

@nbrowne
Copy link

nbrowne commented May 28, 2016

@alllohaaa I think you're onto something. I was able to get the fonts (material design specifically) working in UWP by making sure that Plugin.Iconize.Material.UWP\Assets\Fonts\iconize-material.ttf existed in the AppX output folder. I accomplished that by:

  1. Creating the folder structure in the root of my UWP project Plugin.Iconize.Material.UWP\Assets\Fonts\
  2. Copying iconize-material.ttf to the new Fonts directory
  3. Including the .ttf file in the project and setting it to "Copy if newer"
  4. Rebuilding and then deploying the project

This isn't really a good solution long term, but I'm not familiar enough with nuget or xamarin to put a pull request together.

@jsmarcus
Copy link
Owner

I have modified the UWP projects to Generate library layout and updated the nugets. Try the new version, hopefully that has solved your issue. UWP is still in beta but the label and buttons should be working for you.

@alllohaaa
Copy link
Author

Maybe I go wrong, but I guess now you have to include assets folder into nuget fonts packages somehow. I have

C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets(396,7): error MSB3030: Could not copy the file "...\packages\Xam.Plugin.Iconize.FontAwesome\1.0.9\lib\UAP10\Plugin.Iconize.FontAwesome.UWP\Assets\Fonts\iconize-fontawesome.ttf" because it was not found.
C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets(396,7): error MSB3030: Could not copy the file "...\packages\Xam.Plugin.Iconize.Ionicons\1.0.9\lib\UAP10\Plugin.Iconize.Ionicons.UWP\Assets\Fonts\iconize-ionicons.ttf" because it was not found.

Just try your own samples in another solution and reference all dependencies through nuget

@werddomain
Copy link

i have a similar isue, but the path are different.
Each font package missing fonts ..
Tha asked path is "C:\Users\Benoit.nuget\packages\Xam.Plugin.Iconize.SimpleLineIcons\1.0.10\lib\UAP10\Plugin.Iconize.SimpleLineIcons.UWP\Assets\Fonts\iconize-simplelineicons.ttf"

i have copied files in the right dirrectory (i had to create directory structure) and now it work

@JohBa
Copy link

JohBa commented Sep 7, 2016

I have the same problem as @alllohaaa, copying the file in the folder works, but isn't really a good workaround.

@BenDevelopment
Copy link

I'm still facing the same problem wih the last nuget version.

@ghost
Copy link

ghost commented Feb 20, 2017

@werddomain me too

@miggat
Copy link

miggat commented Feb 22, 2017

Me too

@shorlick
Copy link

shorlick commented Apr 6, 2017

Same.

@bricegomis
Copy link

I still have the same issue with the last nuget version.

1 similar comment
@NoleHealth
Copy link

I still have the same issue with the last nuget version.

@ErikGranse
Copy link

Also having this problem with the current version of NuGet

@DevEddy
Copy link

DevEddy commented Dec 9, 2017

Same thing here

@f4bo
Copy link

f4bo commented Jan 29, 2018

I'm in the same boat: 1.0.10 release and still no fixes in view...
BTW I found a dirty fix:

  • go here and download the zip package
  • put the file iconize-fontawesome.ttf you'll find inside, in this folder:
    C:\Users\[your username]\.nuget\packages\xam.plugin.iconize.fontawesome\1.0.10\lib\UAP10\Plugin.Iconize.FontAwesome.UWP\Assets\Fonts\

@pcdus
Copy link

pcdus commented Jan 31, 2018

I encounter the same error for the IconToolbarItem: but my UWP project is .Net Standard type, and I use the latest version of the package (v.2.0.0.37-beta).

@f4bo I tried to adapt your solution to my case:

  • I've found the iconize-material.ttf if the zip package you mentioned
  • I've seen that the font is already present in this folder:

C:\Users[my_name].nuget\packages\xam.plugin.iconize.material\2.0.0.37-beta\lib\uap10.0\Plugin.Iconize.Material

  • but I've copied it in the following folder to match to your solution:

C:\Users[my_name].nuget\packages\xam.plugin.iconize.material\2.0.0.37-beta\lib\uap10.0\Plugin.Iconize.Material\Assets\Fonts

=> I've rebuild the projet, but nothing changed: the icon is still not displayed in the NavigationBar...

I also tried the solution given by @nbrowne:

  • I've created this folder structure in the root of the UWP project:

Plugin.Iconize.Material.UWP\Assets\Fonts\

  • I've copied the iconize-material.ttf to the new Fonts directory
  • I've included the .ttf file to the project and setted it to "Copy if newer"

=> I've rebuilt and then deployed the project but the result is still the same...

Do you have other suggestions?

@pcdus
Copy link

pcdus commented Jan 31, 2018

After having added an IconLabel, I've seen that the icon is well displayed.
So, it seems that the problem comes from the IconToolbarItem.
But in the samples, this IconToolBar works well...

@pcdus
Copy link

pcdus commented Feb 1, 2018

After investigation this problem only occurs when we use an IconNavigationPage as Detail of a MasterDetailPage.
I've opened the related issue.

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

Successfully merging a pull request may close this issue.