Skip to content

Conversation

@JimBobSquarePants
Copy link
Member

@JimBobSquarePants JimBobSquarePants commented Dec 16, 2024

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

Fixes #429 by ensuring that we test against the substituted codepoint where possible. Also enhances CJK codepoint detection.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 12 out of 27 changed files in this pull request and generated 1 comment.

Files not reviewed (15)
  • samples/DrawWithImageSharp/DrawWithImageSharp.csproj: Language not supported
  • src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType4SubTable.cs: Evaluated as low risk
  • src/SixLabors.Fonts/FontMetrics.cs: Evaluated as low risk
  • src/SixLabors.Fonts/Tables/General/CMap/CMapSubTable.cs: Evaluated as low risk
  • src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/UniversalShaper.cs: Evaluated as low risk
  • src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/IndicShaper.cs: Evaluated as low risk
  • src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/HangulShaper.cs: Evaluated as low risk
  • src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/DefaultShaper.cs: Evaluated as low risk
  • src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType8SubTable.cs: Evaluated as low risk
  • src/SixLabors.Fonts/FileFontMetrics.cs: Evaluated as low risk
  • src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType3SubTable.cs: Evaluated as low risk
  • src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType1SubTable.cs: Evaluated as low risk
  • src/SixLabors.Fonts/Tables/AdvancedTypographic/GSub/LookupType2SubTable.cs: Evaluated as low risk
  • src/SixLabors.Fonts/GlyphSubstitutionCollection.cs: Evaluated as low risk
  • src/SixLabors.Fonts/StreamFontMetrics.cs: Evaluated as low risk
Comments suppressed due to low confidence (2)

src/SixLabors.Fonts/GlyphPositioningCollection.cs:95

  • The parameter name isVerticalSubstitution is inconsistent with other parts of the code. It should be renamed to isVertical.
out bool isVerticalSubstitution,

src/SixLabors.Fonts/Tables/General/CMap/Format14SubTable.cs:139

  • Ensure that the behavior of TryGetCodePoint always returning false is covered by tests.
public override bool TryGetCodePoint(ushort glyphId, out CodePoint codePoint)

isVerticalSubstitution = false;
isDecomposed = false;

Tag vert = FeatureTags.VerticalAlternates;
Copy link

Copilot AI Dec 16, 2024

Choose a reason for hiding this comment

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

The logic for checking vertical substitutions using FeatureTags.VerticalAlternates, FeatureTags.VerticalAlternatesAndRotation, and FeatureTags.VerticalAlternatesForRotation is duplicated in multiple places. This logic should be refactored into a separate method to avoid duplication and potential inconsistencies.

Suggested change
Tag vert = FeatureTags.VerticalAlternates;
isVerticalSubstitution = CheckVerticalSubstitution(glyph.Data.AppliedFeatures);

Copilot uses AI. Check for mistakes.
Copy link
Member Author

@JimBobSquarePants JimBobSquarePants Dec 16, 2024

Choose a reason for hiding this comment

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

Logic is applied within a loop with other tests. Cannot abstract.

Copy link
Member

@tocsoft tocsoft left a comment

Choose a reason for hiding this comment

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

looks good

@JimBobSquarePants JimBobSquarePants merged commit 1ee650a into main Dec 16, 2024
8 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/fix-vertical-layout branch December 16, 2024 10:06
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.

How can I vertical layout correctly?

3 participants