Commit c9d0af9
committed
Keep enclosed subscripts on their text line
A smaller glyph whose baseline is shifted off the line, such as the "2" in
"CO2", overlaps the line too little to clear the line-overlap threshold and
ended up on a line of its own. When such an element partially overlaps the
line and sits horizontally within the run already collected, it is enclosed
by surrounding text and belongs to that line. A smaller element that merely
sits close but is not enclosed, like a subtitle beside a heading, keeps its
own line.1 parent 69f18a9 commit c9d0af9
5 files changed
Lines changed: 51 additions & 17 deletions
File tree
- src/Document/ContentStream/PositionedText/LineGroupingStrategy
- tests
- Samples/files
- issue-127
- issue-215
- issue-254
- Unit/Document/ContentStream/PositionedText/LineGroupingStrategy
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
66 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
67 | 80 | | |
68 | 81 | | |
| 82 | + | |
| 83 | + | |
69 | 84 | | |
70 | 85 | | |
71 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
483 | | - | |
| 482 | + | |
484 | 483 | | |
485 | 484 | | |
486 | 485 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
257 | | - | |
| 256 | + | |
258 | 257 | | |
259 | 258 | | |
260 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2584 | 2584 | | |
2585 | 2585 | | |
2586 | 2586 | | |
2587 | | - | |
2588 | | - | |
| 2587 | + | |
2589 | 2588 | | |
2590 | 2589 | | |
2591 | 2590 | | |
2592 | 2591 | | |
2593 | 2592 | | |
2594 | 2593 | | |
2595 | | - | |
2596 | | - | |
| 2594 | + | |
2597 | 2595 | | |
2598 | 2596 | | |
2599 | 2597 | | |
| |||
2607 | 2605 | | |
2608 | 2606 | | |
2609 | 2607 | | |
2610 | | - | |
2611 | | - | |
| 2608 | + | |
2612 | 2609 | | |
2613 | 2610 | | |
2614 | 2611 | | |
| |||
3132 | 3129 | | |
3133 | 3130 | | |
3134 | 3131 | | |
3135 | | - | |
3136 | | - | |
3137 | | - | |
3138 | | - | |
| 3132 | + | |
| 3133 | + | |
3139 | 3134 | | |
3140 | | - | |
3141 | | - | |
| 3135 | + | |
3142 | 3136 | | |
3143 | 3137 | | |
3144 | 3138 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
37 | 64 | | |
0 commit comments