Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Some more maintenance for mathtext internal implementation.#22488

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 1 commit intomatplotlib:mainfromanntzer:mt
Feb 18, 2022
Merged
Changes fromall commits
Commits
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
47 changes: 7 additions & 40 deletionslib/matplotlib/_mathtext.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -851,7 +851,7 @@ def __init__(self):
self.size = 0

def __repr__(self):
return self.__class__.__name__
returntype(self).__name__

def get_kerning(self, next):
return 0.0
Expand All@@ -864,7 +864,7 @@ def shrink(self):
self.size += 1

def render(self, x, y):
pass
"""Render this node."""


class Box(Node):
Expand DownExpand Up@@ -961,12 +961,8 @@ def get_kerning(self, next):
return advance + kern

def render(self, x, y):
"""
Render the character to the canvas
"""
self.font_output.render_glyph(
x, y,
self.font, self.font_class, self.c, self.fontsize, self.dpi)
x, y, self.font, self.font_class, self.c, self.fontsize, self.dpi)

def shrink(self):
super().shrink()
Expand DownExpand Up@@ -995,9 +991,6 @@ def shrink(self):
self._update_metrics()

def render(self, x, y):
"""
Render the character to the canvas.
"""
self.font_output.render_glyph(
x - self._metrics.xmin, y + self._metrics.ymin,
self.font, self.font_class, self.c, self.fontsize, self.dpi)
Expand All@@ -1022,21 +1015,10 @@ def __repr__(self):
self.depth, self.shift_amount,
', '.join([repr(x) for x in self.children]))

@staticmethod
def _determine_order(totals):
"""
Determine the highest order of glue used by the members of this list.

Helper function used by vpack and hpack.
"""
for i in range(len(totals))[::-1]:
if totals[i] != 0:
return i
return 0

def _set_glue(self, x, sign, totals, error_type):
o = self._determine_order(totals)
self.glue_order = o
self.glue_order = o = next(
# Highest order of glue used by the members of this list.
(i for i in range(len(totals))[::-1] if totals[i] != 0), 0)
self.glue_sign = sign
if totals[o] != 0.:
self.glue_set = x / totals[o]
Expand All@@ -1046,7 +1028,7 @@ def _set_glue(self, x, sign, totals, error_type):
if o == 0:
if len(self.children):
_log.warning("%s %s: %r",
error_type, self.__class__.__name__, self)
error_type,type(self).__name__, self)

def shrink(self):
for child in self.children:
Expand DownExpand Up@@ -1372,21 +1354,6 @@ def shrink(self):
self.width *= SHRINK_FACTOR


class SubSuperCluster(Hlist):
"""
A hack to get around that fact that this code does a two-pass parse like
TeX. This lets us store enough information in the hlist itself, namely the
nucleus, sub- and super-script, such that if another script follows that
needs to be attached, it can be reconfigured on the fly.
"""

def __init__(self):
self.nucleus = None
self.sub = None
self.super = None
super().__init__([])


class AutoHeightChar(Hlist):
"""
A character as close to the given height and depth as possible.
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp