Skip to content

Use file_writer_config instead of config to get text_dir for Text() #220

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

Merged
merged 2 commits into from
Jul 26, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 3 additions & 4 deletions manim/mobject/svg/text_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import cairo

from ...constants import *
from ...config import config
from ...config import config,file_writer_config
from ...container.container import Container
from ...logger import logger
from ...mobject.geometry import Dot, Rectangle
Expand Down Expand Up @@ -96,7 +96,7 @@ def __init__(self, text, **config):
def get_space_width(self):
size = self.size * 10

dir_name = config['text_dir']
dir_name = file_writer_config['text_dir']
file_name = os.path.join(dir_name, "space") + '.svg'

surface = cairo.SVGSurface(file_name, 600, 400)
Expand Down Expand Up @@ -291,8 +291,7 @@ def text2svg(self):
if self.font == '':
if NOT_SETTING_FONT_MSG != '':
logger.warning(NOT_SETTING_FONT_MSG)

dir_name = config['text_dir']
dir_name = file_writer_config['text_dir']
hash_name = self.text2hash()
file_name = os.path.join(dir_name, hash_name)+'.svg'
if os.path.exists(file_name):
Expand Down
2 changes: 1 addition & 1 deletion tests/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, scene_object, module_tested, caching_needed=False):
self.path_tests_data = os.path.join('tests', 'tests_data', module_tested)

if caching_needed:
config['text_dir'] = os.path.join(
file_writer_config['text_dir'] = os.path.join(
self.path_tests_medias_cache, scene_object.__name__, 'Text')
file_writer_config['tex_dir'] = os.path.join(
self.path_tests_medias_cache, scene_object.__name__, 'Tex')
Expand Down