Upside down text assistance request

  • New user here and new to typesetting area.

    I'm trying to print a single word upside down within a line of text and I'm using the text() function.Could someone supply some hints (or a solution). If I have to split the line at the upside down word I don't see that as a problem I cannot solve (but maybe I'm overconfident).

    Additionally, I'd like to print an entire text box upside down.Is there a way to do that too?

    I'm trying to use the scale() function with a negative value but not sure where the output is going. I'm definitely missing something.


  • As I can’t see your code, I’m not sure what happens, but scale() normally translates around the origin. Maybe the output is going outside of the canvas?

    It’s possible to change the center of scaling by using center=(x,y).

    In the example below I chose a different solution. I used translate() to temporarily – only within savedState() – move the origin of the canvas.

    font("Times-Italic", 200)
    with savedState():
        # translate the canvas
        # Draw the black text at the (translated) origin 
        text("hello", (0, 0))
        # Mirror the canvas
        # Draw the red text at the (translated) origin that will appear mirrored 
        text("hello", (0, 0))

  • @monomonnik Thank you very much. You are correct, I'm scaling outside the page and I can probably use something similar to put one word on a line upside down, but it will be a little harder than a whole text box.

Log in to reply