User avatar
stonstad
Topic Author
Posts: 263
Joined: 06 Jun 2016, 18:14
Location: United States
Contact:

RichText.SetText()

06 Dec 2024, 20:49

I'm trying to use the RichText extension in code. Could you please advise of the correct approach and/or update the documentation?

https://www.noesisengine.com/docs/App.A ... hText.html
TextBlock a = new TextBlock();
RichText.SetText(a, "[b]Hello[/b] World");
Thank you!
 
User avatar
stonstad
Topic Author
Posts: 263
Joined: 06 Jun 2016, 18:14
Location: United States
Contact:

Re: RichText.SetText()

09 Dec 2024, 18:21

Should this be working, or is there no programmatic API surface area?

Thanks,
Shaun
 
User avatar
jsantos
Site Admin
Posts: 4823
Joined: 20 Jan 2012, 17:18
Contact:

Re: RichText.SetText()

10 Dec 2024, 17:00

Your code appears to be correct. Could you confirm if the font you’re using includes glyphs for bold?
 
User avatar
stonstad
Topic Author
Posts: 263
Joined: 06 Jun 2016, 18:14
Location: United States
Contact:

Re: RichText.SetText()

14 Dec 2024, 16:33

This seems like user error on my part. If I have two fonts that specify the same font family, but different weight, is Noesis able to switch between them when bold font weight is selected?

Image

Image
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: RichText.SetText()

16 Dec 2024, 11:47

Yes, it should, you can try it in a simple TextBlock without using RichText to verify it.

Who is online

Users browsing this forum: No registered users and 2 guests