Skip to content

Remove dead code in FontSourceCollection/FontSource (+ hollow CAS remnants) #9838

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

Merged
merged 6 commits into from
Dec 18, 2024

Conversation

h3xds1nz
Copy link
Member

@h3xds1nz h3xds1nz commented Sep 24, 2024

Description

Removes skipDemand from FontSource as it is not used for anything anymore, it was used in NetFx for figuring out whether to demand permissions.

Also removes isWindowsFonts from FontSourceCollection, because this is already a dead code in latest NetFx as the internal constructor from FamilyCollection that allowed true has been removed at the same time it stopped deriving from IFontCacheElement and it has been replaced by FamilyCollection.FromWindowsFonts which uses DirectWrite factory, so it never reaches FontSourceCollection on this code path. It is also way faster if you would run it.

Customer Impact

Smaller code size of PresentationCore, cleaner code size for developers, faster JITTing, decreased allocs.

Regression

No.

Testing

Local build, app run, work with custom font sources.

Risk

Low, as it is a dead code. I do not believe anything relies on the original shape of the ctors either.

Microsoft Reviewers: Open in CodeFlow

@h3xds1nz h3xds1nz requested review from a team as code owners September 24, 2024 22:26
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage Community Contribution A label for all community Contributions labels Sep 24, 2024
@himgoyalmicro himgoyalmicro merged commit b11d44d into dotnet:main Dec 18, 2024
8 checks passed
@himgoyalmicro
Copy link
Contributor

Thank you @h3xds1nz for your contribution 😄

@h3xds1nz
Copy link
Member Author

@himgoyalmicro Thank you for including it :)

@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants