Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Shortened the far too long message when no font is used, and about CairoText deprecation. Ran black

MysaaJava5292fc8912e3
diff --git a/docs/source/manim_directive.py b/docs/source/manim_directive.py
index 4b8df6f4f..7c34657c8 100644
--- a/docs/source/manim_directive.py
+++ b/docs/source/manim_directive.py
@@ -106,7 +106,7 @@ class ManimDirective(Directive):
save_last_frame = "save_last_frame" in self.options
write_to_movie = not save_last_frame
assert not (save_as_gif and save_last_frame)
-
+
frame_rate = 30
pixel_height = 480
pixel_width = 854
diff --git a/manim/constants.py b/manim/constants.py
index 2f13f226e..63151a51b 100644
--- a/manim/constants.py
+++ b/manim/constants.py
@@ -6,17 +6,6 @@ import numpy as np
# Messages
-NOT_SETTING_FONT_MSG = """
-You haven't set font.
-If you are not using English, this may cause text rendering problem.
-You set font like:
-text = Text('your text', font='your font')
-or:
-class MyText(Text):
- CONFIG = {
- 'font': 'My Font'
- }
-"""
SCENE_NOT_FOUND_MESSAGE = """
{} is not in the script
"""
diff --git a/manim/mobject/svg/text_mobject.py b/manim/mobject/svg/text_mobject.py
index 906be3d17..63f73a37c 100644
--- a/manim/mobject/svg/text_mobject.py
+++ b/manim/mobject/svg/text_mobject.py
@@ -307,8 +307,9 @@ class CairoText(SVGMobject):
line_spacing = self.line_spacing * 10
if self.font == "":
- if NOT_SETTING_FONT_MSG:
- logger.warning(NOT_SETTING_FONT_MSG)
+ logger.warning(
+ "You haven't set font, non-english characters may not be rendered"
+ )
dir_name = file_writer_config["text_dir"]
if not os.path.exists(dir_name):
@@ -934,8 +935,5 @@ class Text(CairoText):
"""
def __init__(self, text, **config):
- logger.warning(
- "Using Text uses Cairo Toy API to Render Text."
- "Using PangoText is recommended and soon Text would point to PangoText"
- )
+ logger.warning("Text currently uses Cairo Toy API, but will soon use PangoText")
CairoText.__init__(self, text, **config)
diff --git a/manim/scene/scene_file_writer.py b/manim/scene/scene_file_writer.py
index bb6906c91..bde2caaa8 100644
--- a/manim/scene/scene_file_writer.py
+++ b/manim/scene/scene_file_writer.py
@@ -484,14 +484,14 @@ class SceneFileWriter(object):
:class:`bool`
Whether the file exists.
"""
- if hasattr(self,'partial_movie_directory'):
+ if hasattr(self, "partial_movie_directory"):
path = os.path.join(
self.partial_movie_directory,
"{}{}".format(hash_invocation, self.movie_file_extension),
)
return os.path.exists(path)
else:
- return False # If there is no partial movie directory, then the file is not cached
+ return False # If there is no partial movie directory, then the file is not cached
def combine_movie_files(self):
"""