Skip to content

gdImageStringFT() fails for empty strings as of libgd 2.3.0 #615

Description

@cmb69

When trying to render an empty string via gdImageStringFT(), the function fails as of libgd 2.3.0, while formerly it was just a no-op.

Test script

#include <stdio.h>
#include <gd.h>

int main()
{
    gdImagePtr im;
    int fg;
    int rect[8];
    char *res;

    im = gdImageCreate(100, 100);
    fg = gdImageColorAllocate(im, 255, 255, 255);
    res = gdImageStringFT(im, rect, fg, "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 12, 0, 10, 10, "");
    if (res) printf("%s\n", res);
    return 0;
}

Expected output

okay

Actual output

Problem doing text layout

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions