Two-finger pinch now does both zoom (distance change) and Z-axis
rotation (angle change) simultaneously. Adds demo_view_rotate_z()
for direct Z-axis rotation from touch input.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace demo_glstate_t with demo_renderer_t interface, use
demo_renderer_create_gl(), and add demo-renderer-gl.cc to
the web build.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a "text" button that opens a modal textarea with the current
text. Apply sends new text to WASM, flushing the glyph cache and
atlas. Custom text is preserved across font changes.
Also adds demo_font_clear_cache() and demo_atlas_clear() for
flushing state without full destroy/recreate.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Don't call demo_view_display from main() — let the main loop
handle the first frame. The premature call could render before
the browser's canvas was ready, and since it cleared needs_redraw,
no subsequent frame was drawn until user interaction.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a font button and drag-and-drop support to the web demo.
When a user provides their own .ttf/.otf font, the glyph cache
and atlas are flushed and the display is rebuilt with English-only
text (since the font may not support Persian).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Generate default-text-combined.hh with 35 lines of English +
35 lines of Persian for the web demo, matching the desktop
demo's adaptive line count.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Check the font's GSUB table for Latin and Arabic script support.
Build default demo text from English (Lorem Ipsum) and Persian
paragraphs for supported scripts, cropped to 35 lines each.
Source paragraphs live in perf/texts/{en,fa}-paragraph.txt.
gen-default-texts.py wraps them at fixed width and generates
the .hh headers.
Web demo hardcodes both texts since the embedded font supports
both scripts.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Web build using Emscripten + WebGL2 with HB_GPU_ATLAS_2D mode.
Touch support: drag to pan, tap to toggle animation.
FPS counter overlay. Viewport meta for mobile.
Fix cursor position on first touch by querying glfwGetCursorPos
in mouse_func. Left click/tap also toggles animation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>