My favorites | Sign in
Project Home Wiki Issues Source
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 36: Text does not appear with Cairo on Windows.
1 person starred this issue and may be notified of changes. Back to list
Status:  Duplicate
Closed:  Nov 2012

Sign in to add a comment
Project Member Reported by, Jun 15, 2011
It appears that there is a serious bug in Cairo that prevents text from showing on Windows when showing text is proceeded by a call to transform the current transform matrix.  `moveTo`, `rotate`, and `scale` calls all appear to work as expected.

Different versions of Cairo behave differently:

*  Version 1.8.10 (gtk 2.20 all-in-one bundle) as described above.
*  Version 1.10.2 (gtk 2.22 all-in-one bundle) fails with error: 
       user error (invalid matrix (not invertible))
   This is the error `CAIRO_STATUS_INVALID_MATRIX`.  The reason for this
   difference appears to be related to [this change](
*  Version 1.11.3 (Current head built locally).  This build did not use `freetype` and that may explain the differences. Text did show, but when using a matrix transformation, it was clipped strangely ("hello world" was missing the 'h').

While this is not an issue with Diagrams directly I'm documenting here to keep track of things.  The following code reproduces the issue:

    import qualified Graphics.Rendering.Cairo as C
    import qualified Graphics.Rendering.Cairo.Matrix as CM
    main = C.withPSSurface "" 500 500 surfaceF
        surfaceF s = C.renderWith s r'
        r' = do
          C.moveTo 100 100
          -- C.transform $ CM.Matrix 1.0 0.0 0.0 1.0 0.0 100.0 -- no text.
          -- C.transform $ CM.Matrix 1.0 0.0 0.0 1.0 0.0 0.0   -- works.
          C.translate 0.0 100.0 -- works
          C.showText "hello world"

Nov 11, 2012
Project Member #1
Moved to github.
Status: Duplicate
Sign in to add a comment

Powered by Google Project Hosting