Skip to content

feat: native v5 alphabet XML format support (RFC 0005) - #31

Merged
willwade merged 1 commit into
mainfrom
feat/v5-alphabet-format
Jun 25, 2026
Merged

feat: native v5 alphabet XML format support (RFC 0005)#31
willwade merged 1 commit into
mainfrom
feat/v5-alphabet-format

Conversation

@willwade

Copy link
Copy Markdown

Dasher v5 shipped for 10+ years with a different alphabet XML schema. The AlphIO parser now accepts both v5 and v6 formats directly in DasherCore, so all frontends (Apple/Windows/GTK) benefit without a frontend-side converter.

Changes in AlphIO.cpp (all inline in Parse()/ReadCharAttributes — no function split, per the PR #28 postmortem):

  • Handle root wrapper (extract first child)
  • Recognise v5 elements alongside v6
  • Map v5 attributes: d->Display, t->Text fallbacks
  • Default text actions for elements (no action children)
  • Default colorGroup to 'lowercase' for v5 groups (no colorInfoName)
  • Read / child elements as metadata fallbacks

Critical fix beyond the original 6 changes: v5 alphabets never overwrite an existing alphabet with the same AlphID. The bundled oldAlphabets/ directory contains ~120 v5-format files (previously silently rejected) that share names with v6 alphabets — e.g. alphabet.english.xml is also named 'English with limited punctuation'. Without this guard, the v5 version clobbers the v6 default, losing the space character (the exact regression PR #28 hit for different reasons).

Tests (test_alphabet_xml.cpp):

  • alphabet_v6_space_character_resolves_to_space: regression guard for the space character (label 'square', unicode 32)
  • alphabet_v5_format_loads: root + symbols load
  • alphabet_v5_symbols_have_correct_text: display/text split + emoji
  • alphabet_v5_metadata_from_child_elements: / read

All 31 tests pass on Linux (clang/Debug). Full suite green.

Dasher v5 shipped for 10+ years with a different alphabet XML schema.
The AlphIO parser now accepts both v5 and v6 formats directly in
DasherCore, so all frontends (Apple/Windows/GTK) benefit without a
frontend-side converter.

Changes in AlphIO.cpp (all inline in Parse()/ReadCharAttributes — no
function split, per the PR #28 postmortem):
  - Handle <alphabets> root wrapper (extract first <alphabet> child)
  - Recognise v5 <s> elements alongside v6 <node>
  - Map v5 attributes: d->Display, t->Text fallbacks
  - Default text actions for <s> elements (no action children)
  - Default colorGroup to 'lowercase' for v5 groups (no colorInfoName)
  - Read <train>/<palette> child elements as metadata fallbacks

Critical fix beyond the original 6 changes: v5 alphabets never overwrite
an existing alphabet with the same AlphID. The bundled oldAlphabets/
directory contains ~120 v5-format files (previously silently rejected)
that share names with v6 alphabets — e.g. alphabet.english.xml is also
named 'English with limited punctuation'. Without this guard, the v5
version clobbers the v6 default, losing the space character (the exact
regression PR #28 hit for different reasons).

Tests (test_alphabet_xml.cpp):
  - alphabet_v6_space_character_resolves_to_space: regression guard for
    the space character (label 'square', unicode 32)
  - alphabet_v5_format_loads: <alphabets> root + <s> symbols load
  - alphabet_v5_symbols_have_correct_text: display/text split + emoji
  - alphabet_v5_metadata_from_child_elements: <train>/<palette> read

All 31 tests pass on Linux (clang/Debug). Full suite green.

Signed-off-by: will wade <willwade@gmail.com>
@willwade
willwade merged commit c4e50ce into main Jun 25, 2026
14 checks passed
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