Skip to content

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

Merged
himgoyalmicro merged 6 commits into
dotnet:mainfrom
h3xds1nz:font-src-deadcode
Dec 18, 2024
Merged

himgoyalmicro merged 6 commits into
dotnet:mainfrom
h3xds1nz:font-src-deadcode

Conversation

@h3xds1nz

@h3xds1nz h3xds1nz commented Sep 24, 2024 •

Copy link
Copy Markdown
Member

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
@himgoyalmicro

Copy link
Copy Markdown
Contributor

Thank you @h3xds1nz for your contribution 😄

@h3xds1nz

Copy link
Copy Markdown
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