MartinZikmund / blog-2020

Code samples for my 2020 blogposts
8 stars 1 forks source link

Add > Existing Item Issue #3

Open the-wazz opened 3 years ago

the-wazz commented 3 years ago

I have (at least) a couple of problems getting this to work. Fixing one of these might solve the other, and vice-versa, I don't know.

  1. in the article you say "We add a fonts folder in the root folder of our Uno Platform solution...". I tried this and it didn't work (see issue 2). Looking at your "solution" here in github, it looks like your fonts folder is in with all the platform folders, not in the root. Maybe the folder structure has changed? Either way, it's unclear if you mean in the root, or in the Platforms folder. I tried both and couldn't make it work (see issue 2).
  2. When it came time to add fonts (links) to a platform (Add > Existing Item), my new fonts folder was not visible in the folder dialog. Maybe I didn't add things correctly, or something was hidden, but I could never find a way to see the new fonts folder in the dialog.

Q. When I add fonts to the new folder, should I copy them into the new fonts folder via Windows Explorer, or can I paste directly into the Visual Studio IDE folder? Not sure if that matters. (I also don't see a 'refresh' button in the IDE solution explorer that I'm used to seeing in web dev...)

the-wazz commented 3 years ago

Btw, I got fonts working in Android, I think by just adding fonts to the Assets folder. I've tried so many things I'm not sure now what fixed it. Possibly the IDE didn't see the new files, which is why I asked that last question. I found a question on SO about it (possibly you posted an answer? I forget). The files had a dotted border and I had to explicitly say 'Include in Project'. Not sure if that was the fix for sure.

Edit: I got it working by using FontFamily="ms-appx:///Assets/Fonts/font-file.ttf#Font Name", from the article here. I'm pretty sure I tried it before. I guess I did something wrong.