This is a migrated thread and some comments may be shown as answers.

RichTextBox Cutting off the end of characters

16 Answers 676 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 2
Kevin asked on 10 May 2011, 05:13 PM
Guys,

I'm having issue with my RichTextBox and some funky UI stuff, Its cutting off my Characters (see Link at the bottom of this post) And also the Cursor in this instance appears to be BEFORE the H, but is actually at the end of the H...

<telerik:RadRichTextBox FontFamily="Arial" FontSize="9" DocumentInheritsDefaultStyleSettings="True" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" />

http://www.flickr.com/photos/57960866@N06/5707505816/in/photostream
Any help would be appreciated.

16 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 12 May 2011, 04:41 PM
Hi kevin,

Thank you for getting to us about the strange behavior you are observing.
The misplaced caret is a bug related to the specific font and size, which we will look into and hopefully, fix, for the next release.
As for the cutting of the last character, do you, by any chance, have a default style for all TextBlocks in your application? RadRichTextBox uses TextBlocks internally and they might be taking over this style. We will prevent that on our end in the next release, too, but as a workaround, you can set a style in the resources of the RichTextBox:

<telerik:RadRichTextBox FontFamily="Arial" FontSize="9" DocumentInheritsDefaultStyleSettings="True">
    <telerik:RadRichTextBox.Resources>
        <Style TargetType="TextBlock" />
    </telerik:RadRichTextBox.Resources>
</telerik:RadRichTextBox>

I hope that helps.


All the best,
Iva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Couchetard
Top achievements
Rank 1
answered on 06 Dec 2011, 09:17 PM
Hi,

I'm using a control that has a RadRichTextBox inside, when displayed, the end of the texte in the document is cut off (as if it is hidden under the vertical scrollbar space). Do you have any clue?

 

 


<
Telerik:RadRichTextBox DocumentInheritsDefaultStyleSettings="True"

 

 

x:Name="ctlRadRichTextBox"

 

 

DockPanel.Dock="Bottom"

 

 

IsContextMenuEnabled="False"

 

 

IsSpellCheckingEnabled="False"

 

 

IsSelectionMiniToolBarEnabled="False"

 

 

VerticalScrollBarVisibility="Auto"

 

 

DocumentContentChanged="RadRichTextBox_DocumentContentChanged"

 

 

 

PS: The document content is binded in RTF format.

0
Mihail
Telerik team
answered on 09 Dec 2011, 05:43 PM
Hi Couchetard,

I couldn't reproduce the problem you have described. Can you please provide us with a simple project illustrating the problem attached to a support ticket.
Before that you could check if everything is ok with the following attributes if you are using them: width, margin and padding inside your user control, because the RadRichTextBox is a bit wider than the other containers.
We would also appreciate it if you also specified which version of the controls you are using, e.g. 2011.3.1116.40.

Greetings,
Mihail
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Vishnu
Top achievements
Rank 1
answered on 13 Sep 2013, 04:40 PM
Hi,

I am using RadRichTextBox control for preview in WPF.  Whena Date text is  italicized, the last character is getting cut off but when the change the font style back to normal, i see the complete date...


How to control this behaviour


Thanks
Vishnu
0
Petya
Telerik team
answered on 18 Sep 2013, 12:06 PM
Hello Vishnu,

We are unaware of any similar issues and I could not replicate this. Would you mind sharing some additional details such as:
  • Are you able to replicate the problem in our click-once examples and what steps are you executing?
  • What exactly is the setup of your project?
  • What type of document is shown when the issue is observed?
Any other details you feel are relevant will also be appreciated. 

I'm looking forward to your reply.

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Vishnu
Top achievements
Rank 1
answered on 18 Sep 2013, 02:14 PM
Here is my control
   <telerik:RadRichTextBox Grid.Row="2" IsReadOnly="True" x:Name="rtbHtmlTestRad" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" />

i do have combo boxes for user to select Font Style/Font weight/Font/size. The text in the preview is displayed completely for specific values of Font Style/Font weight/Font/size (example : Font Style = Normal, Font Size= 12 points Font family = Times New Roman, but if i change the Font Style = Italic, Font Size = 10, the last text character is getting cut off). So the issue is specific values of Font Size.....

Note:1) I am constructing the text programatically using RadDocument/Rad Span for displaying text. The Font settings are then applied to RadSpan, which are then added to Paragraphs. Different text in the document has different Font settings like Heading in bold, dates in Italic, body in Normal

2) The cutoff issue is also observed for regular text when changed to bold and increased Font Size

  • Are you able to replicate the problem in our click-once examples and what steps are you executing?
  No (For steps please see the first paragraph)
  • What exactly is the setup of your project?
     WPF project using Telerik controls
  • What type of document is shown when the issue is observed?
  RadDocument


Thanks
Vishnu
0
Petya
Telerik team
answered on 23 Sep 2013, 10:03 AM
Hi Vishnu,

Unfortunately, I am still unable to reproduce the behavior you are observing. Please try to provide us with a sample project which demonstrates the problem and we will do our best to address it.

Thank you for your cooperation!

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sandra
Top achievements
Rank 1
answered on 30 Oct 2013, 04:06 PM
I have attached three screenshots demonstrating the effects of the issue and will be posting sample code later today. 

In the screenshots you can see the formatting differences between Normal, Bold, and Bold Italic for 18pt Times New Roman. Other font families and other font sizes also exhibit this behavior but these are illustrative. This issue presents for Italic without Bold as well but showing the Bold Italic highlights the issue nicely.

In each screenshot I have highlighted the same sections of text for visual reference.

What you see in the Normal selection is the text displayed with no cutoff and fills up seven lines almost exactly. In the Bold selection you see that the text is also displaying with no cutoff and fills up a majority of eight lines. The problem is with the Bold Italic.

First note the words are being cut off in the middle. Also note that the Bold Italic takes up about eight and a third lines (less than Bold but more than Normal). This is similar to how Word behaves - the Bold Italic text takes up less space than the plain Bold text. 

To describe this is non-code terms I do the following
  1. Create a RadDocument
  2. Add a Section
  3. Add a Paragraph and set the paragraph's font size to 1.25 the value that will be in the text. All of the text in the paragraph will be formatted with the same family, size, and style.
  4. Add a Span and set the family, size, and style and then add the text to it.

You will also note in the screenshots the "Effective Date" and "Revision Date" are displaying fully. This only happens when I append a non-breaking space (NBSP) to the end of the Italic date. If I do not append the NBSP then the last character of the date is cut off. A plain space character will leave the date cut off as well so a NBSP is required here.

More coming later today.

Many thanks!
0
Sandra
Top achievements
Rank 1
answered on 30 Oct 2013, 09:34 PM
I'm making my sample application more and more complex to try and replicate the issue but it still works great on the sample app and still fails in my application.

I pulled out a utility called "Snoop" (http://snoopwpf.codeplex.com/releases/view/87261) to try and see if there are any differences in the application structure that might be of note. I've attached a screenshot from the sample application (sampleeditingcontext.png) and the main application. You can see the container hierarchy and see that the application hierarchy is significantly more complex than the sample app hierarchy.

Additionally what these screenshots are showing are the EditingContext for the RadRichTextBox in both applications. To my surprise the context for the sample application has *much* more data. That being said I'm not certain how much the "more" matters. The one thing that does pique my interest though is the context for the application showing the difficulty has a Font Size of 14 where the sample app does not. 

What does the EditingContext do? How are these properties set? Are they inherited from someone else? Does the Font Size matter in terms of how the text box will render text that is set at 10px instead of 14?

Help please.


0
Boby
Telerik team
answered on 04 Nov 2013, 06:30 PM
Hello Sandra,
Actually you are observing differences in CurrentEditingStyle property, which value may depend on the caret position and the loaded document.
Anyway, sometimes problems similar to yours may occur if  a style is implicitly set to TextBlock or some other element which is used internally by the RadRichTextBox for visualizing the content. Could you try to remove all custom styles (especially for TextBlock) in your application? If this is the problem, you may be able to work around it by re-setting the default TextBlock style only in the scope of RadRichTextBox.

Let us know if this helps.

Regards,
Boby
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sandra
Top achievements
Rank 1
answered on 05 Nov 2013, 09:49 PM
In my UserControl.Resources section of my XAML file I added the following:
        <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
        </Style>

In my RadRichTextBox I set Style="{x:null}" as follows:
            <telerik:RadRichTextBox Grid.Row="4" IsReadOnly="True" x:Name="rtbHtmlTestRad" LayoutMode="Flow" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Margin="0" Padding="10" BorderThickness="1" Style="{x:Null}" >
                <telerik:RadRichTextBox.BorderBrush>
                    <SolidColorBrush Color="#FFD0D0D0" telerik:Windows8Colors.Color="Basic"/>
                </telerik:RadRichTextBox.BorderBrush>
            </telerik:RadRichTextBox>

If the issue is with the TextBlock style is there another (better?) way of setting that?

rjsjr
0
Boby
Telerik team
answered on 07 Nov 2013, 08:42 AM
Hello Sandra,
Could you specify the version you are using, as in the recent versions RadRichTextBox is not affected from the implicit styles set to TextBlock, which may make my  suggestion irrelevant depending on the version.
Also ensure that you are not setting any of the properties of the TextOptions class in the scope of RadRichTextBox, as these are not supported by the control.

If the mentioned suggestions don't help, please try to reproduce the problem in sample application and send it to us in a support ticket for further investigation.

Regards,
Boby
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sandra
Top achievements
Rank 1
answered on 07 Nov 2013, 03:07 PM
I'm using 2013.2.0724.40

I don't think I'm doing anything with TextOptions at all but will look again. 

I have tried creating a sample project replicating code and layout and the sample project does not show the issue. We're working with some internal resources to try and figure this out and if I can't get it figured out tomorrow I'm going to send it to y'all on Monday. Hopefully your upload facility will take a really big file. If not, we have a corporate facility that I can send you the code with if I have an email address.

Thanks!

0
Sandra
Top achievements
Rank 1
answered on 07 Nov 2013, 04:08 PM
THANK YOU!!!

In a (I thought) completely unrelated .xaml file I found
        TextOptions.TextFormattingMode="Display"

And when I removed that entry the text is now displaying properly.

THANK YOU! THANK YOU! THANK YOU!
0
Jhon
Top achievements
Rank 1
Iron
answered on 03 Nov 2021, 10:37 AM | edited on 03 Nov 2021, 10:40 AM

Hi telerik team,
I am doing a editor base on radrichtextbox telerik wpf.
And I have an issue about "word cut off".
Please help and provide the solution for this case.
The steps to reproduce:

1. Input test

2. Change font family is "Impact"

3. Change the font size is "22"

4. Change the format is "Italic"

=> See the issue happened.

Thank you!

0
Dimitar
Telerik team
answered on 04 Nov 2021, 10:03 AM

Hi Jhon,

I was able to reproduce the observed issue. I have logged it on your behalf. You can track its progress, subscribe to status changes, and add your comment to it here. I have updated your Telerik points well. 

Unfortunately, due to the nature of the issue, I cannot suggest a workaround.  

Thank you for your understanding.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
RichTextBox
Asked by
Kevin
Top achievements
Rank 2
Answers by
Iva Toteva
Telerik team
Couchetard
Top achievements
Rank 1
Mihail
Telerik team
Vishnu
Top achievements
Rank 1
Petya
Telerik team
Sandra
Top achievements
Rank 1
Boby
Telerik team
Jhon
Top achievements
Rank 1
Iron
Dimitar
Telerik team
Share this question
or