Housekeeping dependencies - #158
Merged
Merged
Conversation
Upgraded several NuGet package versions in both OpenXmlPowerTools and test projects for improved compatibility and analyzer support. Added new PNG diff expectation files for various test cases to the TestFiles directory.
Migrated font metric logic from SixLabors.Fonts to SkiaSharp across the codebase for improved cross-platform compatibility. Added a new FontStyle enum, updated font family and style handling, and removed the SixLabors.Fonts dependency from the project file.
Upgraded DocumentFormat.OpenXml package to version 3.3.0. Updated PowerToolsBlockExtensionsTests to reflect new SDK behavior, where changes made through PowerTools are immediately visible to strongly-typed classes.
The GitHub Actions workflow for dotnet will no longer run on pull request events, only on push events. This simplifies workflow execution and may reduce unnecessary CI runs.
There was a problem hiding this comment.
Pull Request Overview
This PR performs dependency housekeeping by migrating from SixLabors.Fonts to SkiaSharp for font operations and updating various package versions.
- Replaced SixLabors.Fonts with SkiaSharp for font handling across multiple files
- Updated package versions including DocumentFormat.OpenXml, SonarAnalyzer, and test dependencies
- Introduced a custom FontStyle enum to replace SixLabors.Fonts.FontStyle
Reviewed Changes
Copilot reviewed 9 out of 36 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| OpenXmlPowerTools/PtOpenXmlUtil.cs | Migrated font operations from SixLabors.Fonts to SkiaSharp |
| OpenXmlPowerTools/OpenXMLWordprocessingMLToHtmlConverter/WmlToHtmlConverter.cs | Updated font handling to use SkiaSharp APIs |
| OpenXmlPowerTools/HtmlToWmlConverterCore.cs | Replaced SixLabors.Fonts imports and calls with SkiaSharp equivalents |
| OpenXmlPowerTools/MetricsGetter.cs | Converted text measurement logic from SixLabors.Fonts to SkiaSharp |
| OpenXmlPowerTools/FontMetric/FontStyle.cs | Added custom FontStyle enum to replace SixLabors dependency |
| OpenXmlPowerTools/OpenXmlPowerTools.csproj | Updated package versions and removed SixLabors.Fonts dependency |
| OpenXmlPowerTools.Tests/PowerToolsBlockExtensionsTests.cs | Updated test expectations for OpenXML SDK 3.3.0 behavior changes |
| OpenXmlPowerTools.Tests/OpenXmlPowerTools.Tests.csproj | Updated test-related package versions |
| .github/workflows/dotnet.yml | Removed pull_request trigger from CI workflow |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| var ff2 = SixLabors.Fonts.SystemFonts.Families.Single(font => font.Name == "Times New Roman"); | ||
| return _getTextWidth(ff2, fs, sz, text); | ||
| using var timesTypeface = SKTypeface.FromFamilyName("Times New Roman"); | ||
| return _getTextWidth(timesTypeface ?? typeface, fs, sz, text); |
There was a problem hiding this comment.
Potential null reference issue. If both timesTypeface and typeface are null, this will pass null to _getTextWidth which expects a non-null SKTypeface parameter.
Suggested change
| return _getTextWidth(timesTypeface ?? typeface, fs, sz, text); | |
| var tf = timesTypeface ?? typeface; | |
| if (tf == null) | |
| return 0; | |
| return _getTextWidth(tf, fs, sz, text); |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.