microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.31k stars 676 forks source link

Proposal: Make Typography features available for TextBox andRich EditBox #627

Open Leisvan opened 5 years ago

Leisvan commented 5 years ago

Proposal: Make Typography features available for TextBox or RichEditBox.

Summary

Windows.UI.Xaml.Documents.Typography class provides support for OpenType features. In theory it should work across text controls in UWP. The thing is it doesn't work for text controls that are editable such as TextBox and RichEditBox. For TextBlock and RichTextBlock it works just fine.

Rationale

If you want to make OpenType features visible for a user in a text editor, UWP is hell. It would be great if you could use OpenType features in those controls

Thanks

chrisglein commented 4 years ago

@ddalp Do you happen to know the history of why this is supported on TextBlock but not TextBox? The docs are clear that it's not supported, but not why:

https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Documents.Typography

Note You cannot use these properties with the TextBox or RichEditBox controls.

Felix-Dev commented 4 years ago

@chrisglein It appears to me you might need to fix the tagging of "@didalp" as it doesn't appear to have worked.

chrisglein commented 4 years ago

Fixed. Meant to tag @ddalp

ddalp commented 4 years ago

@chrisglein I think the feature was dated back to SliverLight, but was never implemented for Text Edit Control. I remember something to do with DWrite glyph analyzer on RichTextBlock, and DWrite text layout for fast path TextBlock. I would believe we can probably follow the RichTextBlock's code path for TextBox and RichEditBox if we want to implement this feature for Text Edit Controls.