Text rendering matrix

  • Glen Thomas

    Glen Thomas - 2011-03-17

    For the text rendering, could you show me how to modify the Current Transformation Matrix or the Text Matrix in order to rotate and flip the text?

    The text needs to be rotated 180 degrees and flipped on the x-axis.

    It has been a long time since I worked with Matricies so I can't remember how this is done and what I have found from Google isn't really helping enough.


  • Stefano Chizzolini

    I'm sorry but I've currently not enough time to assist you with your endeavour.
    Anyway, horizontal flipping should be performed through {-1,0,0,1,0,0} (consider you have to pay attention to the order of your transformations).

    good luck!

  • Glen Thomas

    Glen Thomas - 2011-03-17

    Thanks I think thats probably all I need.

    I tried using the Rotate methods of the CTM, TM and TRM to see if that would turn my text the right way up but all it did was move it to different positions on the page. I know that I need to Translate to the centre of the page/charbox before I perform Rotation, but text still completely upside-down. I tried drawing the text to another Graphics object, flipping and rotating and then drawing that Image to the RenderContext, but I couldn't get that to work either.

    I'll keep playing with it.

    I'm getting closer with the images but still work to do. I think the reason that the colours are wrong in the PNGs is because I need to change the order of the RGB bytes to GRB or BGR or something. I'm hoping System.Drawing.Image will take care of the transparency masking for me. Some of the PNGs are coming out sort of stretched and tiled too. That could be to do with the PixelFormat.

    I found a problem with FillPath when rendering some of the sample PDFs and another problem with LineDash.

    Also looking at CFF fonts.

    I'm looking forward to the next release! Hopefully I can come up with something worthy of contribution.


Log in to post a comment.