aboutsummaryrefslogtreecommitdiff
path: root/src/wrap.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-08-08 23:12:30 +0200
committerThomas White <taw@bitwiz.org.uk>2013-08-08 23:13:11 +0200
commitfa30860b75614b715e99b2da187a71022fa01cfc (patch)
treefcab71eae26f6ffbad704af33734acad7e211a48 /src/wrap.c
parentddd6ed1288b6ac4952f61b9f3cbc40c22381ec53 (diff)
Add show_boxes()
Diffstat (limited to 'src/wrap.c')
-rw-r--r--src/wrap.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/wrap.c b/src/wrap.c
index cfbc2ce..ec3d483 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -1067,6 +1067,25 @@ static struct wrap_line *split_paragraph(struct wrap_line *boxes, int *n)
}
+void show_boxes(struct wrap_line *boxes)
+{
+ int i;
+
+ if ( boxes == NULL ) {
+ printf("Empty line.\n");
+ return;
+ }
+
+ for ( i=0; i<boxes->n_boxes; i++ ) {
+ printf("%3i", i);
+ printf(" '%s'", boxes->boxes[i].text);
+ printf(" t=%i s=%i %i %5.2f\n",
+ boxes->boxes[i].type, boxes->boxes[i].space,
+ boxes->boxes[i].width, boxes->boxes[i].sp);
+ }
+}
+
+
/* Wrap the StoryCode inside "fr->sc" so that it fits within width "fr->w",
* and generate fr->lines */
int wrap_contents(struct frame *fr, PangoContext *pc)