[justify] Debug output

This commit is contained in:
Behdad Esfahbod 2023-03-01 10:59:04 -07:00
parent b937edfb14
commit 93252c6fc3
2 changed files with 12 additions and 3 deletions

View File

@ -373,6 +373,10 @@ struct hb_no_trace_t {
#define HB_DEBUG_FT (HB_DEBUG+0)
#endif
#ifndef HB_DEBUG_JUSTIFY
#define HB_DEBUG_JUSTIFY (HB_DEBUG+0)
#endif
#ifndef HB_DEBUG_OBJECT
#define HB_DEBUG_OBJECT (HB_DEBUG+0)
#endif

View File

@ -26,6 +26,8 @@
* Google Author(s): Behdad Esfahbod
*/
#define HB_DEBUG_JUSTIFY 1
#include "hb.hh"
#include "hb-shaper.hh"
@ -345,11 +347,14 @@ hb_shape_justify (hb_font_t *font,
shaper_list)))
{
failed = true;
return min_target_width;
return (double) min_target_width;
}
printf ("%g\n", x);
return buffer_width (buffer);
double w = buffer_width (buffer);
DEBUG_MSG (JUSTIFY, nullptr, "Trying '%c%c%c%c' axis parameter %f. Width %g. Target: min %g max %g",
HB_UNTAG (tag), x, w,
(double) min_target_width, (double) max_target_width);
return w;
};
double y = 0;