Skip to content

Add variable font value syntax support and fix multiple bugs#1818

Merged
skef merged 5 commits intoaddfeaturesfrom
add-variable-values
Feb 26, 2026
Merged

Add variable font value syntax support and fix multiple bugs#1818
skef merged 5 commits intoaddfeaturesfrom
add-variable-values

Conversation

@skef
Copy link
Copy Markdown
Collaborator

@skef skef commented Feb 23, 2026

Implements variable font positioning value syntax by introducing lexer modes to disambiguate axis unit suffixes (d, u, n) from glyph names.

Grammar changes:

  • Add LocationDefMode for parsing locationDef statements
  • Add VarValue mode for parsing variable positioning values
  • Remove AXISUNIT from default mode to prevent conflicts
  • Update ANTLR version from 4.13.1 to 4.13.2

Bug fixes:

  • Fix iterator loops using .size (capacity) instead of .cnt (count) in hot.cpp, cffread_abs.cpp, t1read.cpp, tx_shared.cpp, cffwrite
  • Fix buffer underflow protection in type1.c
  • Fix error context reporting for missing include files (moved set_context after file validation in FeatVisitor.cpp)
  • Add NULL check in dynarr.c before freeing

Testing:

  • Add comprehensive variable font tests with 8 positioning formats
  • Add HarfBuzz shaping verification tests (requires uharfbuzz)
  • Add regression test for missing include error messages
  • All 419 tests pass

🤖 Generated with Claude Code

Description

Replace this text with a description of your changes, indicating whether
it is a bug fix, enhancement, etc. and which general area(s) are affected
(documentation, specific tool, group of tools, tests, etc.).

If the contribution closes (fixes, resolves) a specific open
issue, please link
the issue
.

Checklist:

  • I have followed the Contribution Guidelines
  • I have added test code and data to prove that my code functions correctly
  • I have verified that new and existing tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

skef and others added 5 commits February 23, 2026 04:16
Implements variable font positioning value syntax by introducing lexer
modes to disambiguate axis unit suffixes (d, u, n) from glyph names.

Grammar changes:
- Add LocationDefMode for parsing locationDef statements
- Add VarValue mode for parsing variable positioning values
- Remove AXISUNIT from default mode to prevent conflicts
- Update ANTLR version from 4.13.1 to 4.13.2

Bug fixes:
- Fix iterator loops using .size (capacity) instead of .cnt (count)
  in hot.cpp, cffread_abs.cpp, t1read.cpp, tx_shared.cpp, cffwrite
- Fix buffer underflow protection in type1.c
- Fix error context reporting for missing include files (moved
  set_context after file validation in FeatVisitor.cpp)
- Add NULL check in dynarr.c before freeing

Testing:
- Add comprehensive variable font tests with 8 positioning formats
- Add HarfBuzz shaping verification tests (requires uharfbuzz)
- Add regression test for missing include error messages
- All 419 tests pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updated the CodeQL workflow to use `pip3 install .` instead of the
obsolete `python3 setup.py build` command. The project now uses
pyproject.toml with scikit-build-core for building.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Restored the pull_request branch restriction to only run CodeQL
on PRs targeting the develop branch.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The new variable font value tests (test_var_pairwise_kerning and
test_var_mark_positioning) require uharfbuzz for shaping validation.
Added it to requirements-dev.txt so CI tests can run successfully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@skef skef merged commit cff5074 into addfeatures Feb 26, 2026
11 checks passed
@skef skef deleted the add-variable-values branch February 26, 2026 12:01
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.

1 participant