Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add new advanced text api (D2D1 + DWrite back-end only) #17

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

mity
Copy link
Owner

@mity mity commented Feb 17, 2019

Disclaimer: This is work in progress. Anything here can be changed anytime. You have been warned.

WinDrawLib already supports simple string rendering. This PR is about more advanced text rendering, so things like this could be implemented on top of it:

  • interactive work with the text.
  • advanced text edit control component,
  • rendering of rich/complex document formats (HTML, Markdown, etc).

Note all this is for D2D1 + DWrite back-end only. Once we have something reasonably complete, we might consider also adding support for gdi+ back-end.

Rendering features:

  • Render complex text paragraph using different font weights.
  • Ditto for font styles (normal/italic/oblique).
  • Ditto for font families (e.g. for nesting a monotype font span inside a normal text).
  • Ditto for colors and/or brushes.
  • Ditto for font sizes.
  • Ditto for underlined text.
  • Ditto for strikethrough text.
  • Inserting inline images and/or custom drawn areas
  • Replacing/augmenting text range with some painted stuff (consider e.g. a visualization of a whitespace for editor like apps, text selection)

Additional features:

We need to redo the initialization because WinDrawLib interface modules
do not match 1:1 to the implementation modules, from now on.

In particular, with the D2D1 back-end, we use DWrite both for the string
API and (new not yet implemented) advanced text API.

The reason for disntinguishing string and text API is that later, we
shall likely implement the text API also for GDI+ back-end using
Uniscribe, but the simple string API does not need to load it.
The cached canvas retains the painted contents; so we can skip all the
painting (as long as we need to paint the stuff dfferently).
Note it is really supported only in DWrite backend on Windows 8 and
newer. If not supported, it falls back to left alignement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant