You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# [201_104] Fix inner product symbol not rendering in Tab cycling popup
2
+
3
+
### What
4
+
Fixed `⟨⟩` (angle bracket pair) showing as a red broken symbol in the Tab cycling completion popup when typing `<` in math mode.
5
+
6
+
### Why
7
+
The Tab cycling popup renders symbol labels using `math_font_rep`. Its `get_extents`, `get_xpositions`, and `draw_fixed` methods all passed the full string to `search_font`, which only handles single math symbols. For a bracket pair like `"<langle><rangle>"` (two concatenated TeXmacs symbols), `search_font` fails — it is not a single dictionary entry and the character fallback rejects `<` — so it returns `error_font`, which draws in red.
8
+
9
+
### How
10
+
Modified `src/Graphics/Fonts/math_font.cpp`.
11
+
12
+
Added a single-char fast path (via `tm_char_forwards`) to `get_extents`, `get_xpositions`, and both `draw_fixed` overloads. Single characters use the original `search_font` lookup unchanged. Multi-character strings iterate character by character:
13
+
14
+
-`get_extents`: accumulates per-symbol metrics, combining advance widths and taking the union of ink bounds.
15
+
-`get_xpositions`: fills the position array by accumulating advance widths per symbol.
16
+
-`draw_fixed(x, y)`: draws each symbol at its accumulated x-offset.
17
+
-`draw_fixed(x, y, xk)`: delegates to `font_rep::draw_fixed` (base class already iterates char-by-char).
18
+
19
+
No Scheme-level changes needed — `lambda-to-symbol` in `math-edit.scm` already returns `(string-append lb rb)`.
20
+
21
+
### How to test
22
+
1. Open Mogan Editor and create a new document.
23
+
2. Enter math mode (`$` or via Insert → Math).
24
+
3. Type `<` and press `Tab` to open the cycling popup.
25
+
4.**Verify**: The `⟨⟩` entry displays correctly (not in red).
26
+
5. Press `Tab` to cycle through variants and select `⟨⟩`.
27
+
6.**Verify**: The correct angle bracket pair is inserted in the document.
0 commit comments