|
20 | 20 | import matplotlib as mpl
|
21 | 21 | from . import cbook
|
22 | 22 | from ._mathtext_data import (
|
23 |
| - latex_to_bakoma, latex_to_cmex, latex_to_standard, stix_virtual_fonts, |
24 |
| - tex2uni) |
| 23 | + latex_to_bakoma, latex_to_standard, stix_virtual_fonts, tex2uni) |
25 | 24 | from .afm import AFM
|
26 | 25 | from .font_manager import FontProperties, findfont, get_font
|
27 | 26 | from .ft2font import KERNING_DEFAULT
|
@@ -452,7 +451,7 @@ class UnicodeFonts(TruetypeFonts):
|
452 | 451 | This class will "fallback" on the Bakoma fonts when a required
|
453 | 452 | symbol can not be found in the font.
|
454 | 453 | """
|
455 |
| - use_cmex = True |
| 454 | + use_cmex = True # Unused; delete once mathtext becomes private. |
456 | 455 |
|
457 | 456 | def __init__(self, *args, **kwargs):
|
458 | 457 | # This must come first so the backend's owner is set correctly
|
@@ -497,22 +496,13 @@ def _map_virtual_font(self, fontname, font_class, uniindex):
|
497 | 496 | return fontname, uniindex
|
498 | 497 |
|
499 | 498 | def _get_glyph(self, fontname, font_class, sym, fontsize, math=True):
|
500 |
| - found_symbol = False |
501 |
| - |
502 |
| - if self.use_cmex: |
503 |
| - uniindex = latex_to_cmex.get(sym) |
504 |
| - if uniindex is not None: |
505 |
| - fontname = 'ex' |
506 |
| - found_symbol = True |
507 |
| - |
508 |
| - if not found_symbol: |
509 |
| - try: |
510 |
| - uniindex = get_unicode_index(sym, math) |
511 |
| - found_symbol = True |
512 |
| - except ValueError: |
513 |
| - uniindex = ord('?') |
514 |
| - _log.warning( |
515 |
| - "No TeX to unicode mapping for {!a}.".format(sym)) |
| 499 | + try: |
| 500 | + uniindex = get_unicode_index(sym, math) |
| 501 | + found_symbol = True |
| 502 | + except ValueError: |
| 503 | + uniindex = ord('?') |
| 504 | + found_symbol = False |
| 505 | + _log.warning("No TeX to unicode mapping for {!a}.".format(sym)) |
516 | 506 |
|
517 | 507 | fontname, uniindex = self._map_virtual_font(
|
518 | 508 | fontname, font_class, uniindex)
|
@@ -574,7 +564,7 @@ def get_sized_alternatives_for_symbol(self, fontname, sym):
|
574 | 564 |
|
575 | 565 |
|
576 | 566 | class DejaVuFonts(UnicodeFonts):
|
577 |
| - use_cmex = False |
| 567 | + use_cmex = False # Unused; delete once mathtext becomes private. |
578 | 568 |
|
579 | 569 | def __init__(self, *args, **kwargs):
|
580 | 570 | # This must come first so the backend's owner is set correctly
|
@@ -677,7 +667,7 @@ class StixFonts(UnicodeFonts):
|
677 | 667 | 4: 'STIXSizeFourSym',
|
678 | 668 | 5: 'STIXSizeFiveSym',
|
679 | 669 | }
|
680 |
| - use_cmex = False |
| 670 | + use_cmex = False # Unused; delete once mathtext becomes private. |
681 | 671 | cm_fallback = False
|
682 | 672 | _sans = False
|
683 | 673 |
|
|
0 commit comments