We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfRichTetBoxAdv doesn't use default font...

Hi there,

in code-behind i set the font of a SfRichTetBoxAdv to for eg. Verdana 14pt:

rtb.FontFamily = New Media.FontFamily("Verdana")
rtb.FontSize = 14

The user enters some text that is displayed correctly in Verdana 14pt. The content is retrieved like this:
Dim rtfText As String = ""
Dim ms As Stream = New MemoryStream()
rtb.Save(ms, RichTextBoxAdv.FormatType.Rtf)
ms.Position = 0
Dim byts As Byte() = New Byte(ms.Length - 1) {}
ms.Read(byts, 0, byts.Length)
rtfText = System.Text.Encoding.GetEncoding("UTF-8").GetString(byts, 0, byts.Length)
Return rtfText
The rtfText is then saved for later use. Lateron the text is loaded into the SfRichTetBoxAdv like this:

    arrBytes = Encoding.GetEncoding("UTF-8").GetBytes(rtfText)
    ms = New MemoryStream(arrBytes)
    rtb.Load(ms, RichTextBoxAdv.FormatType.Rtf)

After that the text is always 'Times New Roman' in 12pt. Any ideas what's going wrong here? Thanks...

1 Reply

PS Premkumar Sundaramoorthy Syncfusion Team September 11, 2019 06:35 AM UTC

Hi Heinz-Josef, 
We have already fixed this issue Font family and font size of the text is changed while export as rtf file. And included the fix in our latest weekly release version which is delivered on September 10th, 2019. Kindly use our latest version and check whether the issue is resolved. 

Live Chat Icon For mobile
Up arrow icon