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

Fix Vertical Layout #432

Merged
merged 5 commits into from
Dec 16, 2024
Merged

Fix Vertical Layout #432

merged 5 commits into from
Dec 16, 2024

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

isDecomposed = false;

Tag vert = FeatureTags.VerticalAlternates;
Copy link
Preview

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 is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
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?
2 participants