Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text does not appear with Cairo on Windows. #8

Open
fryguybob opened this issue Aug 4, 2012 · 1 comment
Open

Text does not appear with Cairo on Windows. #8

fryguybob opened this issue Aug 4, 2012 · 1 comment
Assignees

Comments

@fryguybob
Copy link
Member

(Imported from http://code.google.com/p/diagrams/issues/detail?id=36. Original issue from [email protected] 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:

  • 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 "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"
@ghost ghost assigned fryguybob Aug 4, 2012
@bergey
Copy link
Member

bergey commented Jun 3, 2014

This is likely fixed by b953ae9. Can someone on windows test? I'll fire up a VM in a few days, if no one gets to it sooner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants