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...