Skip to content

Text is getting clipped on top with latest Cairo_jll #368

@mwlidar

Description

@mwlidar

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions