0
public MainPage()
{
    this.InitializeComponent();
    RichEditBox rbox = new RichEditBox();
    Canva.Children.Add(rbox);
    rbox.Document.SetText(0, "asdfasfasdfasdfasdfoiuytredfxbnuytrxgd ");
    rbox.Document.GetRange(0,10).CharacterFormat.Name = "ms-appx:///" + "Aguafina Script" + ".ttf#" + "Aguafina Script";
    rbox.Document.GetDefaultCharacterFormat().Name = "ms-appx:///" + "Aguafina Script" + ".ttf#" + "Aguafina Script";

}

From the above code by setting the fontfamily to the DefaultCharacterFormat is raising exception System.ArgumentException: 'Value does not fall within the expected range.' but setting the fontfamily for the range is working fine.

1 Answer 1

1

During the test, it was found that Document.GetDefaultCharacterFormat().Name cannot be set to more than 32 bytes. If your string is less than 32 bytes, it will work. It is recommended that you reduce your character length.

This is an unexpected behavior. I'd suggest you submit a feedback about this API in the Feedback Hub. You could find the Feedback Hub in the Start Menu. Please select Developer Platform->API Feedback as the category when you submit your request. The related team will check the request. After you submit the request, please share your link.

Sign up to request clarification or add additional context in comments.

1 Comment

here is the feedback link aka.ms/AAnz4ic

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.