0
0

20 Commits

Author SHA1 Message Date
403689b935 Fix hardcoded absolute paths to make builds portable for GitHub Actions 2026-06-27 20:20:27 -04:00
676253405e Update source repository URL to GitHub and add prominent demo link to README.md 2026-06-27 20:07:56 -04:00
962d81a32f Direct input text size matching and sample toggling
- When checkbox is checked, hide the bottom '#qr' rendering sample.
- When checkbox is checked, apply the font size slider value directly to the textbox.
2026-06-27 20:04:08 -04:00
e3ab75787d Restore 3L build, update Makefile targets, and add direct textbox QR styling toggle
- Re-enables the 3L version of the font in tools/build_font.py and Makefile.
- Removes /Downloads/qrfont copy targets from Makefile.
- Adds the --delete flag to the Makefile deploy target for remote cleanup.
- Adds an interactive checkbox to index.html ('Apply QR font to textbox') allowing users to type directly in the QR font and observe zero-advance cursor/shaping behavior.
2026-06-27 20:02:17 -04:00
9f891eb4f5 Zero-advance layout: fix Firefox alignment, remove LigateBreak experiment
- All intermediate QR glyphs (header_bits, byte_XX, count, tail,
  parity, data bits, parity bits) use native 0 advance in hmtx.
- Only closing base glyphs (qr_base_NN, qr_base_p55_bit_NN) have
  positive ADVANCE width.
- No GDEF table, no GPOS positioning adjustments.
- Removes LigateBreak ligature experiment (didn't prevent splitting).
- Fixes Firefox horizontal misalignment caused by subpixel snapping
  of GPOS-adjusted or GDEF Mark-classified glyphs.
- Known limitation: Chrome and Firefox may split QR codes across lines
  at Unicode break points (spaces, dots, slashes). CSS white-space:
  nowrap on QR-containing elements is recommended.
- Temporarily disables 3L font build for faster iteration.
- Separates HTML generation into tools/build_html.py.
- Updates AGENTS.md and design.md with browser layout documentation.
2026-06-27 18:50:06 -04:00
608aacd7c6 Revert "Anchor qr_base to header_bits at the beginning of the QR block to prevent wrapping splits"
This reverts commit b2497b2214.
2026-06-27 01:19:59 -04:00
b2497b2214 Anchor qr_base to header_bits at the beginning of the QR block to prevent wrapping splits
* Modify SetBase_{length} to substitute header_bits (at the position of "[") with qr_base_{length} instead of substituting close_delim.
* Update CloseQR chaining rules to target header_bits at the start and replace it with SetBase_{length}, and target close_delim at the end and replace it with HideClose (empty).
* Update the matched context to correctly include len_00 (for length == 0) and @byte_00 (for length > 0) between header_bits and @s0.
2026-06-27 01:15:38 -04:00
210b53745c Set line-height of .qr class to 1.2 to prevent descender vertical clipping 2026-06-27 01:07:48 -04:00
57cf048af1 Revert QR code height back to 1.0 EM and set CSS line-height back to 1.0
* Revert UNITS_PER_EM = ADVANCE in tools/build_font.py to restore the QR code height to exactly 1.0 EM.
* Revert CSS line-height of the .qr block in tools/build_html.py back to 1.0.
2026-06-27 01:06:17 -04:00
3494f815c3 Set font size slider to 10-300px, default to 100px, and increase line-height to 1.5
* Change size-slider and size-input range limits from 10-400px to 10-300px, defaulting to 100px.
* Increase .qr line-height from 1 to 1.5 in CSS to accommodate the 1.5 EM high QR glyphs and prevent line overlaps.
2026-06-27 01:03:23 -04:00
a339c881ba Scale QR code heights to 1.5 EM relative to EM square height
* Modify configure_qr() and global initialization to define UNITS_PER_EM = round(ADVANCE / 1.5). This sets the EM coordinates scale to be smaller than the QR block height (ADVANCE), causing the QR code to render at exactly 1.5 EM high while keeping the Latin text at its standard 1.0 EM size.
2026-06-27 01:01:13 -04:00
896ce461b1 Correct Latin text scaling, implement FOUT mitigation, and update size slider limits
* Restore the base-font EM-proportional scaling calculation (scale = (UNITS_PER_EM / unitsPerEm) * LATIN_SCALE) in tools/build_font.py to ensure the Latin text height stays perfectly consistent across all QR versions and matches Plain Sans size.
* Add HTML link rel="preload" tags to load all three fonts in parallel when index.html is loaded.
* Add font-display: block to @font-face declarations to mitigate FOUT when switching between fonts.
* Implement query parameter cache-busting hashes (?h=<sha256_hash>) for the font references generated dynamically during HTML build.
* Expand the Font Size slider minimum limit down to 10px (previously 20px).
2026-06-27 00:57:38 -04:00
1189dd3b25 Replace Mono option with Plain Sans and keep font size slider enabled globally
* Replace the "Mono" option in the dropdown with "Plain Sans (no QR parsing)".
* Add .qr.mode-sans CSS styling to use Liberation Sans.
* Simplify JS size logic to keep the font size slider always enabled and active for all modes.
2026-06-27 00:49:36 -04:00
0b0e029d55 Set Latin scale to 1.0, fix descender clipping, and update demo text
* Increase LATIN_SCALE to 1.00 to render Latin text at its full native baseline size.
* Change .qr CSS box-sizing to content-box and add 12px 16px padding to prevent descender vertical clipping.
* Change default demo text from "Download this font:" to "This page:".
2026-06-27 00:48:17 -04:00
3e25ab8e26 Make Latin text scale uniform and remove snap-to-grid rounding
* Set scale = LATIN_SCALE directly to ensure Latin characters keep the exact same visual size across 1-L, 2-L, and 3-L fonts.
* Set LATIN_SCALE to 0.70.
* Remove the snap-to-grid advance width constraint so that Latin characters spacing is natural.
2026-06-27 00:44:25 -04:00
be254ca9e3 Increase Latin scale, add metadata URL, and add webpage size controls
* Add qr.jim.sh URL to the font copyright, designerURL, and vendorURL metadata.
* Increase LATIN_SCALE from 0.20 to 0.50 so surrounding Latin text is larger and more readable.
* Add a styled Font Size range slider and number input box to the web page control panel to support dynamic visual sizing (20px to 400px, centering at 200px).
2026-06-27 00:42:08 -04:00
532d83d937 Rename demo.html -> index.html, separate HTML generation, and add deploy target
* Rename demo.html to index.html in the build and Makefile output.
* Separate HTML page generation into tools/build_html.py, removing the HTML template and write_demo logic from tools/build_font.py.
* Define correct dependency targets in the Makefile so that changes to tools/build_html.py only regenerate index.html and do not trigger a slow font build.
* Add a `make deploy` target that runs `rsync -avz dist/ psy:/www/qr/`.
2026-06-27 00:38:36 -04:00
e6f00f6a78 Add Version 3-L QR font support and optimize GSUB lookup structure
* Add Version 3-L configurations and update documentation (AGENTS.md, README.md).
* Solve OpenType GSUB offset overflows and compiler bottlenecks:
  - Combine SetByte lookups per character instead of position/character, reducing the total lookup count from 5,300 to 510.
  - Implement useExtension on helper and scan lookups to bypass the 16-bit offset constraints.
  - Use class-to-class substitutions for XOR and NoOp lookups.
* Split CloseQR into CloseQR and CloseQR_CountTail to prevent shaper offset mismatches from Multiple Substitutions.
* Remove legacy reference.html output from the build and Makefile packaging.
* Update demo.html style and font selectors to support loading and displaying the 3L font with character limit labeling.
* Keep glyph names in setupPost() to ensure shape_debug.py outputs readable glyph names.
2026-06-27 00:27:54 -04:00
b19691a024 Make demo page public-facing 2026-06-26 21:27:06 -04:00
c451e8a9c0 Build QR code OpenType font 2026-06-26 21:21:05 -04:00