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.
During the test, it was found that
Document.GetDefaultCharacterFormat().Namecannot 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.