RichtextView fontsize not updated

I use a TMSUINativeRichTextView where I want to change the font size only. If I do

RichTextView.Font.Size := 40;

then the size is changed but any other font attribute is lost.

If I do

RichTextView.SetFontSize(40);

then nothing happens at all.

Is this a bug or what am I missing?

Before applying attributes to text you need to select the text you want to apply attributes to.

But this is rather inconvinient. Calling the method selectAll gives the focus to the richtextview and thus opens the virtual keyboard. I am lookung for a way to change the font size without focus to the richtextview. Any idea?

You need to use the additional parameters then

RichTextView.SetFontSize(40, startpos, length);

I tried RichTextView.SetFontSize(40, 0, RichTextView.RichText.AttributedText.length - 1); but that doesn't change the display of the richtext at all. Is this a bug?

Hi,

We cannot reproduce this. We tried the following way:

TMSFMXNativeUIRichTextView1.SetFontSize(40, 0, TMSFMXNativeUIRichTextView1.RichText.AttributedText.length);

As well as:

TMSFMXNativeUIRichTextView1.SetFontSize(40, 0, TMSFMXNativeUIRichTextView1.Text.Length);

Both changed the font size as expected. Can you provide a sample that consistently reproduces your issue in a new blank application?

Maybe I was a bit inprecise with my description:
I start with an empty Richtextview and call SetFontSize in hope this would have effect on any text that is inserted afterwards. At least with my code, this is not happening. If I first type in some text and call SetFontSize afterwards, the size is changed. However, in that case the font itself changes. Initially the view uses a sans serif font, after changing the size by SetFontSize, a font with serifs is used. This at least seems to be a bug.

OK, please attach a sample demonstrating the issue.

I finally was able to figure out the origin of the problem and solve it myself: If you do not specify a font name for the NativeRichTextView and a font attribute is changed, then the font-name before the changes is something like ".SFUI-Standard" and for whatever reason begomes "TimesNewRomanPS...". However, if you specify a font name for the component, then this font is kept.
I am not sure if this is the intended behaviour and maybe TMS should explicitly set a default fontname, but for me a solution is found.