8000 finished unicode support for ps · matplotlib/matplotlib@9c19d00 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9c19d00

Browse files
committed
finished unicode support for ps
svn path=/trunk/matplotlib/; revision=1109
1 parent 61eda61 commit 9c19d00

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

CHANGELOG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
New entries should be added at the top
22

3-
2005-03-29 Added alpha unicode support for Agg and PS - JDH
3+
2005-03-29 Added unicode support for Agg and PS - JDH
44

55
2005-03-28 Added Jarrod's svg patch for text - JDH
66

lib/matplotlib/backends/backend_agg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def _get_agg_font(self, prop):
244244

245245
if font is None:
246246
fname = fontManager.findfont(prop)
247-
font = FT2Font(str(fname))
247+
font = FT2Font(fname)
248248
_fontd[key] = font
249249

250250
font.clear()

lib/matplotlib/backends/backend_ps.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def _get_font_ttf(self, prop):
196196
font = _fontd.get(key)
197197
if font is None:
198198
fname = fontManager.findfont(prop)
199-
font = FT2Font(str(fname))
199+
font = FT2Font(fname)
200200
_fontd[key] = font
201201
if fname not in _type42:
202202
_type42.append(fname)
@@ -591,7 +591,6 @@ def encodeTTFasPS(fontfile):
591591
"""
592592
Encode a TrueType font file for embedding in a PS file.
593593
"""
594-
fontfile = str(fontfile) # TODO: handle unicode filenames
595594
font = file(fontfile, 'rb')
596595
hexdata, data = [], font.read(65520)
597596
b2a_hex = binascii.b2a_hex
@@ -777,7 +776,6 @@ def print_figure(self, outfile, dpi=72,
777776
print >>fh, l.strip()
778777
if not rcParams['ps.useafm']:
779778
for font in type42:
780-
font = str(font) # TODO: handle unicode filenames
781779
print >>fh, "%%BeginFont: "+FT2Font(font).postscript_name
782780
print >>fh, encodeTTFasPS(font)
783781
print >>fh, "%%EndFont"

lib/matplotlib/font_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def createFontDict(fontfiles, fontext='ttf'):
460460
prop = afmFontProperty(font)
461461
else:
462462
try:
463-
font = ft2font.FT2Font(str(fpath))
463+
font = ft2font.FT2Font(fpath)
464464
except RuntimeError:
465465
warnings.warn("Could not open font file %s"%fpath)
466466
continue
@@ -636,7 +636,7 @@ def get_name(self):
636636
"""Return the name of the font that best matches the font
637637
properties.
638638
"""
639-
return ft2font.FT2Font(str(fontManager.findfont(self))).family_name
639+
return ft2font.FT2Font(fontManager.findfont(self)).family_name
640640

641641
def get_style(self):
642642
"""Return the font style. Values are: normal, italic or oblique.

0 commit comments

Comments
 (0)
0