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 is getting clipped on top with latest Cairo_jll #368

Open
mwlidar opened this issue Oct 18, 2024 · 0 comments
Open

Text is getting clipped on top with latest Cairo_jll #368

mwlidar opened this issue Oct 18, 2024 · 0 comments

Comments

@mwlidar
Copy link

mwlidar commented Oct 18, 2024

With the latest version Cairo some annoying problems with fonts or ReadOnlyMemory errors are gone, but unfortunately I now get the following clipping of pango generated text on the top:

pango_clip_MWE_latest

Reverting Cairo_jll from 1.18.2 to 1.16.1 gives the proper behavior again:

pango_clip_MWE

This was generated in a fresh environment were only Cairo was added.

The code for this MWE is as follows:

using Cairo
using Printf

c = CairoRGBSurface(256,256);
cr = CairoContext(c);

Cairo.save(cr);
set_source_rgb(cr, 0.8, 0.8, 0.8);    # light gray
rectangle(cr, 0.0, 0.0, 256.0, 256.0); # background
fill(cr);
restore(cr);

Cairo.save(cr);

set_font_face(cr, "Sans 11")
steps = 60.0:16.25:240
for py in steps
    @printf("%04.17f 1234567890\n", py)
    text(cr, 16.0, py, @sprintf("%04.17f", py))
end

restore(cr);
move_to(cr,0.0,12.0);
set_source_rgb(cr, 0,0,0);
show_text(cr, Libc.strftime(time()));
write_to_png(c, "pango_clip_MWE.png")"""

This behavior does not depend on font type or size.

This is on Windows with Julia 1.10.5

I have not test so far if reverting to the old Cairo_jll produces other issues...

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

No branches or pull requests

1 participant