} while (true);
if (action == PLY_LOAD_GLYPH_ACTION_MEASURE) {
- if (!is_first_character)
+ if (!is_first_character) {
+ char *text = NULL;
+
finish_measuring_line (label, &glyph_x, &glyph_y, line_dimensions);
+ if (ply_is_tracing ()) {
+ if (label->rich_text != NULL)
+ text = ply_rich_text_get_string (label->rich_text, &label->span);
+
+ ply_trace ("Text '%s' has dimensions %ldx%ld", text?: label->text,
+ line_dimensions->width,
+ line_dimensions->height);
+
+ free (text);
+ }
+ }
+
align_lines (label);
}
}
#include <cairo.h>
#include <pango/pangocairo.h>
+#include "ply-logger.h"
#include "ply-terminal.h"
#include "ply-pixel-buffer.h"
#include "ply-pixel-display.h"
pango_layout_get_pixel_size (pango_layout, &text_width, &text_height);
}
+ ply_trace ("Text '%s' has dimensions %dx%d", label->text, text_width, text_height);
+
label->area.width = text_width;
label->area.height = text_height;