Python matplotlib.dviread.find_tex_file() Examples

The following are 16 code examples of matplotlib.dviread.find_tex_file(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module matplotlib.dviread , or try the search function .
Example #1
Source File: textpath.py    From Computable with MIT License 5 votes vote down vote up
def _get_adobe_standard_encoding(self):
        enc_name = dviread.find_tex_file('8a.enc')
        enc = dviread.Encoding(enc_name)
        return dict([(c, i) for i, c in enumerate(enc.encoding)]) 
Example #2
Source File: textpath.py    From matplotlib-4-abaqus with MIT License 5 votes vote down vote up
def _get_adobe_standard_encoding(self):
        enc_name = dviread.find_tex_file('8a.enc')
        enc = dviread.Encoding(enc_name)
        return dict([(c, i) for i, c in enumerate(enc.encoding)]) 
Example #3
Source File: test_dviread.py    From neural-network-animation with MIT License 5 votes vote down vote up
def setup():
    dr.find_tex_file = lambda x: x 
Example #4
Source File: test_dviread.py    From neural-network-animation with MIT License 5 votes vote down vote up
def teardown():
    dr.find_tex_file = original_find_tex_file 
Example #5
Source File: textpath.py    From neural-network-animation with MIT License 5 votes vote down vote up
def _get_adobe_standard_encoding(self):
        enc_name = dviread.find_tex_file('8a.enc')
        enc = dviread.Encoding(enc_name)
        return dict([(c, i) for i, c in enumerate(enc.encoding)]) 
Example #6
Source File: textpath.py    From GraphicDesignPatternByPython with MIT License 5 votes vote down vote up
def _get_adobe_standard_encoding():
    enc_name = dviread.find_tex_file('8a.enc')
    enc = dviread.Encoding(enc_name)
    return {c: i for i, c in enumerate(enc.encoding)} 
Example #7
Source File: textpath.py    From GraphicDesignPatternByPython with MIT License 5 votes vote down vote up
def tex_font_map(self):
        return dviread.PsfontsMap(dviread.find_tex_file('pdftex.map')) 
Example #8
Source File: textpath.py    From GraphicDesignPatternByPython with MIT License 5 votes vote down vote up
def _get_ps_font_and_encoding(texname):
        tex_font_map = dviread.PsfontsMap(dviread.find_tex_file('pdftex.map'))
        font_bunch = tex_font_map[texname]
        if font_bunch.filename is None:
            raise ValueError(
                ("No usable font file found for %s (%s). "
                    "The font may lack a Type-1 version.")
                % (font_bunch.psname, texname))

        font = get_font(font_bunch.filename)

        for charmap_name, charmap_code in [("ADOBE_CUSTOM", 1094992451),
                                           ("ADOBE_STANDARD", 1094995778)]:
            try:
                font.select_charmap(charmap_code)
            except (ValueError, RuntimeError):
                pass
            else:
                break
        else:
            charmap_name = ""
            warnings.warn("No supported encoding in font (%s)." %
                          font_bunch.filename)

        if charmap_name == "ADOBE_STANDARD" and font_bunch.encoding:
            enc0 = dviread.Encoding(font_bunch.encoding)
            enc = {i: _get_adobe_standard_encoding().get(c, None)
                   for i, c in enumerate(enc0.encoding)}
        else:
            enc = {}

        return font, enc 
Example #9
Source File: textpath.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def _get_adobe_standard_encoding():
    enc_name = dviread.find_tex_file('8a.enc')
    enc = dviread.Encoding(enc_name)
    return {c: i for i, c in enumerate(enc.encoding)} 
Example #10
Source File: textpath.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def tex_font_map(self):
        return dviread.PsfontsMap(dviread.find_tex_file('pdftex.map')) 
Example #11
Source File: textpath.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def _get_ps_font_and_encoding(texname):
        tex_font_map = dviread.PsfontsMap(dviread.find_tex_file('pdftex.map'))
        font_bunch = tex_font_map[texname]
        if font_bunch.filename is None:
            raise ValueError(
                ("No usable font file found for %s (%s). "
                    "The font may lack a Type-1 version.")
                % (font_bunch.psname, texname))

        font = get_font(font_bunch.filename)

        for charmap_name, charmap_code in [("ADOBE_CUSTOM", 1094992451),
                                           ("ADOBE_STANDARD", 1094995778)]:
            try:
                font.select_charmap(charmap_code)
            except (ValueError, RuntimeError):
                pass
            else:
                break
        else:
            charmap_name = ""
            warnings.warn("No supported encoding in font (%s)." %
                          font_bunch.filename)

        if charmap_name == "ADOBE_STANDARD" and font_bunch.encoding:
            enc0 = dviread.Encoding(font_bunch.encoding)
            enc = {i: _get_adobe_standard_encoding().get(c, None)
                   for i, c in enumerate(enc0.encoding)}
        else:
            enc = {}

        return font, enc 
Example #12
Source File: textpath.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def _get_adobe_standard_encoding():
    enc_name = dviread.find_tex_file('8a.enc')
    enc = dviread.Encoding(enc_name)
    return {c: i for i, c in enumerate(enc.encoding)} 
Example #13
Source File: textpath.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def tex_font_map(self):
        return dviread.PsfontsMap(dviread.find_tex_file('pdftex.map')) 
Example #14
Source File: textpath.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def _get_ps_font_and_encoding(texname):
        tex_font_map = dviread.PsfontsMap(dviread.find_tex_file('pdftex.map'))
        font_bunch = tex_font_map[texname]
        if font_bunch.filename is None:
            raise ValueError(
                ("No usable font file found for %s (%s). "
                    "The font may lack a Type-1 version.")
                % (font_bunch.psname, texname))

        font = get_font(font_bunch.filename)

        for charmap_name, charmap_code in [("ADOBE_CUSTOM", 1094992451),
                                           ("ADOBE_STANDARD", 1094995778)]:
            try:
                font.select_charmap(charmap_code)
            except (ValueError, RuntimeError):
                pass
            else:
                break
        else:
            charmap_name = ""
            warnings.warn("No supported encoding in font (%s)." %
                          font_bunch.filename)

        if charmap_name == "ADOBE_STANDARD" and font_bunch.encoding:
            enc0 = dviread.Encoding(font_bunch.encoding)
            enc = {i: _get_adobe_standard_encoding().get(c, None)
                   for i, c in enumerate(enc0.encoding)}
        else:
            enc = {}

        return font, enc 
Example #15
Source File: backend_pdf.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def texFontMap(self):
        # lazy-load texFontMap, it takes a while to parse
        # and usetex is a relatively rare use case
        if self._texFontMap is None:
            self._texFontMap = dviread.PsfontsMap(
                dviread.find_tex_file('pdftex.map'))

        return self._texFontMap 
Example #16
Source File: textpath.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def _get_adobe_standard_encoding(self):
        enc_name = dviread.find_tex_file('8a.enc')
        enc = dviread.Encoding(enc_name)
        return {c: i for i, c in enumerate(enc.encoding)}