Skip to content

Commit 5292fc8

Browse files
committed
Shortened the far too long message when no font is used, and about CairoText deprecation. Ran black
1 parent 133a032 commit 5292fc8

File tree

4 files changed

+7
-20
lines changed

4 files changed

+7
-20
lines changed

docs/source/manim_directive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def run(self):
106106
save_last_frame = "save_last_frame" in self.options
107107
write_to_movie = not save_last_frame
108108
assert not (save_as_gif and save_last_frame)
109-
109+
110110
frame_rate = 30
111111
pixel_height = 480
112112
pixel_width = 854

manim/constants.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,6 @@
66

77

88
# Messages
9-
NOT_SETTING_FONT_MSG = """
10-
You haven't set font.
11-
If you are not using English, this may cause text rendering problem.
12-
You set font like:
13-
text = Text('your text', font='your font')
14-
or:
15-
class MyText(Text):
16-
CONFIG = {
17-
'font': 'My Font'
18-
}
19-
"""
209
SCENE_NOT_FOUND_MESSAGE = """
2110
{} is not in the script
2211
"""

manim/mobject/svg/text_mobject.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,9 @@ def text2svg(self):
307307
line_spacing = self.line_spacing * 10
308308

309309
if self.font == "":
310-
if NOT_SETTING_FONT_MSG:
311-
logger.warning(NOT_SETTING_FONT_MSG)
310+
logger.warning(
311+
"You haven't set font, non-english characters may not be rendered"
312+
)
312313

313314
dir_name = file_writer_config["text_dir"]
314315
if not os.path.exists(dir_name):
@@ -934,8 +935,5 @@ def construct(self):
934935
"""
935936

936937
def __init__(self, text, **config):
937-
logger.warning(
938-
"Using Text uses Cairo Toy API to Render Text."
939-
"Using PangoText is recommended and soon Text would point to PangoText"
940-
)
938+
logger.warning("Text currently uses Cairo Toy API, but will soon use PangoText")
941939
CairoText.__init__(self, text, **config)

manim/scene/scene_file_writer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,14 +484,14 @@ def is_already_cached(self, hash_invocation):
484484
:class:`bool`
485485
Whether the file exists.
486486
"""
487-
if hasattr(self,'partial_movie_directory'):
487+
if hasattr(self, "partial_movie_directory"):
488488
path = os.path.join(
489489
self.partial_movie_directory,
490490
"{}{}".format(hash_invocation, self.movie_file_extension),
491491
)
492492
return os.path.exists(path)
493493
else:
494-
return False # If there is no partial movie directory, then the file is not cached
494+
return False # If there is no partial movie directory, then the file is not cached
495495

496496
def combine_movie_files(self):
497497
"""

0 commit comments

Comments
 (0)