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

D2D Enable color font support #1884

Closed
wants to merge 5 commits into from

Conversation

Gillibald
Copy link
Contributor

@Gillibald Gillibald commented Sep 9, 2018

  • What does the pull request do?
    It removes the need for a custom TextRenderer and enables color fonts that way.
  • What is the current behavior?
    A custom TextRenderer is needed to supply a drawing effect to a text range. This was done due to a limitation of SharpDX.
  • What is the updated/expected behavior with this PR?
    Color fonts should now work and the rendering of text should be better performing. Ligatures should also work with the D2D backend.
  • How was the solution implemented (if it's not obvious)?

Fixes: #1817

Copy link
Member

@grokys grokys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the drawing effects applied and removed each time the text is rendered? Why not just apply them when the FormattedTextImpl is created?

@@ -265,14 +268,17 @@ public void DrawText(IBrush foreground, Point origin, IFormattedTextImpl text)
{
var impl = (FormattedTextImpl)text;

impl.ApplyDrawingEffects(this);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the drawing effects applied and removed each time the text is rendered? Why not just apply them when the FormattedTextImpl is created?

Copy link
Contributor Author

@Gillibald Gillibald Sep 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a render target to construct the effect brush. I would love to create the brush in ApplySpan. I assumed the FormattedText is only rendered once. That was obviously wrong. There could be a flag that is set when ApplyDrawingEffects is called to avoid recreation and dispose the brush when FormattedTextImpl is disposed.

@Gillibald Gillibald closed this Sep 26, 2018
@Gillibald Gillibald deleted the D2DTextRendererRemoval branch October 26, 2018 13:33
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.

2 participants