Regression in pango_cairo_layout_path() when text contains space
There is a regression in pango_cairo_layout_path() where it fails if text contains a space character.
We get the problem using Pango 1.42.4, while it works without any problem using Pango 1.42.1
This is an example:
#include <cairo/cairo.h>
#include <pango/pango.h>
#include <pango/pangocairo.h>
int main(int argc, char **argv) {
cairo_surface_t *surface;
cairo_t *cr;
PangoLayout *layout;
/* create surface */
surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, 200, 200);
cr = cairo_create(surface);
/* clear to all white background */
cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); /* white */
cairo_paint(cr);
/* create a simple pango layout */
layout = pango_cairo_create_layout(cr);
pango_layout_set_text(layout, "test string", -1);
/* create path from text outline */
pango_cairo_layout_path(cr, layout);
/* stroke path */
cairo_set_source_rgb(cr, 0.0, 0.0, 0.0); /* black */
cairo_stroke(cr);
/* output to a png file */
cairo_surface_write_to_png (surface, "output.png");
g_object_unref(layout);
cairo_destroy(cr);
cairo_surface_destroy(surface);
return 0;
}
The output is just a blank surface, without any text. If we change "test string" to "teststring" we get the text
OS: Win10 Pango built from MSYS2