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

about chinese font

3 Answers 148 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
rock
Top achievements
Rank 1
rock asked on 06 Jan 2011, 10:43 AM

Hi,
i am using RadControls for Silverlight Q2 2010 in visual studio 2010.
i am using the below code to add FontFamily("STCAIYUN") to font combobox at runtime.but not take any effect.

private void UserControl_Loaded(object sender, RoutedEventArgs e)
      {
          FontFamily jokermanFontFamily = new FontFamily(@"/RuntimeCustomFonts;component/Fonts/STCAIYUN.TTF#????");
          RadRibbonComboBoxItem jokerman = new RadRibbonComboBoxItem();
          jokerman.Content = "????";
          jokerman.FontFamily = jokermanFontFamily;
          jokerman.Tag = "????";
          this.fontsComboBox.Items.Add(jokerman);
            
            
          TextBlock block = new TextBlock();
          block.FontFamily = jokermanFontFamily;
          this.LayoutRoot.Children.Add(block);
          this.Dispatcher.BeginInvoke(new Action(() =>
                 {
                    //for Q2 SP2
                     Span firstSpan = this.radRichTextBox.Document.Sections.First.Paragraphs.First.Inlines.First as Span;
                    //for Q3 2010 Beta and official Q3 2010 Release
                     //Paragraph firstParagraph = this.radRichTextBox.Document.Sections.First.Blocks.First as Paragraph;
                     //Span firstSpan = firstParagraph.Inlines.First as Span;
                     firstSpan.FontFamily = jokermanFontFamily;
                      
                     this.LayoutRoot.Children.Remove(block);
                 }
                  
                   ));
           
      }

 does RichTextBox support chinese font?

thank you very much!
Eric
www.componentcn.com

3 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 10 Jan 2011, 09:26 AM
Hi Eric,

Unfortunately, RadRichTextBox currently does not support writing in Chinese (using any font family).

As for adding a font family to the radComboBox, I'm assuming you have already generated the RadRichTextBoxRibbonUI control (if you are not - here is a blog post on how to do that). You will have to include your custom font as a resource in your project. You can check this tutorial to see more on using custom fonts in Silverlight. 
The final step is just to add a combo box item with your custom font in the fonts drop-down in the ribbon. Just make sure you set the correct path to the font in the Tag and FontFamily properties in your comboBoxItem. Here is how the XAML should look:

<telerik:RadRibbonComboBoxItem Content="STCAIYUN" FontFamily="Fonts/STCAIYUN.ttf#STCAIYUN" Tag="Fonts/STCAIYUN.ttf#STCAIYUN" />

(I am afraid that the example you have found works only as it comes to setting the font family used in RadRichTextBox the first time it is shown. Adding the above-shown line in the XAML, however, does the trick with the RadComboBox.)

If you have any other questions, do not hesitate to contact us again.

Kind regards,
Iva
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
rock
Top achievements
Rank 1
answered on 10 Jan 2011, 09:51 AM
hi,
thank for your reply.
hope you can add this fuction(support chinese font family) to radrichtextbox in the future.

Best Regards.
0
Iva Toteva
Telerik team
answered on 12 Jan 2011, 05:25 PM
Hi Eric,

We are researching the possibilities of using Input Method Editors in RadRichTextBox, which will enable writing in Chinese and other languages that make use of IME. I have created a PITS issue where you can vote and track our progress on this feature.
You can follow the PITS Issue by its ID: 4584 
Here you can find the PITS Issue: Public URL

All the best,
Iva
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
RichTextBox
Asked by
rock
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
rock
Top achievements
Rank 1
Share this question
or