-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] Updating Embedded Font #11843
Comments
Somebody knows any better workaround? Because deleting appdata is no good idea if you releasing an app. |
Is there any known workaround? Your issue has been open since August. It appears in Triage with “Needs Estimate”. Have you noticed if the issue occurs with apk bundles? I have been releasing aab. I know that the new font file is in the bundle because it gets installed if the previous version is removed first. I was hoping there was a way to flag a resource as "always install" Thanks |
@samhouts , @rachelkang |
There is a solution to this issue. This worked for me, The Shared Assembly (where the font resources are included) needs to be added to the Forms.Init call in App.xaml.cs in the UWP project. Assuming your app is called MyApp MyApp Edit App.xaml.cs in MyApp.UWP In the OnLaunched method, before Forms.Init, add the following....
Your ExportFont should work like it does on Android and iOS |
Hi @solomonfried , this did not work for my with android (I don't use UWP). I used this:
and a colleague created a new PR with an additional icon in our custom font. The new icon is not shown. Only reinstalling the app works. Then the icon appears. |
My apologies. I confused 2 separate ExportFont issues that I was following. For the issue of having to remove and reinstall the app in order to show glyph changes, have you tried renaming the FontFile? (e.g. add a number to the end) Then change the [ExportFont] attribute to reflect the change. I would assume that that would have to create a new Embedded Resource which should resolve the issue. This is not a long term solution, but might get you through releasing your app now. |
Thanks. Renaming the updated fontfile works. I changed the name to fontfile_1.ttf and the attribute to |
Thank you @solomonfried you saved my day! Renaming was the solution! |
Another workaround is to include the font files in the platform projects and mark them as AndroidAsset/BundleResource. |
I developed this:
|
Any idea how I can add iOS to my code? |
Thanks @juwens for the workaround, it work greats (for an Android App). I've adapted it to work with multiple EmbeddedFont. |
juwens where did you add that code? |
Description
If you embed a font via
[assembly: ExportFont("fontfile.ttf", Alias = "IconFont")]
all works correctly. But if you you update the fontfile in your project, add a new glyph for example, then the new glyph is not shown. Only the rectangle placeholder.
I only tested with android, but perhaps this problem exists also in ios.
Expected Behavior
New glyph in updated fontfile should be available.
Actual Behavior
Label show only the rectangle placeholder.
Basic Information
Screenshots
Reproduction Link
Workaround
On Android delete AppData.
The text was updated successfully, but these errors were encountered: