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

PdfSharpCore.Utils.FontResolver code cleanup, refactor #268

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 Report

Merging #268 (91c7cd5) into master (2828a90) will increase coverage by 0.00%.
The diff coverage is 56.80%.

@@           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     
Impacted Files Coverage Δ
PdfSharpCore/Internal/FontFamilyModel.cs 40.00% <ø> (ø)
PdfSharpCore/Utils/FontResolver.cs 46.93% <49.53%> (-9.80%) ⬇️
PdfSharpCore/Utils/FontFileInfo.cs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2828a90...91c7cd5. Read the comment docs.

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