textboxuwpricheditbox

Uwp text rendering for a custom text box


I'm currently developing a custom text box for a word processing uwp app and, while I have seen the Windows.Ui.Core.Text library for text input managing, I can't understand how do the default textbook and richeditbox controls render their text? I suppose that they use a low level library, instead of using textblock controls, but I can't find which they use.


Solution

  • You may render text using Win2D. Check here: https://microsoft.github.io/Win2D/html/T_Microsoft_Graphics_Canvas_Text_CanvasTextLayout.htm

    And samples here: https://www.microsoft.com/en-us/store/p/win2d-example-gallery/9nblgggxwt9f