about chinese font

4 posts, 0 answers
  1. rock
    rock avatar
    6 posts
    Member since:
    May 2007

    Posted 06 Jan 2011 Link to this post

    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

  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 10 Jan 2011 Link to this post

    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
  3. DevCraft banner
  4. rock
    rock avatar
    6 posts
    Member since:
    May 2007

    Posted 10 Jan 2011 Link to this post

    hi,
    thank for your reply.
    hope you can add this fuction(support chinese font family) to radrichtextbox in the future.

    Best Regards.
  5. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 12 Jan 2011 Link to this post

    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>>
Back to Top