Skip to content

GlyphSet iterator doesn't seem to work #771

@ws-rob

Description

@ws-rob

At first I assumed this feature didn't exist, because it's missing in the TypeScript definitions, but after digging around in the source code it seems that a GlyphSet should indeed be iterable:

https://github.com/opentypejs/opentype.js/blob/master/src/glyphset.mjs#L47-L61

Expected Behavior

I should be able to iterate over a GlyphSet, for example using spread syntax, or using a for...of loop.

Current Behavior

Throws, despite [Symbol.iterator] apparently being set.

TypeError: <GlyphSet> is not iterable

Steps to Reproduce

  1. Load a font, and try to iterate over the glyphs property.
  2. TypeError: <GlyphSet> is not iterable should be thrown.

Your Environment

  • Version used: 1.3.4
  • Browser Name and version: Chrome 129.0.6668.101
  • Operating System and version (desktop or mobile): Win 11 64-bit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions