I am building a widget for my app. Everything works as expected when using system fonts.
When I try to use the custom font for my app in the Text instances in my widget, the system shots down my WidgetKit extension because it runs against the 30MB memory limit for Widgets.
I have about 20 Text instances on my Widget. I initialize my font as a fileprivate global: let dinFont = Font.custom("AlteDIN1451Mittelschrift", size: 18)
Then I use Text("blah blah").font(dinFont) when I setup my labels.
When I only style a few text labels the widget renders fine. But when I try to use the font on all of them the widget extension is killed because of 30MB memory limit.
This sounds like, .font(dinFont) is creating a copy of the font instance. Is this the expected behavior?
When I try to use the custom font for my app in the Text instances in my widget, the system shots down my WidgetKit extension because it runs against the 30MB memory limit for Widgets.
I have about 20 Text instances on my Widget. I initialize my font as a fileprivate global: let dinFont = Font.custom("AlteDIN1451Mittelschrift", size: 18)
Then I use Text("blah blah").font(dinFont) when I setup my labels.
When I only style a few text labels the widget renders fine. But when I try to use the font on all of them the widget extension is killed because of 30MB memory limit.
This sounds like, .font(dinFont) is creating a copy of the font instance. Is this the expected behavior?