  {
      size_t i;
      const char * prev_character = NULL;
-@@ -220,7 +161,7 @@ text_buffer_add_text( text_buffer_t * se
+@@ -214,13 +156,13 @@ text_buffer_add_text( text_buffer_t * se
+         }
+         if (pen->y != self->last_pen_y)
+         {
+-            text_buffer_finish_line(self, pen, false);
++            text_buffer_finish_line(self, pen, false, markup->font->linegap);
+         }
+     }
  
      for( i = 0; length; i += utf8_surrogate_len( text + i ) )
      {

-//  advancePen: if true, advance the pen to the next line
-//
 static void
 text_buffer_finish_line( text_buffer_t * self, vec2 * pen, bool advancePen )
 {
@@ -166,7 +106,7 @@ text_buffer_finish_line( text_buffer_t *
     if ( advancePen )
     {
         pen->x = self->origin.x;
-        pen->y += (int)(self->line_descender);
+        pen->y += (self->line_descender);
     }
 
     self->line_descender = 0;
@@ -177,9 +117,10 @@ text_buffer_finish_line( text_buffer_t *
 
 // ----------------------------------------------------------------------------
 void

-    {
-        return;
-    }
 
-    size_t total_items = vector_size( self->buffer->items );
-    if ( self->line_start != total_items )
-    {
-        text_buffer_finish_line( self, pen, false );
+        pen->x += glyph_advance;
     }
-
-
-    size_t i, j;
