Commit a7a29cd
Do not scale TJ array adjustments by the Type 3 FontMatrix
A number in a TJ array is expressed in thousandths of a unit of text
space (ISO 32000-1, 9.4.3). It is a text space quantity, not a glyph
space one, so it must not be transformed by the font's FontMatrix.
Since the FontMatrix scaling introduced in #733 is applied to the whole
text-showing argument, the TJ adjustments are scaled by FontMatrix[0] as
well. For every non-Type 3 font that factor is exactly 1/1000, so the
result is unchanged. For a Type 3 font whose FontMatrix is not the
conventional [0.001 0 0 0.001 0 0] the adjustments are off by the ratio
between the two: with an identity FontMatrix they are 1000 times too
large, which makes each glyph advance backwards and reverses the
extracted reading order.
Glyph widths keep using the FontMatrix, which is correct - those are
glyph space values.1 parent b1b438e commit a7a29cd
1 file changed
Lines changed: 8 additions & 1 deletion
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
69 | 76 | | |
70 | 77 | | |
71 | 78 | | |
| |||
842 | 849 | | |
843 | 850 | | |
844 | 851 | | |
845 | | - | |
| 852 | + | |
846 | 853 | | |
847 | 854 | | |
848 | 855 | | |
| |||
0 commit comments