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

CairoMakie: export text as a single multiple-glyph object, not multiple single-glyph objects #3862

Open
thchr opened this issue May 13, 2024 · 0 comments
Labels
CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. enhancement Feature requests and enhancements

Comments

@thchr
Copy link
Contributor

thchr commented May 13, 2024

When exporting vector-graphics plots containing text, the individual glyphs are each stored as a separate object, rather than having a single object for each piece of text. E.g., text("foo") will produce three text objects "f", "o", and "o", with their own locations etc., rather than a single object "foo". Example below (each red box is a separate object):
image

This is rather disruptive for workflows that edit the exported figure post-export, e.g., in Illustrator or Inkscape, because it becomes impossible to resize the text or change fonts without the kerning getting ruined.

I previously asked about this on Slack a while back, and got a the following nice answer from @jkrumbiegel:

currently that happens here

glyph_path(ctx, glyph, glyphpos...)

I assume one would have to draw multiple glyphs at once with https://www.cairographics.org/manual/cairo-text.html#cairo-show-text-glyphs

I had hoped to figure it out from those hints but haven't been able to grok it, so I'm just registering this here for posterity.
My understanding is that it requires replacing cairo_glyph_path with cairo_show_text_glyps, but that it also requires a different way of inputting the various text transformations.


(Related to #2015, but not the same issue)

@thchr thchr added the enhancement Feature requests and enhancements label May 13, 2024
@thchr thchr changed the title CairoMakie: export text as one many-letter object, not multiple single-letter objects CairoMakie: export text as one multiple-glyph object, not multiple single-glyph objects May 13, 2024
@thchr thchr changed the title CairoMakie: export text as one multiple-glyph object, not multiple single-glyph objects CairoMakie: export text as a single multiple-glyph object, not multiple single-glyph objects May 13, 2024
@t-bltg t-bltg added the CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. enhancement Feature requests and enhancements
Projects
None yet
Development

No branches or pull requests

2 participants