diagrams / diagrams-cairo

Cairo backend for diagrams
Other
13 stars 17 forks source link

Text does not appear with Cairo on Windows. #8

Open fryguybob opened 11 years ago

fryguybob commented 11 years ago

(Imported from http://code.google.com/p/diagrams/issues/detail?id=36. Original issue from fryguy...@gmail.com on June 15, 2011, 03:17:52 PM UTC)

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:

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 "t.ps" 500 500 surfaceF
  where
    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"
bergey commented 10 years ago

This is likely fixed by https://github.com/diagrams/diagrams-cairo/commit/b953ae90d3c1ba13c15bc5a86c5fa4851da16ce7. Can someone on windows test? I'll fire up a VM in a few days, if no one gets to it sooner.