Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
P
pango
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 213
    • Issues 213
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 11
    • Merge Requests 11
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • pango
  • Issues
  • #323

Closed
Open
Opened Sep 30, 2018 by Luca Bacci@lb90

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

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/pango#323