Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select Roboto Condensed as font for text #45

Open
charlenni opened this issue Jan 11, 2022 · 2 comments
Open

Select Roboto Condensed as font for text #45

charlenni opened this issue Jan 11, 2022 · 2 comments

Comments

@charlenni
Copy link
Contributor

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

@handerss-spotfire
Copy link
Contributor

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.

@toptensoftware
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants