Crash when calling Pango.Layout.get_pixel_size() with a badly init:ed Pango.Layout
When trying to initialize a Pango.Layout by using the new operator, it gives a segfault when trying calculate the dimensions.
#!/usr/bin/env -S gjs -m
import Pango from 'gi://Pango';
const ctx = new Pango.Context();
const layout = new Pango.Layout(ctx);
const [w, h] = layout.get_pixel_size();
log(`w: ${w}, h: ${h}`);
Changing to call static .new() on Pango.Layout, like so:
#!/usr/bin/env -S gjs -m
import Pango from 'gi://Pango';
const ctx = new Pango.Context();
const layout = Pango.Layout.new(ctx);
const [w, h] = layout.get_pixel_size();
log(`w: ${w}, h: ${h}`);
works.