microsoft / microsoft/font-tools

Damage controls attach to inner sub-quadrat instead of outer quadrat in nested Egyptian layout

Open
#66 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
78
Forks
18
Avg merge
27m
Merged PRs (30d)
2

Description

## Summary

EgyptianOpenType / Egyptian Text appears to apply some Egyptian Hieroglyph damage controls to the final internal sub-quadrat rather than to the completed outer quadrat in nested layouts.

This affects the sequence containing vertical joiners, eg (MdC):

`p*t:pt #24 #23`

## Input sequence

Codepoints:

U+132AA Q3
U+13431 EGYPTIAN HIEROGLYPH HORIZONTAL JOINER
U+133CF X1
U+13430 EGYPTIAN HIEROGLYPH VERTICAL JOINER
U+131EF N1
U+13450 EGYPTIAN HIEROGLYPH DAMAGED AT BOTTOM
U+1344C EGYPTIAN HIEROGLYPH DAMAGED AT BOTTOM START AND TOP END

## Observed behavior

The damage controls attach to the lower/internal row/sub-container. In shaping diagnostics, the damage glyphs are selected for the `_62` context, for example:

dq24_62
dq23_62

Visually, the damage is applied only to the lower portion/sub-quadrat rather than the full outer quadrat.

## Expected behavior

The full nested group `p*t:pt` should be treated as one completed quadrat, and the damage controls should apply to the corresponding region of the outer quadrat.

In other words, the damage overlay should target the whole quadrat, not only the final internal sub-container.

## Reproduction

1. Render the sequence:

U+132AA, U+13431, U+133CF, U+13430, U+131EF, U+13450, U+1344C

2. Use Egyptian Text / EOT-compatible shaping.
3. Compare the visual result to the intended interpretation: damage on the outer quadrat.

## Confirmed in

This behavior was observed in:
- Egyptian Text 2.003
- Egyptian Text 3.001
- A downstream color-font proof-of-concept that inherits EOT shaping behavior

The downstream color font reproduces the behavior because it is following the EOT shaping output; it is not a COLR/color-layer issue.

## Why this matters

The damage controls are intended to describe damaged regions of a sign group. In nested quadrats, applying the damage only to the final internal row/sub-container produces a misleading visual result.

## Possible cause

The shaping logic appears to retain the final/current row context when applying the damage control, instead of resolving the damage control against the completed outer quadrat.

## Partial Workaround

A rough workaround is to distribute damage controls manually to internal components, for example by applying damage marks inside the group rather than after the full group. However, this is not equivalent to true outer-quadrat damage placement, as the space between stacked glyphs is not marked as damaged.

## Notes

This is separate from glyph-artwork issues such #64 (red/slashed glyph artifacts) or #65 (G43A impossible to render).
It is a shaping/layout issue involving Egyptian Hieroglyph Format Controls.

## Attached:

[ET3_vs_PoC5_damages.pdf](https://github.com/user-attachments/files/27775383/ET3_vs_PoC5_damages.pdf)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the U+132AA, U+13431, U+133CF, U+13430, U+131EF, U+13450, U+1344C sequence with Egyptian Text or an EOT-compatible shaper and inspect the shaping diagnostics for the dq24_62 and dq23_62 contexts. Trace how nested quadrats and Egyptian Hieroglyph Format Controls resolve their row context; done means damage targets the completed outer quadrat rather than only the final internal sub-container.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.