Skip to content

Instantly share code, notes, and snippets.

@davenquinn
Last active June 1, 2016 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davenquinn/d2ba1ada38abcc313beb676d81bd6682 to your computer and use it in GitHub Desktop.
Save davenquinn/d2ba1ada38abcc313beb676d81bd6682 to your computer and use it in GitHub Desktop.

Bug in CairoSVG: text on path with spaces

May 18, 2016

Text on path with spaces causes an abort trap using cairosvg version 1.0.20 (current on PyPi) Replicated using cairo versions 1.14, 1.15, and current HEAD (e825f59) I'm uncertain if this is an upstream bug in cairo...

In cairo HEAD:

> cairosvg -o test.pdf test. svg
Assertion failed: (!scaled_font->cache_frozen), function _cairo_scaled_glyph_page_destroy, file cairo-scaled-font.c, line 459.
[1]    50892 abort      cairosvg -o test.pdf test.svg

yields the above error message and produces no output

cairosvg -o test-no-spaces.pdf test-no-spaces.svg works fine.

Bug in CairoSVG: text on path with spaces

May 18, 2016

Text on path with spaces causes an abort trap. Replicated in 1.14, 1.15, and current HEAD (e825f59) Probably an upstream bug in cairo?

In head version:

> cairosvg -o test.pdf test. svg
Assertion failed: (!scaled_font->cache_frozen), function _cairo_scaled_glyph_page_destroy, file cairo-scaled-font.c, line 459.
[1]    50892 abort      cairosvg -o test.pdf test.svg

yields the above error message and produces no output

cairosvg -o test-no-spaces.pdf test-no-spaces.svg works fine.

Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ErikOnBike
Copy link

Daven,

If you are on a Mac (OS X), I think I have found a fix. It is Cairo which does not handle 'empty' glyphs correctly (on OS X). The fix I applied is to prevent rendering of spaces. It is in the current CairoSVG version.

Also see comment at: Kozea/CairoSVG#99

Cheers,
Erik

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