Skip to content

Add FontCollection.AddSystemFontCollection #195

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
Aug 19, 2021

Conversation

JimBobSquarePants
Copy link
Member

@JimBobSquarePants JimBobSquarePants commented Aug 16, 2021

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Implements FontCollection.AddSystemFontCollection() extension and normalizes the process of adding metrics to the underlying collection.

@codecov
Copy link

codecov bot commented Aug 16, 2021

Codecov Report

Merging #195 (5899252) into master (97e3ed6) will increase coverage by 0.09%.
The diff coverage is 91.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #195      +/-   ##
==========================================
+ Coverage   86.91%   87.00%   +0.09%     
==========================================
  Files          98       99       +1     
  Lines        4654     4656       +2     
  Branches      758      757       -1     
==========================================
+ Hits         4045     4051       +6     
+ Misses        484      482       -2     
+ Partials      125      123       -2     
Flag Coverage Δ
unittests 87.00% <91.30%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/SixLabors.Fonts/FontCollection.cs 87.50% <87.50%> (+3.62%) ⬆️
src/SixLabors.Fonts/FontCollectionExtensions.cs 100.00% <100.00%> (ø)
src/SixLabors.Fonts/SystemFontCollection.cs 95.83% <100.00%> (+0.37%) ⬆️

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 97e3ed6...5899252. Read the comment docs.

/// </summary>
/// <param name="collection">The font collection.</param>
/// <returns>The <see cref="FontCollection"/> containing the system fonts.</returns>
public static FontCollection AddSystemFontCollection(this FontCollection collection)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public static FontCollection AddSystemFontCollection(this FontCollection collection)
public static FontCollection AddSystemFonts(this FontCollection collection)

reads better and prevents users needing to understand that we have a separate collection for system fonts laying around (that feels like implementation detail to me)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah that’s better! I chose the original name to match our use of Collection suffix elsewhere but that actually makes things for confusing since thats for ttc files.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@JimBobSquarePants JimBobSquarePants merged commit 5bb6324 into master Aug 19, 2021
@JimBobSquarePants JimBobSquarePants deleted the js/system-font-api branch August 19, 2021 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants