RichTextKit icon indicating copy to clipboard operation
RichTextKit copied to clipboard

Select Roboto Condensed as font for text

Open charlenni opened this issue 4 years ago • 2 comments

Hello,

I have the problem, that I don't find the Roboto Condensed font on my machine when selecting font family for my text. If I look into the fonts in the system manager or use Word, both can see the font. If I look into SKFontManager.FontFamilies I see only the Roboto font.

So I have to provide SKFontStyleWidth with SKFontStyleWidth.Condensed instead of SKFontStyleWidth.Normal. But how to do this with RichTextKit? Is this missing? Could it be, that this line is the problem?

Regards, Dirk

charlenni avatar Jan 11 '22 17:01 charlenni

You can supply the font width either by setting it via RichString.FontWidth() or by supplying it via the FontWidth property of the Style class when adding text to a TextBlock.

Skia will only show you the list of typographical font names when calling SKFontManager.FontFamilies. You can loop through the list and call SKFontManager.Default.GetFontStyles for each font to see which styles are available. Note that synthesized font styles (e.g. bold/italic versions of some fonts) will not be included, however they can be created via SKFontManager.Default.MatchTypeface.

handerss-spotfire avatar Jan 09 '23 15:01 handerss-spotfire

Hi @charlenni

Does @handerss-tibco answer help? Off hand, I'm not 100% sure what's going on here. Get back to me if you still can't get it to work and I'll look into it.

Brad

toptensoftware avatar Jan 09 '23 22:01 toptensoftware