SourceForge logo
SourceForge logo
Menu

matplotlib-checkins — Commit notification. DO NOT POST to this list, just subscribe to it.

You can subscribe to this list here.

2007 Jan
Feb
Mar
Apr
May
Jun
Jul
(115)
Aug
(120)
Sep
(137)
Oct
(170)
Nov
(461)
Dec
(263)
2008 Jan
(120)
Feb
(74)
Mar
(35)
Apr
(74)
May
(245)
Jun
(356)
Jul
(240)
Aug
(115)
Sep
(78)
Oct
(225)
Nov
(98)
Dec
(271)
2009 Jan
(132)
Feb
(84)
Mar
(74)
Apr
(56)
May
(90)
Jun
(79)
Jul
(83)
Aug
(296)
Sep
(214)
Oct
(76)
Nov
(82)
Dec
(66)
2010 Jan
(46)
Feb
(58)
Mar
(51)
Apr
(77)
May
(58)
Jun
(126)
Jul
(128)
Aug
(64)
Sep
(50)
Oct
(44)
Nov
(48)
Dec
(54)
2011 Jan
(68)
Feb
(52)
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
(1)
2018 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S



1
(16)
2
(7)
3
(4)
4
5
6
(4)
7
(5)
8
(6)
9
(7)
10
(4)
11
12
(2)
13
(5)
14
(3)
15
16
(5)
17
(1)
18
19
20
(5)
21
(7)
22
(3)
23
(5)
24
(1)
25
26
27
(6)
28
(7)
29
(3)
30
(8)
31
(6)

Showing 4 results of 4

From: <md...@us...> - 2007年08月03日 19:47:51
Revision: 3673
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3673&view=rev
Author: mdboom
Date: 2007年08月03日 12:47:49 -0700 (2007年8月03日)
Log Message:
-----------
Fix superscript offset bug (only offset when nucleus is slanted)
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/_mathtext_data.py
 trunk/matplotlib/lib/matplotlib/mathtext.py
Modified: trunk/matplotlib/lib/matplotlib/_mathtext_data.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/_mathtext_data.py	2007年08月03日 18:30:25 UTC (rev 3672)
+++ trunk/matplotlib/lib/matplotlib/_mathtext_data.py	2007年08月03日 19:47:49 UTC (rev 3673)
@@ -68,17 +68,6 @@
 r'\imath' : ('cmmi10', 8),
 r'\jmath' : ('cmmi10', 65),
 r'\wp' : ('cmmi10', 14),
- r'\Gamma' : ('cmmi10', 37),
- r'\Delta' : ('cmmi10', 11),
- r'\Theta' : ('cmmi10', 12),
- r'\Lambda' : ('cmmi10', 26),
- r'\Xi' : ('cmmi10', 4),
- r'\Pi' : ('cmmi10', 33),
- r'\Sigma' : ('cmmi10', 16),
- r'\Upsilon' : ('cmmi10', 19),
- r'\Phi' : ('cmmi10', 15),
- r'\Psi' : ('cmmi10', 27),
- r'\Omega' : ('cmmi10', 23),
 r'\alpha' : ('cmmi10', 13),
 r'\beta' : ('cmmi10', 35),
 r'\gamma' : ('cmmi10', 24),
@@ -128,6 +117,17 @@
 r'%' : ('cmr10', 48),
 r'\$' : ('cmr10', 99),
 r'@' : ('cmr10', 111),
+ r'\Gamma' : ('cmr10', 19),
+ r'\Delta' : ('cmr10', 6),
+ r'\Theta' : ('cmr10', 7),
+ r'\Lambda' : ('cmr10', 14),
+ r'\Xi' : ('cmr10', 3),
+ r'\Pi' : ('cmr10', 17),
+ r'\Sigma' : ('cmr10', 10),
+ r'\Upsilon' : ('cmr10', 11),
+ r'\Phi' : ('cmr10', 9),
+ r'\Psi' : ('cmr10', 15),
+ r'\Omega' : ('cmr10', 12),
 
 # these are mathml names, I think. I'm just using them for the
 # tex methods noted
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py	2007年08月03日 18:30:25 UTC (rev 3672)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py	2007年08月03日 19:47:49 UTC (rev 3673)
@@ -482,7 +482,7 @@
 if bunch is not None:
 return bunch
 
- cached_font, num, symbol_name, fontsize = \
+ cached_font, num, symbol_name, fontsize, slanted = \
 self._get_glyph(fontname, sym, fontsize)
 
 font = cached_font.font
@@ -500,7 +500,8 @@
 ymin = ymin+offset,
 ymax = ymax+offset,
 # iceberg is the equivalent of TeX's "height"
- iceberg = glyph.horiBearingY/64.0 + offset
+ iceberg = glyph.horiBearingY/64.0 + offset,
+ slanted = slanted
 )
 
 self.glyphd[key] = Bunch(
@@ -558,13 +559,17 @@
 return glyph.height/64.0/2.0 + 256.0/64.0 * dpi/72.0
 return 0.
 
+ _slanted_symbols = Set(r"\int \oint".split())
+ 
 def _get_glyph(self, fontname, sym, fontsize):
 if fontname in self.fontmap and latex_to_bakoma.has_key(sym):
 basename, num = latex_to_bakoma[sym]
+ slanted = basename == "cmmi10" or sym in self._slanted_symbols
 cached_font = self._get_font(basename)
 symbol_name = cached_font.font.get_glyph_name(num)
 num = cached_font.glyphmap[num]
 elif len(sym) == 1:
+ slanted = (fontname == "it")
 cached_font = self._get_font(fontname)
 num = ord(sym)
 symbol_name = cached_font.font.get_glyph_name(
@@ -572,7 +577,7 @@
 else:
 raise ValueError('unrecognized symbol "%s"' % sym)
 
- return cached_font, num, symbol_name, fontsize
+ return cached_font, num, symbol_name, fontsize, slanted
 
 # The Bakoma fonts contain many pre-sized alternatives for the
 # delimiters. The AutoSizedChar class will use these alternatives
@@ -666,6 +671,8 @@
 and not category(unichr(uniindex)).startswith("L")):
 fontname = 'rm'
 
+ slanted = (fontname == 'it')
+ 
 cached_font = self._get_font(fontname)
 if found_symbol:
 try:
@@ -681,7 +688,7 @@
 glyphindex = cached_font.charmap[uniindex]
 
 symbol_name = cached_font.font.get_glyph_name(glyphindex)
- return cached_font, uniindex, symbol_name, fontsize
+ return cached_font, uniindex, symbol_name, fontsize, slanted
 
 class StandardPsFonts(Fonts):
 """
@@ -759,6 +766,8 @@
 else:
 warn("No TeX to built-in Postscript mapping for '%s'" % sym,
 MathTextWarning)
+
+ slanted = (fontname == 'it')
 font = self._get_font(fontname) 
 
 if found_symbol:
@@ -772,7 +781,8 @@
 
 if not found_symbol:
 glyph = sym = '?'
- symbol_name = font.get_char_name(glyph)
+ num = ord(glyph)
+ symbol_name = font.get_name_char(glyph)
 
 offset = 0
 
@@ -789,7 +799,8 @@
 ymin = ymin+offset,
 ymax = ymax+offset,
 # iceberg is the equivalent of TeX's "height"
- iceberg = ymax + offset
+ iceberg = ymax + offset,
+ slanted = slanted
 )
 
 self.glyphd[key] = Bunch(
@@ -963,6 +974,9 @@
 self.width = metrics.width
 self.height = metrics.iceberg
 self.depth = -(metrics.iceberg - metrics.height)
+
+ def is_slanted(self):
+ return self._metrics.slanted
 
 def get_kerning(self, next):
 """Return the amount of kerning between this and the given
@@ -2019,6 +2033,11 @@
 if isinstance(nucleus, Char):
 return nucleus.c in self._dropsub_symbols
 return False
+
+ def is_slanted(self, nucleus):
+ if isinstance(nucleus, Char):
+ return nucleus.is_slanted()
+ return False
 
 def subsuperscript(self, s, loc, toks):
 assert(len(toks)==1)
@@ -2126,7 +2145,8 @@
 if clr > 0.:
 shift_up += clr
 shift_down += clr
- x.shift_amount = DELTA * (shift_up + shift_down)
+ if self.is_slanted(nucleus):
+ x.shift_amount = DELTA * (shift_up + shift_down)
 x = Vlist([x,
 Kern((shift_up - x.depth) - (y.height - shift_down)),
 y])
@@ -2296,11 +2316,7 @@
 font_output.mathtext_backend.fonts_object = None
 return self.cache[cacheKey]
 
-if rcParams["mathtext.mathtext2"]:
- from matplotlib.mathtext2 import math_parse_s_ft2font
- from matplotlib.mathtext2 import math_parse_s_ft2font_svg
-else:
- math_parse_s_ft2font = math_parse_s_ft2font_common('Agg')
- math_parse_s_ft2font_svg = math_parse_s_ft2font_common('SVG')
+math_parse_s_ft2font = math_parse_s_ft2font_common('Agg')
+math_parse_s_ft2font_svg = math_parse_s_ft2font_common('SVG')
 math_parse_s_ps = math_parse_s_ft2font_common('PS')
 math_parse_s_pdf = math_parse_s_ft2font_common('PDF')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3672
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3672&view=rev
Author: mdboom
Date: 2007年08月03日 11:30:25 -0700 (2007年8月03日)
Log Message:
-----------
Make LaTeX preview show things in displaymath mode, since that's what
we're trying to emulate.
Modified Paths:
--------------
 trunk/matplotlib/examples/mathtext_examples.py
Modified: trunk/matplotlib/examples/mathtext_examples.py
===================================================================
--- trunk/matplotlib/examples/mathtext_examples.py	2007年08月03日 17:58:07 UTC (rev 3671)
+++ trunk/matplotlib/examples/mathtext_examples.py	2007年08月03日 18:30:25 UTC (rev 3672)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-import os, sys
+import os, sys, re
 
 stests = [
 r'Kerning: AVA $AVA$',
@@ -66,6 +66,7 @@
 fd.write("\\begin{enumerate}\n")
 
 for i, s in enumerate(stests):
+ s = re.sub(r"(?<!\\)\$", "$$", s)
 fd.write("\\item %s\n" % s)
 
 fd.write("\\end{enumerate}\n")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2007年08月03日 17:58:08
Revision: 3671
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3671&view=rev
Author: mdboom
Date: 2007年08月03日 10:58:07 -0700 (2007年8月03日)
Log Message:
-----------
Change missing header file errors into warnings, since include paths
can be inserted in sneaky ways behind distutils' back ;)
Modified Paths:
--------------
 trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py	2007年08月03日 17:27:20 UTC (rev 3670)
+++ trunk/matplotlib/setupext.py	2007年08月03日 17:58:07 UTC (rev 3671)
@@ -240,26 +240,25 @@
 for d in basedirs:
 module.include_dirs.append(os.path.join(d, 'freetype2'))
 
+ print_status("freetype2", get_pkgconfig_version('freetype2'))
 if not find_include_file(module.include_dirs, 'ft2build.h'):
 print_message(
- "Could not find 'freetype2' headers in any of %s" %
+ "WARNING: Could not find 'freetype2' headers in any of %s." %
 ", ".join(["'%s'" % x for x in module.include_dirs]))
- return False
 
- print_status("freetype2", get_pkgconfig_version('freetype2'))
 return True
 
 def check_for_libpng():
 module = Extension("test", [])
 get_pkgconfig(module, 'libpng')
 add_base_flags(module)
+
+ print_status("libpng", get_pkgconfig_version('libpng'))
 if not find_include_file(module.include_dirs, 'png.h'):
 print_message(
- ", ".join("Could not find 'libpng' headers in any of %s" %
- ["'%s'" % x for x in module.include_dirs]))
- return False
+ "Could not find 'libpng' headers in any of %s" %
+ ", ".join(["'%s'" % x for x in module.include_dirs]))
 
- print_status("libpng", get_pkgconfig_version('libpng'))
 return True
 
 def add_base_flags(module):
@@ -323,11 +322,10 @@
 module = Extension('test', [])
 add_numpy_flags(module)
 add_base_flags(module)
+
+ print_status("numpy", numpy.__version__)
 if not find_include_file(module.include_dirs, os.path.join("numpy", "arrayobject.h")):
- print_status("numpy", "no")
 print_message("Could not find the headers for numpy. You may need to install the development package.")
- return False
- print_status("numpy", numpy.__version__)
 return True
 
 def add_numpy_flags(module):
@@ -408,7 +406,6 @@
 explanation = (
 "Could not find Gtk+ headers in any of %s" %
 ", ".join(["'%s'" % x for x in module.include_dirs]))
- gotit = False
 
 def ver2str(tup):
 return ".".join([str(x) for x in tup])
@@ -424,8 +421,10 @@
 ver2str(gtk.pygtk_version), pygobject_version))
 else:
 print_status("Gtk+", "no")
+
+ if explanation is not None:
 print_message(explanation)
- 
+ 
 return gotit
 
 def add_pygtk_flags(module):
@@ -529,7 +528,6 @@
 os.path.join("wx", "wxPython", "wxPython.h")):
 explanation = ("Could not find wxPython headers in any of %s" %
 ", ".join(["'%s'" % x for x in module.include_dirs]))
- gotit = False
 
 if gotit:
 print_status("wxPython", wx.__version__)
@@ -663,7 +661,6 @@
 gotit = False
 if not find_include_file(module.include_dirs, "tk.h"):
 explanation = 'Tkinter present, but header files are not installed. You may need to install development packages.'
- gotit = False
 
 if gotit:
 print_status("Tkinter", "Tkinter: %s, Tk: %s, Tcl: %s" %
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2007年08月03日 17:27:22
Revision: 3670
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3670&view=rev
Author: mdboom
Date: 2007年08月03日 10:27:20 -0700 (2007年8月03日)
Log Message:
-----------
Minor speed improvements from profiling. Fix kerning corruption issue when
"shrinking" characters.
Modified Paths:
--------------
 trunk/matplotlib/examples/mathtext_examples.py
 trunk/matplotlib/lib/matplotlib/mathtext.py
Modified: trunk/matplotlib/examples/mathtext_examples.py
===================================================================
--- trunk/matplotlib/examples/mathtext_examples.py	2007年08月02日 22:49:01 UTC (rev 3669)
+++ trunk/matplotlib/examples/mathtext_examples.py	2007年08月03日 17:27:20 UTC (rev 3670)
@@ -9,6 +9,7 @@
 r'100ドル\%y\ x*y\ x/y x\$y$',
 r'$x\leftarrow y\ x\forall y\ x-y$',
 r'$x \sf x \bf x {\cal X} \rm x$',
+ r'$x\ x,円x\;x\quad x\qquad x\!x$',
 r'$\{ \rm braces \}$',
 r'$\left[\left\lfloor\frac{5}{\frac{\left(3\right)}{4}} y\right)\right]$',
 r'$\left(x\right)$',
@@ -35,13 +36,29 @@
 r"$f'$",
 r'$\frac{x_2888}{y}$',
 r"$\sqrt[3]{\frac{X_2}{Y}}=5$",
+ r"$\sqrt[5x\pi]{\prod^\frac{x}{2\pi^2}_\infty}$",
 r"$\sqrt[3]{x}=5$",
 r'$\frac{X}{\frac{X}{Y}}$',
+ # From UTR #25
+ r"$W^{3\beta}_{\delta_1 \rho_1 \sigma_2} = U^{3\beta}_{\delta_1 \rho_1} + \frac{1}{8 \pi 2} \int^{\alpha_2}_{\alpha_2} d \alpha^\prime_2 \left[\frac{ U^{2\beta}_{\delta_1 \rho_1} - \alpha^\prime_2U^{1\beta}_{\rho_1 \sigma_2} }{U^{0\beta}_{\rho_1 \sigma_2}}\right]$",
+ r'$\mathcal{H} = \int d \tau (\epsilon E^2 + \mu H^2)$',
 r'$\widehat{abc}\widetilde{def}$'
 ]
 
 from pylab import *
 
+def doall():
+ for i, s in enumerate(stests):
+ print "%02d: %s" % (i, s)
+ plot([0,0,3], 'r')
+ x = arange(0.0, 3.0, 0.1)
+
+ grid(True)
+ text(0.1, 1.6, s, fontsize=20, markup="tex")
+
+ savefig('mathtext_example%02d' % i)
+ figure()
+
 if '--latex' in sys.argv:
 fd = open("mathtext_examples.ltx", "w")
 fd.write("\\documentclass{article}\n")
@@ -57,14 +74,4 @@
 
 os.system("pdflatex mathtext_examples.ltx")
 else:
- for i, s in enumerate(stests):
- print "%02d: %s" % (i, s)
- plot([1,2,3], 'r')
- x = arange(0.0, 3.0, 0.1)
-
- grid(True)
- text(1, 1.6, s, fontsize=20, markup="tex")
-
- savefig('mathtext_example%02d' % i)
- figure()
-
+ doall()
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py	2007年08月02日 22:49:01 UTC (rev 3669)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py	2007年08月03日 17:27:20 UTC (rev 3670)
@@ -135,8 +135,9 @@
 from sets import Set
 from unicodedata import category
 from warnings import warn
-import numpy
 
+from numpy import inf, isinf
+
 from matplotlib import verbose
 from matplotlib.pyparsing import Literal, Word, OneOrMore, ZeroOrMore, \
 Combine, Group, Optional, Forward, NotAny, alphas, nums, alphanums, \
@@ -554,7 +555,7 @@
 
 def _get_offset(self, cached_font, glyph, fontsize, dpi):
 if cached_font.font.postscript_name == 'Cmex10':
- return glyph.height/64.0/2 + 256.0/64.0 * dpi/72.0
+ return glyph.height/64.0/2.0 + 256.0/64.0 * dpi/72.0
 return 0.
 
 def _get_glyph(self, fontname, sym, fontsize):
@@ -654,7 +655,7 @@
 # This is a total hack, but it works for now
 if sym.startswith('\\big'):
 uniindex = get_unicode_index(sym[4:])
- fontsize *= INV_SHRINK_FACTOR
+ fontsize *= GROW_FACTOR
 else:
 warn("No TeX to unicode mapping for '%s'" % sym,
 MathTextWarning)
@@ -848,7 +849,7 @@
 
 # How much text shrinks when going to the next-smallest level
 SHRINK_FACTOR = 0.7
-INV_SHRINK_FACTOR = 1.0 / SHRINK_FACTOR
+GROW_FACTOR = 1.0 / SHRINK_FACTOR
 # The number of different sizes of chars to use, beyond which they will not
 # get any smaller
 NUM_SIZE_LEVELS = 4
@@ -900,28 +901,22 @@
 @135"""
 def __init__(self, width, height, depth):
 Node.__init__(self)
- self.width = width
- self.height = height
- self.depth = depth
+ self.width = width
+ self.height = height
+ self.depth = depth
 
 def shrink(self):
 Node.shrink(self)
 if self.size < NUM_SIZE_LEVELS:
- if self.width is not None:
- self.width *= SHRINK_FACTOR
- if self.height is not None:
- self.height *= SHRINK_FACTOR
- if self.depth is not None:
- self.depth *= SHRINK_FACTOR
+ self.width *= SHRINK_FACTOR
+ self.height *= SHRINK_FACTOR
+ self.depth *= SHRINK_FACTOR
 
 def grow(self):
 Node.grow(self)
- if self.width is not None:
- self.width *= INV_SHRINK_FACTOR
- if self.height is not None:
- self.height *= INV_SHRINK_FACTOR
- if self.depth is not None:
- self.depth *= INV_SHRINK_FACTOR
+ self.width *= GROW_FACTOR
+ self.height *= GROW_FACTOR
+ self.depth *= GROW_FACTOR
 
 def render(self, x1, y1, x2, y2):
 pass
@@ -992,12 +987,16 @@
 Node.shrink(self)
 if self.size < NUM_SIZE_LEVELS:
 self.fontsize *= SHRINK_FACTOR
- self._update_metrics()
+ self.width *= SHRINK_FACTOR
+ self.height *= SHRINK_FACTOR
+ self.depth *= SHRINK_FACTOR
 
 def grow(self):
 Node.grow(self)
- self.fontsize *= INV_SHRINK_FACTOR
- self._update_metrics()
+ self.fontsize *= GROW_FACTOR
+ self.width *= GROW_FACTOR
+ self.height *= GROW_FACTOR
+ self.depth *= GROW_FACTOR
 
 class Accent(Char):
 """The font metrics need to be dealt with differently for accents, since they
@@ -1028,10 +1027,11 @@
 self.glue_order = 0 # The order of infinity (0 - 3) for the glue
 
 def __repr__(self):
- return '[%s <%d %d %d %d> %s]' % (self.__internal_repr__(),
- self.width, self.height,
- self.depth, self.shift_amount,
- ' '.join([repr(x) for x in self.children]))
+ return '[%s <%.02f %.02f %.02f %.02f> %s]' % (
+ self.__internal_repr__(),
+ self.width, self.height,
+ self.depth, self.shift_amount,
+ ' '.join([repr(x) for x in self.children]))
 
 def _determine_order(self, totals):
 """A helper function to determine the highest order of glue
@@ -1069,8 +1069,8 @@
 for child in self.children:
 child.grow()
 Box.grow(self)
- self.shift_amount *= INV_SHRINK_FACTOR
- self.glue_set *= INV_SHRINK_FACTOR
+ self.shift_amount *= GROW_FACTOR
+ self.glue_set *= GROW_FACTOR
 
 class Hlist(List):
 """A horizontal list of boxes.
@@ -1131,7 +1131,7 @@
 d = max(d, p.depth)
 elif isinstance(p, Box):
 x += p.width
- if p.height is not None and p.depth is not None:
+ if not isinf(p.height) and not isinf(p.depth):
 s = getattr(p, 'shift_amount', 0.)
 h = max(h, p.height - s)
 d = max(d, p.depth + s)
@@ -1167,7 +1167,7 @@
 List.__init__(self, elements)
 self.vpack()
 
- def vpack(self, h=0., m='additional', l=float(numpy.inf)):
+ def vpack(self, h=0., m='additional', l=float(inf)):
 """The main duty of vpack is to compute the dimensions of the
 resulting boxes, and to adjust the glue if one of those dimensions is
 pre-specified.
@@ -1192,7 +1192,7 @@
 if isinstance(p, Box):
 x += d + p.height
 d = p.depth
- if p.width is not None:
+ if not isinf(p.width):
 s = getattr(p, 'shift_amount', 0.)
 w = max(w, p.width + s)
 elif isinstance(p, Glue):
@@ -1234,7 +1234,7 @@
 class Rule(Box):
 """A Rule node stands for a solid black rectangle; it has width,
 depth, and height fields just as in an Hlist. However, if any of these
- dimensions is None, the actual value will be determined by running the
+ dimensions is inf, the actual value will be determined by running the
 rule up to the boundary of the innermost enclosing box. This is called
 a "running dimension." The width is never running in an Hlist; the
 height and depth are never running in a Vlist.
@@ -1252,14 +1252,14 @@
 thickness = state.font_output.get_underline_thickness(
 state.font, state.fontsize, state.dpi)
 height = depth = thickness * 0.5
- Rule.__init__(self, None, height, depth, state)
+ Rule.__init__(self, inf, height, depth, state)
 
 class Vrule(Rule):
 """Convenience class to create a vertical rule."""
 def __init__(self, state):
 thickness = state.font_output.get_underline_thickness(
 state.font, state.fontsize, state.dpi)
- Rule.__init__(self, thickness, None, None, state)
+ Rule.__init__(self, thickness, inf, inf, state)
 
 class Glue(Node):
 """Most of the information in this object is stored in the underlying
@@ -1291,7 +1291,7 @@
 Node.grow(self)
 if self.glue_spec.width != 0.:
 self.glue_spec = self.glue_spec.copy()
- self.glue_spec.width *= INV_SHRINK_FACTOR
+ self.glue_spec.width *= GROW_FACTOR
 
 class GlueSpec(object):
 """@150, @151"""
@@ -1379,6 +1379,9 @@
 Node.__init__(self)
 self.width = width
 
+ def __repr__(self):
+ return "k%.02f" % self.width
+ 
 def shrink(self):
 Node.shrink(self)
 if self.size < NUM_SIZE_LEVELS:
@@ -1386,7 +1389,7 @@
 
 def grow(self):
 Node.grow(self)
- self.width *= INV_SHRINK_FACTOR
+ self.width *= GROW_FACTOR
 
 class SubSuperCluster(Hlist):
 """This class is a sort of hack to get around that fact that this
@@ -1507,9 +1510,9 @@
 rule_height = p.height
 rule_depth = p.depth
 rule_width = p.width
- if rule_height is None:
+ if isinf(rule_height):
 rule_height = box.height
- if rule_depth is None:
+ if isinf(rule_depth):
 rule_depth = box.depth
 if rule_height > 0 and rule_width > 0:
 self.cur_v = baseline + rule_depth
@@ -1566,7 +1569,7 @@
 rule_height = p.height
 rule_depth = p.depth
 rule_width = p.width
- if rule_width is None:
+ if isinf(rule_width):
 rule_width = box.width
 rule_height += rule_depth
 if rule_height > 0 and rule_depth > 0:
@@ -1822,7 +1825,7 @@
 
 self._expression <<(
 non_math
- + OneOrMore(
+ + ZeroOrMore(
 Suppress(math_delim)
 + math
 + Suppress(math_delim)
@@ -2178,7 +2181,8 @@
 else:
 if not isinstance(root, ParseResults):
 raise ParseFatalException(
- "Can not parse root of radical. Only simple symbols are allowed.")
+ "Can not parse root of radical. "
+ "Only simple symbols are allowed in the root.")
 root = Hlist(root.asList())
 root.shrink()
 root.shrink()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing 4 results of 4

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /