Skip to content

PdfSharpCore.Utils.FontResolver code cleanup, refactor #268

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MichelMichels
Copy link
Contributor

As I was working on the previous support for the local AppData fonts in Windows, I noticed that the code was a bit 'old'.
Things I changed:

  • Swapped the static constructor with a default constructor and make use of a static _isInitialized field to check if another instance already has loaded the fonts
  • Swapped the Dictionary<string, FontFamilyModel> with a List<FontFamilyModel> and make use of LINQ to lookup the fonts
  • Extracted the struct FontFileInfo to its own file in PdfSharpCore.Utils
  • Renaming of a lot of properties/fields
  • Style fixes

There were no tests, so I couldn't check if this breaks something. I did do a quick check with the font families from the issue in PR #267 and this worked like expected.

@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2022

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 56.80000% with 54 lines in your changes missing coverage. Please review.

Project coverage is 26.63%. Comparing base (2828a90) to head (91c7cd5).
Report is 99 commits behind head on master.

Files with missing lines Patch % Lines
PdfSharpCore/Utils/FontResolver.cs 49.53% 46 Missing and 8 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #268   +/-   ##
=======================================
  Coverage   26.62%   26.63%           
=======================================
  Files         238      239    +1     
  Lines       23336    23360   +24     
  Branches     2809     2811    +2     
=======================================
+ Hits         6214     6221    +7     
- Misses      16629    16643   +14     
- Partials      493      496    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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