8000 Third party docs fixes/updates by jbednar · Pull Request #6088 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Third party docs fixes/updates #6088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 39 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
07d54b9
Fixed path to thirdpartypackages from main docs page, and added links…
jbednar Mar 1, 2016
663ea0c
Reorganized thirdpartypackages web page and added images and links
jbednar Mar 1, 2016
7a92005
Fixed trailing whitespace
jbednar Mar 1, 2016
a1e3daa
Removed outdated version reference in docs
jbednar Mar 2, 2016
efff4d0
bug fix related #5479
ryanbelt Feb 22, 2016
ce66585
raising error,rather then check type
ryanbelt Feb 23, 2016
f6bde3a
minor fix on indentation
ryanbelt Feb 23, 2016
08147b3
fix indention to 4 space, but not tap
ryanbelt Feb 23, 2016
f871bc8
Correct link to favicon by using build in sphix support
jenshnielsen Feb 22, 2016
360d891
added test for bug#5479 auto column
ryanbelt Feb 26, 2016
76e292c
pep8 new line at last
ryanbelt Feb 26, 2016
7cf7792
fix pep8 miss space after comma
ryanbelt Feb 26, 2016
64a6f5f
pep8 line gt 80 fix
ryanbelt Feb 26, 2016
b2f3621
comment fix, rerun online testing
ryanbelt Feb 26, 2016
7b0aa47
non integer interable test case
ryanbelt Feb 28, 2016
8201b55
fixed bug 6028
crazyo Feb 29, 2016
a0f5c3a
fixed a bug in previous PR
crazyo Feb 29, 2016
b204995
made change to PR according to comments
crazyo Feb 29, 2016
81b7537
Fixed issue 4346
paulkirow Feb 29, 2016
9a5c275
Created test for previous issue
paulkirow Mar 1, 2016
f719105
Removed redundancies in test
paulkirow Mar 1, 2016
5062ecb
changed non_math to math according to comments on bug 6028
crazyo Mar 1, 2016
8a3b1c0
MNT: Bring back the module level 'backend'
ericdill Mar 2, 2016
dc9384c
MNT: Set the module level `backend` in pylab_setup
ericdill Mar 2, 2016
f9a1540
MNT: Set the module backend param at the end
ericdill Mar 2, 2016
d83f61d
PEP8: Shorten lines that are too long
ericdill Mar 2, 2016
3b75b74
Update INSTALL
scott-vsi Mar 2, 2016
d26e1dc
Fix #6069. Handle image masks correctly
mdboom Mar 2, 2016
6577dc3
Update INSTALL
scott-vsi Mar 2, 2016
a7359f9
Update installing_faq.rst
scott-vsi Mar 2, 2016
7ee82d6
Fix image_masked.py example
mdboom Mar 2, 2016
7af951d
CI: try explicitly including msvc_runtime
tacaswell Mar 6, 2016
a49a68e
CI: add msvc_runtime to conda recipe
tacaswell Mar 6, 2016
871be40
CI: install libpng in windows
tacaswell Mar 6, 2016
3abe936
added comment on "usetex=False" to ainde debugging when latex not ava…
dacoex Mar 4, 2016
270092a
BUG Raise exception for invalid input
luispedro Oct 6, 2013
0afc45e
Fixes matplotlib/matplotlib#1235
dashed Mar 2, 2016
39d3630
MNT: improve image array argument checking in to_rgba. Closes #2499.
efiring Mar 7, 2016
cd89bcb
Fix about dialog on Qt 5
estan Mar 7, 2016
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
8000
Diff view
Prev Previous commit
Next Next commit
fixed bug 6028
  • Loading branch information
crazyo authored and jbednar committed Mar 8, 2016
commit 8201b55d84af3ef4e8d29e4d87a73e72c137c19f
41 changes: 23 additions & 18 deletions lib/matplotlib/mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,21 @@
##############################################################################
# FONTS

def get_unicode_index(symbol):
"""get_unicode_index(symbol) -> integer
def get_unicode_index(symbol, nonMath=False):
"""get_unicode_index(symbol, [bool]) -> integer

Return the integer index (from the Unicode table) of symbol. *symbol*
can be a single unicode character, a TeX command (i.e. r'\pi'), or a
Type1 symbol name (i.e. 'phi').
If nonMath is True, the current symbol should be treated as a non-math symbol.
"""
# From UTF #25: U+2212 minus sign is the preferred
# representation of the unary and binary minus sign rather than
# the ASCII-derived U+002D hyphen-minus, because minus sign is
# unambiguous and because it is rendered with a more desirable
# length, usually longer than a hyphen.
if symbol == '-':
# Hyphens in texts will not be affected.
if not nonMath and symbol == '-':
return 0x2212
try:# This will succeed if symbol is a single unicode char
return ord(symbol)
Expand Down Expand Up @@ -438,7 +440,7 @@ def get_kern(self, font1, fontclass1, sym1, fontsize1,
"""
return 0.

def get_metrics(self, font, font_class, sym, fontsize, dpi):
def get_metrics(self, font, font_class, sym, fontsize, dpi, nonMath=False):
"""
*font*: one of the TeX font names::

Expand All @@ -452,6 +454,8 @@ def get_metrics(self, font, font_class, sym, fontsize, dpi):

*dpi*: current dots-per-inch

*nonMath*: whether sym is a nonMath character

Returns an object with the following attributes:

- *advance*: The advance distance (in points) of the glyph.
Expand All @@ -466,7 +470,7 @@ def get_metrics(self, font, font_class, sym, fontsize, dpi):
the glyph. This corresponds to TeX's definition of
"height".
"""
info = self._get_info(font, font_class, sym, fontsize, dpi)
info = self._get_info(font, font_class, sym, fontsize, dpi, nonMath)
return info.metrics

def set_canvas_size(self, w, h, d):
Expand Down Expand Up @@ -582,14 +586,14 @@ def _get_offset(self, font, glyph, fontsize, dpi):
return ((glyph.height/64.0/2.0) + (fontsize/3.0 * dpi/72.0))
return 0.

def _get_info(self, fontname, font_class, sym, fontsize, dpi):
def _get_info(self, fontname, font_class, sym, fontsize, dpi, nonMath=False):
key = fontname, font_class, sym, fontsize, dpi
bunch = self.glyphd.get(key)
if bunch is not None:
return bunch

font, num, symbol_name, fontsize, slanted = \
self._get_glyph(fontname, font_class, sym, fontsize)
self._get_glyph(fontname, font_class, sym, fontsize, nonMath)

font.set_size(fontsize, dpi)
glyph = font.load_char(
Expand Down Expand Up @@ -679,7 +683,7 @@ def __init__(self, *args, **kwargs):

_slanted_symbols = set(r"\int \oint".split())

def _get_glyph(self, fontname, font_class, sym, fontsize):
def _get_glyph(self, fontname, font_class, sym, fontsize, nonMath=False):
symbol_name = None
font = None
if fontname in self.fontmap and sym in latex_to_bakoma:
Expand All @@ -699,7 +703,7 @@ def _get_glyph(self, fontname, font_class, sym, fontsize):

if symbol_name is None:
return self._stix_fallback._get_glyph(
fontname, font_class, sym, fontsize)
fontname, font_class, sym, fontsize, nonMath)

return font, num, symbol_name, fontsize, slanted

Expand Down Expand Up @@ -796,7 +800,7 @@ def __init__(self, *args, **kwargs):
def _map_virtual_font(self, fontname, font_class, uniindex):
return fontname, uniindex

def _get_glyph(self, fontname, font_class, sym, fontsize):
def _get_glyph(self, fontname, font_class, sym, fontsize, nonMath=False):
found_symbol = False

if self.use_cmex:
Expand All @@ -807,7 +811,7 @@ def _get_glyph(self, fontname, font_class, sym, fontsize):

if not found_symbol:
try:
uniindex = get_unicode_index(sym)
uniindex = get_unicode_index(sym, nonMath)
found_symbol = True
except ValueError:
uniindex = ord('?')
Expand Down Expand Up @@ -900,11 +904,11 @@ def __init__(self, *args, **kwargs):
self.fontmap[key] = fullpath
self.fontmap[name] = fullpath

def _get_glyph(self, fontname, font_class, sym, fontsize):
def _get_glyph(self, fontname, font_class, sym, fontsize, nonMath=False):
""" Override prime symbol to use Bakoma """
if sym == r'\prime':
return self.bakoma._get_glyph(fontname,
font_class, sym, fontsize)
font_class, sym, fontsize, nonMath)
else:
# check whether the glyph is available in the display font
uniindex = get_unicode_index(sym)
Expand All @@ -913,10 +917,10 @@ def _get_glyph(self, fontname, font_class, sym, fontsize):
glyphindex = font.get_char_index(uniindex)
if glyphindex != 0:
return super(DejaVuFonts, self)._get_glyph('ex',
font_class, sym, fontsize)
font_class, sym, fontsize, nonMath)
# otherwise return regular glyph
return super(DejaVuFonts, self)._get_glyph(fontname,
font_class, sym, fontsize)
font_class, sym, fontsize, nonMath)


class DejaVuSerifFonts(DejaVuFonts):
Expand Down Expand Up @@ -1450,14 +1454,15 @@ class Char(Node):
from width) must be converted into a :class:`Kern` node when the
:class:`Char` is added to its parent :class:`Hlist`.
"""
def __init__(self, c, state):
def __init__(self, c, state, nonMath=False):
Node.__init__(self)
self.c = c
self.font_output = state.font_output
self.font = state.font
self.font_class = state.font_class
self.fontsize = state.fontsize
self.dpi = state.dpi
self.nonMath = nonMath
# The real width, height and depth will be set during the
# pack phase, after we know the real fontsize
self._update_metrics()
Expand All @@ -1467,7 +1472,7 @@ def __internal_repr__(self):

def _update_metrics(self):
metrics = self._metrics = self.font_output.get_metrics(
self.font, self.font_class, self.c, self.fontsize, self.dpi)
self.font, self.font_class, self.c, self.fontsize, self.dpi, self.nonMath)
if self.c == ' ':
self.width = metrics.advance
else:
Expand Down Expand Up @@ -2589,7 +2594,7 @@ def math(self, s, loc, toks):
def non_math(self, s, loc, toks):
#~ print "non_math", toks
s = toks[0].replace(r'\$', '$')
symbols = [Char(c, self.get_state()) for c in s]
symbols = [Char(c, self.get_state(), nonMath=True) for c in s]
hlist = Hlist(symbols)
# We're going into math now, so set font to 'it'
self.push_state()
Expand Down
0