ToastyMallows
ToastyMallows

Reputation: 4273

WPF RichTextBox with WingDings font selected displays weird characters

So, this piqued my intreset. I'm making a program that uses a RichTextBox in WPF and lets users pick their font. When the font WingDings is selected, these boxes are shown on newlines:

Everything below the first line was not typed.

The first line is "this is a test" in WingDigs, then when I hit enter, I get these boxes on the newlines. These boxes disappear when I start typing, and they don't appear when any other fonts are selected. When just the boxes are shown, the caret position is between the two boxes and I can't select them with my mouse. Has anyone seen this? I don't have a TextChanged event in the background.

Here is the RTF code behind this picture, as you can see, the new lines don't have any text in them to produce these boxes.

{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Tahoma;}{\f3\fcharset2 Wingdings;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs16\f2\cf0 \cf0\ql{\f3 {\ltrch this is a test}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f3 {\ltrch }\li0\ri0\sa0\sb0\fi0\ql\par}
{\f3 {\ltrch }\li0\ri0\sa0\sb0\fi0\ql\par}
{\f3 {\ltrch }\li0\ri0\sa0\sb0\fi0\ql\par}
{\f3 {\ltrch }\li0\ri0\sa0\sb0\fi0\ql\par}
{\f3 {\ltrch }\li0\ri0\sa0\sb0\fi0\ql\par}
{\f3 {\ltrch }\li0\ri0\sa0\sb0\fi0\ql\par}
{\f3 {\ltrch }\li0\ri0\sa0\sb0\fi0\ql\par}

Any yes, I know the easy solution is to not list WingDings :)

Upvotes: 1

Views: 538

Answers (0)

Related Questions