Esempio n. 1
0
 def get_quote(self, max_width = 2*SPACE_WIDTH-1):
     text_mobject_kwargs = {
         "alignment" : "",
         "arg_separator" : self.quote_arg_separator,
     }
     if isinstance(self.quote, str):
         quote = TextMobject("``%s''"%self.quote.strip(), **text_mobject_kwargs)
     else:
         words = ["``"] + list(self.quote) + ["''"]
         quote = TextMobject(*words, **text_mobject_kwargs)
         ##TODO, make less hacky
         quote[0].shift(0.2*RIGHT)
         quote[-1].shift(0.2*LEFT)
     for term, color in self.highlighted_quote_terms.items():
         quote.highlight_by_tex(term, color)
     quote.to_edge(UP)
     if quote.get_width() > max_width:
         quote.scale_to_fit_width(max_width)
     return quote
Esempio n. 2
0
 def get_quote(self, max_width=2 * SPACE_WIDTH - 1):
     text_mobject_kwargs = {
         "alignment": "",
         "arg_separator": self.quote_arg_separator,
     }
     if isinstance(self.quote, str):
         quote = TextMobject("``%s''" % self.quote.strip(),
                             **text_mobject_kwargs)
     else:
         words = ["``"] + list(self.quote) + ["''"]
         quote = TextMobject(*words, **text_mobject_kwargs)
         ##TODO, make less hacky
         quote[0].shift(0.2 * RIGHT)
         quote[-1].shift(0.2 * LEFT)
     for term, color in self.highlighted_quote_terms.items():
         quote.highlight_by_tex(term, color)
     quote.to_edge(UP)
     if quote.get_width() > max_width:
         quote.scale_to_fit_width(max_width)
     return quote