Skip to content

Add Vedic mark rendering prototype for Baloo Tammudu 2 (Telugu)#16

Open
revurpk wants to merge 1 commit into
EkType:masterfrom
revurpk:vedic
Open

Add Vedic mark rendering prototype for Baloo Tammudu 2 (Telugu)#16
revurpk wants to merge 1 commit into
EkType:masterfrom
revurpk:vedic

Conversation

@revurpk
Copy link
Copy Markdown

@revurpk revurpk commented May 24, 2026

This is a prototype for review generated using Claude Code, not a merge-ready implementation. The TODO list in the README captures what's still needed.

Adds rendering support for Vedic accent marks to all five weights of Baloo Tammudu 2 by grafting outlines from Noto Sans Devanagari (OFL) into the released TTX artefacts, then wiring proper OpenType layout.

Codepoints covered (45 total):

  • U+0951-U+0954 Devanagari Vedic accents (udatta, anudatta, grave, acute) - widely used in Telugu Sanskrit prosody
  • U+1CD0-U+1CFF Unicode Vedic Extensions block (41/48 assigned; gaps are Unicode 12/13 additions or unassigned codepoints that the donor does not have either)

Implementation

vedic-build/graft_vedic.py

  • Flattens donor composites via DecomposingRecordingPen.
  • Adapts geometry: above-marks have bbox-bottom aligned to Y=600 (Baloos existing mark band); all marks centered at X=-300 so they land over a typical Telugu base under static positioning.
  • Sets zero advance width, GDEF class 3 (mark), and adds cmap entries on the Windows BMP subtable.

vedic-build/add_vedic_gpos.py

  • Adds a new GPOS lookup (type 4, MarkBasePos) with anchors on 74 Telugu consonants (top-center at ymax + 220) and 27 Vedic above-marks (bottom-center at ymin).
  • Excludes above-base matras and halant from the base coverage so the mark attaches to the consonant directly rather than to a matras off-center bbox.
  • Registers a new abvm feature on the tel2 and telu scripts.

Build pipeline

TTX -> intermediate TTF (via fontTools.ttx)
-> patched TTF (via graft_vedic.py)
-> patched TTF (via add_vedic_gpos.py adds GPOS)

The five patched TTFs land in BalooTammudu2-Telugu/vedic-build/ and are gitignored (covered by repo-wide *.ttf rule); regenerate with the pipeline documented in vedic-build/README.md.

Scope and caveats

This is a non-authoritative prototype. The .vfb sources in BalooTammudu2-Telugu/*/VFB/ are unchanged. A feature request tracking the proper work has been filed at github.com/EkType/Baloo2/issues.

Limitations of the graft:

  • Style mismatch: Notos stroke contrast differs from Baloos.
  • Only above-marks get GPOS anchors; below-marks (U+0952 anudatta and a few in Vedic Extensions) rely on static positioning.
  • Tall above-base matras like matraIi come within ~80 units of the marks; tune BASE_ANCHOR_Y_GAP in add_vedic_gpos.py for more clearance.

TODO for the proper fix (full list in vedic-build/README.md):

  • Draw native Vedic glyphs in FontLab matched to Baloos display style, in all five weights. This is the blocker.
  • Add GlyphOrderAndAliasDB and GDEF entries for the new glyphs.
  • Design real GPOS anchors (above and below) in the .vfb sources rather than the heuristic this prototype uses.
  • Handle above-base matras via mkmk anchors or contextual GPOS instead of the current exclude-from-coverage workaround.
  • Register abvm/blwm features in the source feature tables so the fix survives the next VFB->TTF rebuild (this prototype patches GPOS at the TTF level only).
  • Cover the seven gaps the donor lacks (U+1CF7, U+1CFA).
  • Visual QA across a Vedic test corpus.
  • Remove vedic-build/ once proper sources ship.

Files changed

OFL.txt Noto attribution per OFL S4
BalooTammudu2-Telugu/vedic-build/.gitignore Skip donor tree, ephemera
BalooTammudu2-Telugu/vedic-build/README.md Pipeline, caveats, TODO
BalooTammudu2-Telugu/vedic-build/graft_vedic.py
BalooTammudu2-Telugu/vedic-build/add_vedic_gpos.py

Adds rendering support for Vedic accent marks to all five weights of
Baloo Tammudu 2 by grafting outlines from Noto Sans Devanagari (OFL)
into the released TTX artefacts, then wiring proper OpenType layout.

Codepoints covered (45 total):
  - U+0951-U+0954  Devanagari Vedic accents (udatta, anudatta,
                   grave, acute) - widely used in Telugu Sanskrit
                   prosody
  - U+1CD0-U+1CFF  Unicode Vedic Extensions block (41/48 assigned;
                   gaps are Unicode 12/13 additions or unassigned
                   codepoints that the donor does not have either)

Implementation
--------------
vedic-build/graft_vedic.py
  - Flattens donor composites via DecomposingRecordingPen.
  - Adapts geometry: above-marks have bbox-bottom aligned to Y=600
    (Baloos existing mark band); all marks centered at X=-300 so they
    land over a typical Telugu base under static positioning.
  - Sets zero advance width, GDEF class 3 (mark), and adds cmap
    entries on the Windows BMP subtable.

vedic-build/add_vedic_gpos.py
  - Adds a new GPOS lookup (type 4, MarkBasePos) with anchors on
    74 Telugu consonants (top-center at ymax + 220) and 27 Vedic
    above-marks (bottom-center at ymin).
  - Excludes above-base matras and halant from the base coverage so
    the mark attaches to the consonant directly rather than to a
    matras off-center bbox.
  - Registers a new abvm feature on the tel2 and telu scripts.

Build pipeline
--------------
  TTX -> intermediate TTF (via fontTools.ttx)
       -> patched TTF      (via graft_vedic.py)
       -> patched TTF      (via add_vedic_gpos.py adds GPOS)

The five patched TTFs land in BalooTammudu2-Telugu/vedic-build/ and
are gitignored (covered by repo-wide *.ttf rule); regenerate with
the pipeline documented in vedic-build/README.md.

Scope and caveats
-----------------
This is a non-authoritative prototype. The .vfb sources in
BalooTammudu2-Telugu/*/VFB/ are unchanged. A feature request tracking
the proper work has been filed at github.com/EkType/Baloo2/issues.

Limitations of the graft:
  - Style mismatch: Notos stroke contrast differs from Baloos.
  - Only above-marks get GPOS anchors; below-marks (U+0952 anudatta
    and a few in Vedic Extensions) rely on static positioning.
  - Tall above-base matras like matraIi come within ~80 units of the
    marks; tune BASE_ANCHOR_Y_GAP in add_vedic_gpos.py for more
    clearance.

TODO for the proper fix (full list in vedic-build/README.md):
  - Draw native Vedic glyphs in FontLab matched to Baloos display
    style, in all five weights. This is the blocker.
  - Add GlyphOrderAndAliasDB and GDEF entries for the new glyphs.
  - Design real GPOS anchors (above and below) in the .vfb sources
    rather than the heuristic this prototype uses.
  - Handle above-base matras via mkmk anchors or contextual GPOS
    instead of the current exclude-from-coverage workaround.
  - Register abvm/blwm features in the source feature tables so the
    fix survives the next VFB->TTF rebuild (this prototype patches
    GPOS at the TTF level only).
  - Cover the seven gaps the donor lacks (U+1CF7, U+1CFA).
  - Visual QA across a Vedic test corpus.
  - Remove vedic-build/ once proper sources ship.

Files changed
-------------
  OFL.txt                                       Noto attribution per OFL S4
  BalooTammudu2-Telugu/vedic-build/.gitignore   Skip donor tree, ephemera
  BalooTammudu2-Telugu/vedic-build/README.md    Pipeline, caveats, TODO
  BalooTammudu2-Telugu/vedic-build/graft_vedic.py
  BalooTammudu2-Telugu/vedic-build/add_vedic_gpos.py

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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