scorninpc / php-gtk3

GTK3 extension for PHP
https://andor.com.br/
GNU Lesser General Public License v3.0
118 stars 13 forks source link

implement PangoLayout::get_line() #147

Closed d47081 closed 3 months ago

d47081 commented 3 months ago

https://docs.gtk.org/Pango/method.Layout.get_line.html

Implemented everything but GSList* runs; value in struct (currently not wanted for me) https://docs.gtk.org/Pango/struct.LayoutLine.html

<?php

// Initialize
Gtk::init();

// init some testing data
$layout = new PangoLayout(
    (new GtkDrawingArea)->create_pango_context()
);

$layout->set_text("test", 4);

// try out of line
var_dump(
    $layout->get_line(1) // return NULL - OK
);

// try existing line
$pangoLayoutLine = $layout->get_line(0);

var_dump(
    $pangoLayoutLine // test struct - OK
);

// test layout class init
var_dump(
    $pangoLayoutLine["layout"]->get_text() // OK
);