Commit d31d674
committed
Fix loading of Type1 "native" charmap.
Type1 fonts have a "native" charmap (mapping of indices to glyphs
(\*)), which is simply the order in which glyphs are physically listed
in the file (see section 2.2 of Type1 reference linked below); this
charmap needed when decoding dvi files for usetex mode (as dvi represent
glyphs with these indices). Usually, this charmap is tagged as
"ADOBE_STANDARD" or "ADOBE_CUSTOM", which is the heuristic we previously
used to load it, but it is unclear to me whether this is guaranteed
(reference section 10.3), and FreeType may supply its own reencodings
(it already does so to try to provide a unicode charmap). Instead,
directly read and return the encoding vector via FreeType's
Type1-specific API. (The choice to return an mapping of Type1 indices
to FreeType-internal indices, rather than Type1 indices to glyph names,
is motivated by upcoming changes for {xe,lua}tex support, which also use
FreeType-internal indices.)
Type1 reference:
https://adobe-type-tools.github.io/font-tech-notes/pdfs/T1_SPEC.pdf
(\*) Not all glyphs correspond to a unicode codepoint (e.g. a font can
contain arbitrary ligatures that are not representable in unicode),
which is (one of the reasons) why fonts provide their own indexing
methods.1 parent 349aa96 commit d31d674
File tree
3 files changed
+45
-35
lines changed- lib/matplotlib
- src
3 files changed
+45
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1132 | 1132 | | |
1133 | 1133 | | |
1134 | 1134 | | |
1135 | | - | |
1136 | 1135 | | |
1137 | 1136 | | |
1138 | 1137 | | |
| |||
1155 | 1154 | | |
1156 | 1155 | | |
1157 | 1156 | | |
1158 | | - | |
1159 | 1157 | | |
1160 | 1158 | | |
1161 | 1159 | | |
1162 | 1160 | | |
1163 | 1161 | | |
1164 | | - | |
1165 | | - | |
| 1162 | + | |
| 1163 | + | |
1166 | 1164 | | |
1167 | 1165 | | |
1168 | 1166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| |||
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
244 | | - | |
245 | 245 | | |
246 | | - | |
247 | | - | |
248 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
| |||
269 | 270 | | |
270 | 271 | | |
271 | 272 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | 273 | | |
290 | 274 | | |
291 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
501 | 511 | | |
502 | 512 | | |
503 | 513 | | |
| |||
1431 | 1441 | | |
1432 | 1442 | | |
1433 | 1443 | | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
1434 | 1470 | | |
1435 | 1471 | | |
1436 | 1472 | | |
| |||
1569 | 1605 | | |
1570 | 1606 | | |
1571 | 1607 | | |
1572 | | - | |
1573 | | - | |
1574 | | - | |
1575 | | - | |
1576 | | - | |
1577 | | - | |
1578 | | - | |
1579 | | - | |
1580 | | - | |
1581 | | - | |
1582 | 1608 | | |
1583 | 1609 | | |
1584 | 1610 | | |
| |||
1761 | 1787 | | |
1762 | 1788 | | |
1763 | 1789 | | |
| 1790 | + | |
| 1791 | + | |
1764 | 1792 | | |
1765 | 1793 | | |
1766 | 1794 | | |
| |||
0 commit comments