Replies: 1 comment 1 reply
-
There is no public API to get SKTypeface from the Avalonia types. Typeface avaloniaTypeface = ...
FontManager.Current.TryGetGlyphTypeface(avaloniaTypeface, out var glyphTypeface)
var skTypeface = glyphTypeface._typeface; // access via reflection or UnsafeAccessor |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There are numerous examples of using a .tff font definition file from a 3rd party source like Google Fonts in an Avalonia app. That workflow works great in my app to use the font in text blocks and other UI elements. However, I'd like to use it in an
SKCanvas.DrawText()
call as aSKTypeface
. Specifying the font family in a call toSKTypeface.FromFontFamily()
isn't working (it's loading default instead of the specified family), and while the typeface will load by specifying the path directly in a call toSKTypeface.FromFile()
, the text isn't appearing on the canvas. Anyone have any suggestions?Beta Was this translation helpful? Give feedback.
All reactions