Skip to content

Conversation

@JimBobSquarePants
Copy link
Member

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 #480

This pull request focuses on modernizing and simplifying the codebase by adopting collection expressions and more explicit empty initializations, as well as improving code clarity and safety. The changes primarily affect glyph loading and manipulation in the font rendering pipeline.

Key improvements include:

Modern C# Syntax and Code Simplification

  • Replaced new() and Array.Empty<T>() with collection expressions ([] and [.. collection]) for initializing lists and arrays in CompositeGlyphLoader and GlyphVector, making the code more concise and up-to-date with recent C# features. [1] [2] [3] [4]

  • Used index-from-end (^) operators for array assignments in GlyphVector.Hint, improving code readability when accessing elements from the end of an array.

Robustness and Explicit Return Values

  • Changed the default return value in GlyphTable.GetGlyph to explicitly return GlyphVector.Empty() instead of default, clarifying intent and reducing ambiguity for empty glyphs.

@JimBobSquarePants JimBobSquarePants merged commit c2dddae into main Nov 26, 2025
9 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/fix-480 branch November 26, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Another infinite loop when rendering text

2 participants