Skip to content

Housekeeping dependencies - #158

Merged
stesee merged 7 commits into
mainfrom
HousekeepingDependencies
Oct 10, 2025
Merged

Housekeeping dependencies#158
stesee merged 7 commits into
mainfrom
HousekeepingDependencies

Conversation

@stesee

@stesee stesee commented Oct 10, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

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.
Copilot AI review requested due to automatic review settings October 10, 2025 18:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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);

Copilot AI Oct 10, 2025

Copy link

Choose a reason for hiding this comment

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

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);

Copilot uses AI. Check for mistakes.
Comment thread OpenXmlPowerTools/FontMetric/FontStyle.cs Outdated
Comment thread OpenXmlPowerTools/FontMetric/FontStyle.cs Outdated
stesee and others added 3 commits October 10, 2025 20:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@stesee
stesee merged commit d3d211a into main Oct 10, 2025
6 checks passed
@stesee
stesee deleted the HousekeepingDependencies branch October 10, 2025 22:12
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants