Image labels for alphabet symbols (RFC 0014) - #52
Merged
Conversation
Optional 'image' attribute on alphabet XML nodes, exposed via dasher_get_alphabet_symbol_image(). Frontends query once, cache, substitute images for text labels during rendering. - AlphInfo.h: character.Image field + GetImage() getter - AlphIO.cpp: parse optional 'image' attribute on <node> - dasher.h + CAPI.cpp: dasher_get_alphabet_symbol_image() C API function - test_image_labels.cpp: backward compat, error handling, round-trip tests Signed-off-by: Will Wade <will.wade@aactools.org>
Needed for image label map keying — opcode 5 strings carry display text, not output text. Signed-off-by: Will Wade <will.wade@aactools.org>
willwade
added a commit
to dasher-project/Dasher-Apple
that referenced
this pull request
Aug 1, 2026
…30) **This is experimental and partially a proof of concept.** It demonstrates two RFCs working together: ## RFC 0014: Image labels in alphabets - Optional `image` attribute on alphabet XML nodes - `dasher_get_alphabet_symbol_image()` + `dasher_get_alphabet_symbol_display()` in DasherCore (PR dasher-project/DasherCore#52) - Frontend queries at alphabet switch, caches `[displayText: NSImage]`, substitutes in opcode 5 render path - Works for both Strand 1 and Strand 2 frontends ## Phoneme Dasher - X-SAMPA phoneme alphabet with PPM prediction + SpeechMarkdown TTS - Two variants: - **English X-SAMPA Phonetic**: text labels (IPA glyphs) - **English X-SAMPA Phonetic (Symbols)**: SVG phoneme images in boxes - 46 SVG phoneme symbols from `phonemeSymbols/svg/semantic/` - Training data: 57K lines / 1.5M (combined hand-transcribed + espeak-ng auto-converted) ## What's proven - The alphabet XML `image` attribute parses correctly through AlphIO - The C API exposes image paths to frontends - SVG images load and render inside Dasher boxes on macOS - The phoneme alphabet works with Dasher's PPM language model (expanded training data) - TTS speaks phonemes correctly via SpeechMarkdown X-SAMPA wrapping ## Known limitations - **Image sizing**: uses `fontSize * 1.5` (engine-computed, stable). Proper box-fit would need Strand 2 node bounds (`screen_x1/y1/x2/y2`) — future work. - **No iOS/visionOS image rendering yet** (macOS only in this PoC) - **No user-importable image sets yet** - **Phoneme-to-word prediction** (as in Trinh et al.) is not implemented ## Depends on - DasherCore PR #52 (`feat/image-labels` branch) - governance PR #21 (RFC 0014) Signed-off-by: Will Wade <will.wade@aactools.org> Signed-off-by: will wade <willwade@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds optional
imageattribute on alphabet XML nodes, exposed via two C API functions. Frontends query once at startup, cache, and substitute images for text labels during rendering.Changes
AlphInfo.h:character.Imagefield +GetImage()getterAlphIO.cpp: parse optionalimageattribute (1 line)dasher.h+CAPI.cpp: two C API functions:dasher_get_alphabet_symbol_image()— image path for a symboldasher_get_alphabet_symbol_display()— display label (needed to key the image map; opcode 5 strings carry display text, not output text)test_image_labels.cpp: backward compat, error handling, round-trip (258 assertions, all pass)Design
[displayText → image], substitutes during renderimageattributes return empty stringsProof of concept
Validated end-to-end in Dasher-Apple PR #30 (phoneme branch) with SVG phoneme symbols. Experimental — not merged to Dasher-Apple main yet.
RFC