Skip to content
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

[Bug]: too much logging info after setting matplotlib.rcParams['pdf.fonttype'] = 42 #24546

Closed
WanxiangHuang opened this issue Nov 25, 2022 · 5 comments

Comments

@WanxiangHuang
Copy link

Bug summary

Hi, In order to solve font type3 problem, I added the following code. But it will generate too much logging info. I don't know the reaseon.

Code for reproduction

import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
matplotlib.use("Agg")
from matplotlib import pyplot as plt

Actual outcome

INFO: 2022-11-25 22:11:48: name pruned
INFO: 2022-11-25 22:11:48: glyf pruned
INFO: 2022-11-25 22:11:48: Added gid0 to subset
INFO: 2022-11-25 22:11:48: Added first four glyphs to subset
INFO: 2022-11-25 22:11:48: Closing glyph list over 'GSUB': 60 glyphs before
INFO: 2022-11-25 22:11:48: Glyph names: ['.notdef', '.null', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'e', 'eight', 'f', 'five', 'four', 'g', 'h', 'i', 'l', 'm', 'n', 'nine', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'u', 'w', 'y', 'zero']
INFO: 2022-11-25 22:11:48: Glyph IDs: [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 68, 69, 70, 72, 73, 74, 75, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88, 90, 92]
INFO: 2022-11-25 22:11:48: Closed glyph list over 'GSUB': 65 glyphs after
INFO: 2022-11-25 22:11:48: Glyph names: ['.notdef', '.null', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'e', 'eight', 'f', 'fi', 'five', 'fl', 'four', 'g', 'h', 'i', 'l', 'm', 'n', 'nine', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'u', 'uniFB00', 'uniFB03', 'uniFB04', 'w', 'y', 'zero']
INFO: 2022-11-25 22:11:48: Glyph IDs: [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 68, 69, 70, 72, 73, 74, 75, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88, 90, 92, 5038, 5039, 5040, 5041, 5042]
INFO: 2022-11-25 22:11:48: Closing glyph list over 'MATH': 65 glyphs before
INFO: 2022-11-25 22:11:48: Glyph names: ['.notdef', '.null', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'e', 'eight', 'f', 'fi', 'five', 'fl', 'four', 'g', 'h', 'i', 'l', 'm', 'n', 'nine', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'u', 'uniFB00', 'uniFB03', 'uniFB04', 'w', 'y', 'zero']
INFO: 2022-11-25 22:11:48: Glyph IDs: [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 68, 69, 70, 72, 73, 74, 75, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88, 90, 92, 5038, 5039, 5040, 5041, 5042]
INFO: 2022-11-25 22:11:48: Closed glyph list over 'MATH': 65 glyphs after

Expected outcome

clean output

Additional information

No response

Operating system

No response

Matplotlib Version

3.5.1

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

No response

@jklymak
Copy link
Member

jklymak commented Nov 25, 2022

You must somehow have your logging level set to a non default INFO or lower. Or a package you are importing is doing it for you. We don't set the logging level so low.

If you need logging set so low for some reason you can filter our logs. See the logging module documentation for Python

@anntzer
Copy link
Contributor

anntzer commented Nov 30, 2022

I agree there is nothing to be fixed on our side.

@anntzer anntzer closed this as completed Nov 30, 2022
@earmingol
Copy link

earmingol commented Dec 6, 2023

I am getting the same thing, see the issue I opened here: fonttools/fonttools#3371

In this case I am not changing anything that could modify the logging level, and I noticed I start getting this issue when using

plt.rcParams.update({"pdf.fonttype": 42, "ps.fonttype": 42})

and saving any plot as pdf. However, I stop getting these logging messages when I reset the fonts with:

from matplotlib import rcParams, rcParamsDefault
rcParams.update(rcParamsDefault)

So aparently matplotlib is changing the logging level or causing it? Or maybe fonttools when matplotlib calls it (according to this section from https://matplotlib.org/stable/users/explain/text/fonts.html
Screen Shot 2023-12-06 at 01 05 30

@QuLogic
Copy link
Member

QuLogic commented Dec 6, 2023

Matplotlib does not change logging levels, unless you call set_loglevel.

@lldelisle
Copy link

I don't know if the fix is relevant to you: fonttools/fonttools#3371 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants