Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1b243ed
Merge pull request #5215 from tacaswell/tst_drop_old_pythons
jenshnielsen Oct 28, 2015
cdea77c
Merge pull request #5295 from mdboom/too-many-open-files
tacaswell Oct 29, 2015
60b60fb
Merge pull request #5301 from zblz/fix-dot-space
mdboom Oct 29, 2015
5fc3ce5
Merge branch 'v1.5.x' into v2.0.x
mdboom Oct 30, 2015
454c330
Merge pull request #5299 from mdboom/faster-character-mapping
tacaswell Oct 30, 2015
9d61a67
Merge branch 'v1.5.x' into v2.0.x
mdboom Nov 2, 2015
c5ce72a
Merge remote-tracking branch 'upstream/v1.5.x' into v2.0.x
mdboom Nov 4, 2015
19de414
Merge remote-tracking branch 'matplotlib/v1.5.x' into v2.0.x
tacaswell Nov 5, 2015
1866a8c
Merge pull request #5373 from jenshnielsen/python26removal
tacaswell Nov 5, 2015
a340827
Merge pull request #5361 from mdboom/fast-text
tacaswell Nov 5, 2015
c9fbfab
Merge pull request #5410 from mdboom/get-charmap-removal
tacaswell Nov 5, 2015
c22614e
Merge pull request #5412 from tacaswell/cp_font_cmap
WeatherGod Nov 5, 2015
d730481
Merge pull request #5306 from mdboom/local-freetype
jenshnielsen Nov 5, 2015
bf51375
Merge branch 'v1.5.x' into v2.0.x
mdboom Nov 5, 2015
4a2a186
Merge pull request #5214 from zblz/dejavu-mathtext
mdboom Nov 6, 2015
5129136
Merge pull request #5432 from mdboom/fix-segfault-in-text-drawing
jenshnielsen Nov 8, 2015
696ff9f
Merge pull request #5436 from jenshnielsen/backport5432
jenshnielsen Nov 8, 2015
b720325
Merge pull request #5439 from mdboom/default-font-fix
jenshnielsen Nov 8, 2015
2623b24
Merge pull request #5443 from jenshnielsen/backport5439
jenshnielsen Nov 8, 2015
d561d2e
Merge branch 'v1.5.x' into v2.0.x
mdboom Nov 9, 2015
a158bf6
Add tick rcparms (top/bottom and left/right) to control where the tic…
Tillsten Sep 29, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/misc/ftface_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,4 @@

print(dir(font))

cmap = font.get_charmap()
print(font.get_kerning)
2 changes: 0 additions & 2 deletions lib/matplotlib/_mathtext_data.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
font data tables for truetype and afm computer modern fonts
"""
# this dict maps symbol names to fontnames, glyphindex. To get the
# glyph index from the character code, you have to use get_charmap
from __future__ import (absolute_import, division, print_function,
unicode_literals)

Expand Down
9 changes: 3 additions & 6 deletions lib/matplotlib/backends/backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,13 +883,12 @@ def get_char_width(charcode):
# Make the "Differences" array, sort the ccodes < 255 from
# the multi-byte ccodes, and build the whole set of glyph ids
# that we need from this font.
cmap = font.get_charmap()
glyph_ids = []
differences = []
multi_byte_chars = set()
for c in characters:
ccode = c
gind = cmap.get(ccode) or 0
gind = font.get_char_index(ccode)
glyph_ids.append(gind)
glyph_name = font.get_glyph_name(gind)
if ccode <= 255:
Expand Down Expand Up @@ -999,12 +998,11 @@ def embedTTFType42(font, characters, descriptor):
# Make the 'W' (Widths) array, CidToGidMap and ToUnicode CMap
# at the same time
cid_to_gid_map = ['\u0000'] * 65536
cmap = font.get_charmap()
widths = []
max_ccode = 0
for c in characters:
ccode = c
gind = cmap.get(ccode) or 0
gind = font.get_char_index(ccode)
glyph = font.load_char(ccode, flags=LOAD_NO_HINTING)
widths.append((ccode, glyph.horiAdvance / 6))
if ccode < 65536:
Expand Down Expand Up @@ -2011,7 +2009,6 @@ def draw_text_woven(chunks):
between chunks of 1-byte characters and 2-byte characters.
Only used for Type 3 fonts."""
chunks = [(a, ''.join(b)) for a, b in chunks]
cmap = font.get_charmap()

# Do the rotation and global translation as a single matrix
# concatenation up front
Expand Down Expand Up @@ -2041,7 +2038,7 @@ def draw_text_woven(chunks):
lastgind = None
for c in chunk:
ccode = ord(c)
gind = cmap.get(ccode)
gind = font.get_char_index(ccode)
if gind is not None:
if mode == 2 and chunk_type == 2:
glyph_name = font.get_glyph_name(gind)
Expand Down
6 changes: 2 additions & 4 deletions lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,15 +762,14 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
ps_name = ps_name.encode('ascii', 'replace').decode('ascii')
self.set_font(ps_name, prop.get_size_in_points())

cmap = font.get_charmap()
lastgind = None
#print 'text', s
lines = []
thisx = 0
thisy = 0
for c in s:
ccode = ord(c)
gind = cmap.get(ccode)
gind = font.get_char_index(ccode)
if gind is None:
ccode = ord('?')
name = '.notdef'
Expand Down Expand Up @@ -1138,10 +1137,9 @@ def print_figure_impl():
for font_filename, chars in six.itervalues(ps_renderer.used_characters):
if len(chars):
font = get_font(font_filename)
cmap = font.get_charmap()
glyph_ids = []
for c in chars:
gind = cmap.get(c) or 0
gind = font.get_char_index(c)
glyph_ids.append(gind)

fonttype = rcParams['ps.fonttype']
Expand Down
8 changes: 7 additions & 1 deletion lib/matplotlib/tests/test_font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import os

from matplotlib.font_manager import findfont, FontProperties
from matplotlib.font_manager import (findfont, FontProperties, get_font)
from matplotlib import rc_context


Expand All @@ -17,3 +17,9 @@ def test_font_priority():
font = findfont(
FontProperties(family=["sans-serif"]))
assert_equal(os.path.basename(font), 'cmmi10.ttf')

# Smoketest get_charmap, which isn't used internally anymore
font = get_font(font)
cmap = font.get_charmap()
assert len(cmap) == 131
assert cmap[8729] == 30
3 changes: 1 addition & 2 deletions lib/matplotlib/textpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ def get_glyphs_with_font(self, font, s, glyph_map=None,

# Mostly copied from backend_svg.py.

cmap = font.get_charmap()
lastgind = None

currx = 0
Expand All @@ -192,7 +191,7 @@ def get_glyphs_with_font(self, font, s, glyph_map=None,

for c in s:
ccode = ord(c)
gind = cmap.get(ccode)
gind = font.get_char_index(ccode)
if gind is None:
ccode = ord('?')
gind = 0
Expand Down