Why doesn't SKTypeface.FromStream support SKFontStyle? #3280
Replies: 1 comment
-
I'd like to know if this is something that could be considered in the future. I have a few use cases for loading fonts either as an embedded resource or from the local file system but neither provide the ability to apply SKFontStyle to the font. For example, in my GlyphViewer project, I'm displaying the glyphs and their metrics in a font on an SKCanvasView surface. The glyphs themselves are rendered using the specified font while group headers use OpenSansRegular. SKTypeface.FromFontFamily doesn't return a fallback font on the android simulator, or my two android devices and I need to implement a fallback solution. I've spelled out what I think the pros/cons of each here Issue 52 but my ideal solution would be to use the embedded resource with full fidelity. Thanks, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My goal is to use the same fonts that I use in Maui in SkiaSharp and the fonts may not be installed on target system.
Since SkiaSharp doesn't see MauiFont resources, I've changed my font loading to use embedded resources. My Maui code is working fine but I'm hitting an issue with SkiaSharp; I don't see any method for specifying an SKFontStyle.
Is there an approach I'm missing or is this a limitation?
I'm currently using SkiaSharp.Views.Maui.Controls v3.119.0
Beta Was this translation helpful? Give feedback.
All reactions