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

Rewrite font snippet #1912

Merged
merged 3 commits into from
Oct 29, 2024
Merged

Rewrite font snippet #1912

merged 3 commits into from
Oct 29, 2024

Conversation

adegeo
Copy link
Contributor

@adegeo adegeo commented Oct 24, 2024

Summary

Multiple objects needed to be disposed, so I decided to rewrite the sample. The code for the font drawing was put in a single method which is called with the different styles.

To address the specific issues in the linked issue:

  • Added a comment on the declaration of privateFontCollection that says it's disposed later.
  • Disposed privateFontCollection at the end of the method.
  • Disposed the Font objects that were created.

Fixes #1872


Internal previews

📄 File 🔗 Preview link
dotnet-desktop-guide/framework/winforms/advanced/how-to-create-a-private-font-collection.md dotnet-desktop-guide/framework/winforms/advanced/how-to-create-a-private-font-collection

@dotnet-policy-service dotnet-policy-service bot added okr-health Content-health KR: Concerns article defects/freshness or build warnings. okr-quality labels Oct 24, 2024
@adegeo adegeo closed this Oct 25, 2024
@adegeo adegeo reopened this Oct 25, 2024
@adegeo adegeo requested a review from BillWagner October 25, 2024 16:52
@adegeo
Copy link
Contributor Author

adegeo commented Oct 25, 2024

@BillWagner ready for review. Thanks!

Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

This LGTM @adegeo

Let's :shipit:

@adegeo adegeo merged commit 927e1b4 into main Oct 29, 2024
12 checks passed
@adegeo adegeo deleted the font-1872 branch October 29, 2024 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
okr-health Content-health KR: Concerns article defects/freshness or build warnings. okr-quality
Projects
None yet
2 participants