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

Use fix-cm instead of type1cm.#30100

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
QuLogic merged 1 commit intomatplotlib:mainfromanntzer:fcm
May 28, 2025
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletiondoc/install/dependencies.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -443,7 +443,8 @@ will often automatically include these collections.
| | `lm <https://ctan.org/pkg/lm>`_, |
| | `txfonts <https://ctan.org/pkg/txfonts>`_ |
+-----------------------------+--------------------------------------------------+
| collection-latex | `geometry <https://ctan.org/pkg/geometry>`_, |
| collection-latex | `fix-cm <https://ctan.org/pkg/fix-cm>`_, |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can we drop L455 (the type1cm) below?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

No, see (the links at the bottom of)#29791 (comment) for why we still need type1cm being installed (even if not usepackage'd).

tacaswell reacted with thumbs up emoji
| | `geometry <https://ctan.org/pkg/geometry>`_, |
| | `hyperref <https://ctan.org/pkg/hyperref>`_, |
| | `latex <https://ctan.org/pkg/latex>`_, |
| | latex-bin, |
Expand Down
2 changes: 1 addition & 1 deletionlib/matplotlib/mpl-data/matplotlibrc
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -339,7 +339,7 @@
# become quite long.
# The following packages are always loaded with usetex,
# so beware of package collisions:
# geometry,inputenc, type1cm.
#color, fix-cm,geometry,graphicx, textcomp.
# PostScript (PSNFSS) font packages may also be
# loaded, depending on your font settings.

Expand Down
4 changes: 2 additions & 2 deletionslib/matplotlib/mpl-data/stylelib/classic.mplstyle
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -122,8 +122,8 @@ text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURE
# Note that it has to be put on a single line, which may
# become quite long.
# The following packages are always loaded with usetex, so
# beware of package collisions: color, geometry, graphicx,
#type1cm, textcomp.
# beware of package collisions:
# color, fix-cm, geometry, graphicx, textcomp.
# Adobe Postscript (PSSNFS) font packages may also be
# loaded, depending on your font settings.

Expand Down
2 changes: 1 addition & 1 deletionlib/matplotlib/tests/test_backend_svg.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -216,7 +216,7 @@ def test_unicode_won():

tree = xml.etree.ElementTree.fromstring(buf)
ns = 'http://www.w3.org/2000/svg'
won_id = 'SFSS3583-8e'
won_id = 'SFSS1728-8e'
assert len(tree.findall(f'.//{{{ns}}}path[@d][@id="{won_id}"]')) == 1
assert f'#{won_id}' in tree.find(f'.//{{{ns}}}use').attrib.values()

Expand Down
7 changes: 7 additions & 0 deletionslib/matplotlib/tests/test_usetex.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -185,3 +185,10 @@ def test_rotation():
# 'My' checks full height letters plus descenders.
ax.text(x, y, f"$\\mathrm{{My {text[ha]}{text[va]} {angle}}}$",
rotation=angle, horizontalalignment=ha, verticalalignment=va)


def test_unicode_sizing():
tp = mpl.textpath.TextToPath()
scale1 = tp.get_glyphs_tex(mpl.font_manager.FontProperties(), "W")[0][0][3]
scale2 = tp.get_glyphs_tex(mpl.font_manager.FontProperties(), r"\textwon")[0][0][3]
assert scale1 == scale2
19 changes: 12 additions & 7 deletionslib/matplotlib/texmanager.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -67,6 +67,13 @@ class TexManager:
_grey_arrayd = {}

_font_families = ('serif', 'sans-serif', 'cursive', 'monospace')
# Check for the cm-super package (which registers unicode computer modern
# support just by being installed) without actually loading any package
# (because we already load the incompatible fix-cm).
_check_cmsuper_installed = (
r'\IfFileExists{type1ec.sty}{}{\PackageError{matplotlib-support}{'
r'Missing cm-super package, required by Matplotlib}{}}'
)
_font_preambles = {
'new century schoolbook': r'\renewcommand{\rmdefault}{pnc}',
'bookman': r'\renewcommand{\rmdefault}{pbk}',
Expand All@@ -80,13 +87,10 @@ class TexManager:
'helvetica': r'\usepackage{helvet}',
'avant garde': r'\usepackage{avant}',
'courier': r'\usepackage{courier}',
# Loading the type1ec package ensures that cm-super is installed, which
# is necessary for Unicode computer modern. (It also allows the use of
# computer modern at arbitrary sizes, but that's just a side effect.)
'monospace': r'\usepackage{type1ec}',
'computer modern roman': r'\usepackage{type1ec}',
'computer modern sans serif': r'\usepackage{type1ec}',
'computer modern typewriter': r'\usepackage{type1ec}',
'monospace': _check_cmsuper_installed,
'computer modern roman': _check_cmsuper_installed,
'computer modern sans serif': _check_cmsuper_installed,
'computer modern typewriter': _check_cmsuper_installed,
}
_font_types = {
'new century schoolbook': 'serif',
Expand DownExpand Up@@ -200,6 +204,7 @@ def _get_tex_source(cls, tex, fontsize):
font_preamble, fontcmd = cls._get_font_preamble_and_command()
baselineskip = 1.25 * fontsize
return "\n".join([
r"\RequirePackage{fix-cm}",
r"\documentclass{article}",
r"% Pass-through \mathdefault, which is used in non-usetex mode",
r"% to use the default text font but was historically suppressed",
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp