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

Feature/stroked text #96

Merged
merged 7 commits into from
Nov 4, 2022
Merged

Feature/stroked text #96

merged 7 commits into from
Nov 4, 2022

Conversation

jingwood
Copy link
Owner

@jingwood jingwood commented Nov 3, 2022

Changes

Add the ability to create path geometry from a text, it allows to draw a stroked or gradient text with custom pen and brush.

Implements the #88.

image

API Sample Code

//
// Example 1: Create a path geometry from text and render it

var textPath1 = this.Device.CreateTextPathGeometry("Hello World", "Arial", 36, D2DFontWeight.ExtraBold);

g.TranslateTransform(100, 100);

g.FillPath(textPath1, D2DColor.Yellow);
g.DrawPath(textPath1, D2DColor.Blue, 3);

g.TranslateTransform(-100, -100);



//
// Example 2: Use a helper method to draw a stroked text in simplest way
//
g.DrawStrokedText("Stroked text rendered using D2DLib", 100, 200,
	D2DColor.DarkOliveGreen, 2, D2DColor.LightCyan, "Consolas", 24);

@jingwood jingwood requested a review from drewnoakes November 3, 2022 10:36
@jingwood jingwood marked this pull request as ready for review November 3, 2022 10:36
@jingwood jingwood merged commit b86786e into master Nov 4, 2022
@jingwood jingwood deleted the feature/strokedText branch November 4, 2022 02:24
@jingwood jingwood mentioned this pull request Nov 4, 2022
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