Repository: MyreMylar/pygame_gui (python)

Issue:
Decreasing Line Spacing Leads to Cut Off Text
**Describe the bug**
Upon decreasing the line spacing of a text box via the theming, I noticed that the bottoms of letters were being cut off (g, y, j, ect.)  This occurs even if there is only one line of text.  This behavior stopped when I returned line spacing to the default.  This wasn't an issue prior to 0.6.10.

**To Reproduce**
Steps to reproduce the behaviour:
1. Create a text theme with decreased line spacing (I specifically use .95)
2. Create a text box using that themeing and display text that includes tailed letters (g, y, j, ect.)  I'm unsure how this displays using other fonts, the font I was using was notosans.

**Expected behaviour**
I would expect line spacing not to cause a text cutoff.  

**Screenshots**
>![image](https://github.com/MyreMylar/pygame_gui/assets/115410010/87f6575e-1420-44ee-87c6-74e92c64de86)
>With .95 line spacing

>![image](https://github.com/MyreMylar/pygame_gui/assets/115410010/2788a254-9235-461a-b7fc-9a8eab86df7e)
>After removing line spacing

The difference is most obvious in the "g"

**Platform and software (please complete the following information):**
 - OS: Windows
 - Pygame GUI version 0.6.10
 - Pygame-ce version 2.4.1


Pull request:
Fix line spacing issues
fixes #588 

Patch:
diff --git a/pygame_gui/core/text/horiz_rule_layout_rect.py b/pygame_gui/core/text/horiz_rule_layout_rect.py
index 107b894..88f850b 100644
--- a/pygame_gui/core/text/horiz_rule_layout_rect.py
+++ b/pygame_gui/core/text/horiz_rule_layout_rect.py
@@ -55,6 +55,7 @@ class HorizRuleLayoutRect(TextLayoutRect):
                  row_chunk_origin: int,
                  row_chunk_height: int,
                  row_bg_height: int,
+                 row_line_spacing_height: int,
                  x_scroll_offset: int = 0,
                  letter_end: Optional[int] = None):
 
diff --git a/pygame_gui/core/text/image_layout_rect.py b/pygame_gui/core/text/image_layout_rect.py
index 3d9e63f..d6170a8 100644
--- a/pygame_gui/core/text/image_layout_rect.py
+++ b/pygame_gui/core/text/image_layout_rect.py
@@ -27,6 +27,7 @@ class ImageLayoutRect(TextLayoutRect):
                  row_chunk_origin: int,
                  row_chunk_height: int,
                  row_bg_height: int,
+                 row_line_spacing_height: int,
                  x_scroll_offset: int = 0,
                  letter_end: Optional[int] = None):
         blit_rect = self.copy()
diff --git a/pygame_gui/core/text/line_break_layout_rect.py b/pygame_gui/core/text/line_break_layout_rect.py
index c540400..4d94b22 100644
--- a/pygame_gui/core/text/line_break_layout_rect.py
+++ b/pygame_gui/core/text/line_break_layout_rect.py
@@ -33,10 +33,12 @@ class LineBreakLayoutRect(TextLayoutRect):
                  row_chunk_origin: int,
                  row_chunk_height: int,
                  row_bg_height: int,
+                 row_line_spacing_height: int,
                  x_scroll_offset: int = 0,
                  letter_end: Optional[int] = None):
+        self.height = row_bg_height
         if self.is_selected:
-            self.select_surf = Surface((self.selection_chunk_width, row_bg_height), flags=pygame.SRCALPHA)
+            self.select_surf = Surface((self.selection_chunk_width, self.height), flags=pygame.SRCALPHA)
             self.select_surf.fill(self.selection_colour)
             target_surface.blit(self.select_surf, self.topleft, special_flags=pygame.BLEND_PREMULTIPLIED)
         # should be cleared by row
diff --git a/pygame_gui/core/text/text_box_layout.py b/pygame_gui/core/text/text_box_layout.py
index ee09cae..61f60ec 100644
--- a/pygame_gui/core/text/text_box_layout.py
+++ b/pygame_gui/core/text/text_box_layout.py
@@ -193,7 +193,10 @@ class TextBoxLayout:
         if current_row.bottom - self.layout_rect.y > self.layout_rect.height:
             self.layout_rect.height = current_row.bottom - self.layout_rect.y
         self._refresh_row_letter_counts()
-        self.last_row_height = current_row.height
+        if len(current_row.items) != 0:
+            self.last_row_height = current_row.items[-1].height
+        else:
+            self.last_row_height = current_row.height
 
     def _handle_regular_rect(self, current_row, text_layout_rect, input_queue):
         rhs_limit = self.layout_rect.right
@@ -292,7 +295,7 @@ class TextBoxLayout:
             self._add_row_to_layout(current_row)
             # ...and start new one
             current_row = TextBoxLayoutRow(row_start_x=self.layout_rect.x,
-                                           row_start_y=current_row.bottom,
+                                           row_start_y=current_row.top + current_row.line_spacing_height,
                                            row_index=len(self.layout_rows),
                                            layout=self, line_spacing=self.line_spacing)
             current_row.fall_back_font = prev_row_font
@@ -306,7 +309,7 @@ class TextBoxLayout:
         self._add_row_to_layout(current_row)
         # ...then start a new row
         current_row = TextBoxLayoutRow(row_start_x=self.layout_rect.x,
-                                       row_start_y=current_row.bottom,
+                                       row_start_y=current_row.top + current_row.line_spacing_height,
                                        row_index=len(self.layout_rows),
                                        layout=self, line_spacing=self.line_spacing)
         current_row.fall_back_font = prev_row_font
@@ -320,7 +323,7 @@ class TextBoxLayout:
 
         # ...then start a new row
         new_row = TextBoxLayoutRow(row_start_x=self.layout_rect.x,
-                                   row_start_y=current_row.bottom,
+                                   row_start_y=current_row.top + current_row.line_spacing_height,
                                    row_index=len(self.layout_rows),
                                    layout=self, line_spacing=self.line_spacing)
         new_row.fall_back_font = prev_row_font
@@ -373,7 +376,7 @@ class TextBoxLayout:
                                        layout=self, line_spacing=self.line_spacing)
         else:
             new_row = TextBoxLayoutRow(row_start_x=self.layout_rect.x,
-                                       row_start_y=current_row.bottom,
+                                       row_start_y=current_row.top + current_row.line_spacing_height,
                                        row_index=len(self.layout_rows),
                                        layout=self, line_spacing=self.line_spacing)
         new_row.fall_back_font = prev_row_font
@@ -402,7 +405,8 @@ class TextBoxLayout:
                 # print("row height:", row.height)
 
         for floating_rect in self.floating_rects:
-            floating_rect.finalise(surface, self.view_rect, 0, 0, 0)
+            floating_rect.finalise(surface, self.view_rect,
+                                   0, 0, 0, 0)
 
         self.finalised_surface = surface
 
@@ -451,7 +455,7 @@ class TextBoxLayout:
                         if self.finalised_surface is not None:
                             rect.clear()
                             rect.finalise(self.finalised_surface, self.view_rect,
-                                          row.y_origin, row.text_chunk_height, row.height,
+                                          row.y_origin, row.text_chunk_height, row.height, row.line_spacing_height,
                                           self.x_scroll_offset,
                                           index_in_row - cumulative_row_letter_count)
 
@@ -585,7 +589,7 @@ class TextBoxLayout:
         for row in self.layout_rows:
             row.y = new_y
             row.vert_align_items_to_row()
-            new_y += row.height
+            new_y += row.line_spacing_height
 
     def vert_align_top_all_rows(self, y_padding):
         """
@@ -598,7 +602,7 @@ class TextBoxLayout:
         for row in self.layout_rows:
             row.y = new_y
             row.vert_align_items_to_row()
-            new_y += row.height
+            new_y += row.line_spacing_height
 
     def vert_align_bottom_all_rows(self, y_padding):
         """
@@ -611,7 +615,7 @@ class TextBoxLayout:
         for row in reversed(self.layout_rows):
             row.bottom = new_y
             row.vert_align_items_to_row()
-            new_y -= row.height
+            new_y -= row.line_spacing_height
 
     def set_cursor_to_end_of_current_row(self):
         """
diff --git a/pygame_gui/core/text/text_box_layout_row.py b/pygame_gui/core/text/text_box_layout_row.py
index 013a46e..47bfd3e 100644
--- a/pygame_gui/core/text/text_box_layout_row.py
+++ b/pygame_gui/core/text/text_box_layout_row.py
@@ -39,6 +39,7 @@ class TextBoxLayoutRow(pygame.Rect):
         # this one.
         self.fall_back_font = self.layout.default_font
         self.surf_row_dirty = False
+        self.line_spacing_height = 0
 
     def __hash__(self):
         return self.row_index
@@ -69,10 +70,12 @@ class TextBoxLayoutRow(pygame.Rect):
             self.text_chunk_height = item.row_chunk_height
             if self.layout.layout_rect.height != -1:
                 self.height = min(self.layout.layout_rect.height, # noqa pylint: disable=attribute-defined-outside-init; pylint getting confused
+                                  item.row_chunk_height)
+                self.line_spacing_height = min(self.layout.layout_rect.height, # noqa pylint: disable=attribute-defined-outside-init; pylint getting confused
                                   int(item.row_chunk_height * self.line_spacing))
             else:
-                self.height = int(item.row_chunk_height * self.line_spacing) # noqa pylint: disable=attribute-defined-outside-init; pylint getting confused
-
+                self.height = int(item.row_chunk_height) # noqa pylint: disable=attribute-defined-outside-init; pylint getting confused
+                self.line_spacing_height = int(item.row_chunk_height * self.line_spacing) # noqa pylint: disable=attribute-defined-outside-init; pylint getting confused
             self.cursor_rect = pygame.Rect(self.x, self.y, self.layout.edit_cursor_width, self.height - 2)
 
         if isinstance(item, TextLineChunkFTFont):
@@ -103,6 +106,7 @@ class TextBoxLayoutRow(pygame.Rect):
         self.width = 0  # pylint: disable=attribute-defined-outside-init; pylint getting confused
         self.height = 0  # pylint: disable=attribute-defined-outside-init; pylint getting confused
         self.text_chunk_height = 0
+        self.line_spacing_height = 0
         self.letter_count = 0
         self.y_origin = 0
 
@@ -264,17 +268,17 @@ class TextBoxLayoutRow(pygame.Rect):
                         if current_end_pos is not None and cumulative_letter_count is not None:
                             if cumulative_letter_count < current_end_pos:
                                 text_chunk.finalise(surface, chunk_view_rect, self.y_origin,
-                                                    self.text_chunk_height, self.height,
+                                                    self.text_chunk_height, self.height, self.line_spacing_height,
                                                     self.layout.x_scroll_offset,
                                                     current_end_pos - cumulative_letter_count)
                                 cumulative_letter_count += text_chunk.letter_count
                         else:
                             text_chunk.finalise(surface, chunk_view_rect, self.y_origin,
-                                                self.text_chunk_height, self.height,
+                                                self.text_chunk_height, self.height, self.line_spacing_height,
                                                 self.layout.x_scroll_offset)
                     else:
                         text_chunk.finalise(surface, chunk_view_rect, self.y_origin,
-                                            self.text_chunk_height, self.height,
+                                            self.text_chunk_height, self.height, self.line_spacing_height,
                                             self.layout.x_scroll_offset)
                 else:
                     print(self.items)
diff --git a/pygame_gui/core/text/text_layout_rect.py b/pygame_gui/core/text/text_layout_rect.py
index fa9e080..4b096aa 100644
--- a/pygame_gui/core/text/text_layout_rect.py
+++ b/pygame_gui/core/text/text_layout_rect.py
@@ -54,6 +54,7 @@ class TextLayoutRect(pygame.rect.Rect):
                  row_chunk_origin: int,
                  row_chunk_height: int,
                  row_bg_height: int,
+                 row_line_spacing_height: int,
                  x_scroll_offset: int = 0,
                  letter_end: Optional[int] = None):
         """
@@ -64,6 +65,7 @@ class TextLayoutRect(pygame.rect.Rect):
         :param row_chunk_origin:
         :param row_chunk_height:
         :param row_bg_height:
+        :param row_line_spacing_height:
         :param x_scroll_offset:
         :param letter_end:
         """
diff --git a/pygame_gui/core/text/text_line_chunk.py b/pygame_gui/core/text/text_line_chunk.py
index 19d7ef0..0b59ea2 100644
--- a/pygame_gui/core/text/text_line_chunk.py
+++ b/pygame_gui/core/text/text_line_chunk.py
@@ -72,6 +72,7 @@ class TextLineChunkFTFont(TextLayoutRect):
         self.row_chunk_origin = 0
         self.row_chunk_height = text_height
         self.row_bg_height = 0
+        self.row_line_spacing_height = 0
         self.layout_x_offset = 0
 
         self.selection_rect = None
@@ -167,6 +168,7 @@ class TextLineChunkFTFont(TextLayoutRect):
                  row_chunk_origin: int,
                  row_chunk_height: int,
                  row_bg_height: int,
+                 row_line_spacing_height: int,
                  x_scroll_offset: int = 0,
                  letter_end: Optional[int] = None):
         if len(self.text) == 0:
@@ -206,6 +208,7 @@ class TextLineChunkFTFont(TextLayoutRect):
         self.row_chunk_origin = row_chunk_origin
         self.row_chunk_height = row_chunk_height
         self.row_bg_height = row_bg_height
+        self.row_line_spacing_height = row_line_spacing_height
         self.layout_x_offset = x_scroll_offset
         self.letter_end = letter_end
 
@@ -650,6 +653,7 @@ class TextLineChunkFTFont(TextLayoutRect):
                           self.row_chunk_origin,
                           self.row_chunk_height,
                           self.row_bg_height,
+                          self.row_line_spacing_height,
                           self.layout_x_offset,
                           self.letter_end)
             if self.pre_effect_target_surface is not None:


Test patch:
diff --git a/pygame_gui/core/text/simple_test_layout_rect.py b/pygame_gui/core/text/simple_test_layout_rect.py
index c552882..1a877db 100644
--- a/pygame_gui/core/text/simple_test_layout_rect.py
+++ b/pygame_gui/core/text/simple_test_layout_rect.py
@@ -50,6 +50,7 @@ class SimpleTestLayoutRect(TextLayoutRect):
                  row_chunk_origin: int,
                  row_chunk_height: int,
                  row_bg_height: int,
+                 row_line_spacing_height: int,
                  x_scroll_offset: int = 0,
                  letter_end: Optional[int] = None):
         surface = Surface(self.size, depth=32, flags=pygame.SRCALPHA)
diff --git a/tests/test_core/test_text/test_horiz_rule_layout_rect.py b/tests/test_core/test_text/test_horiz_rule_layout_rect.py
index f69ede3..3101515 100644
--- a/tests/test_core/test_text/test_horiz_rule_layout_rect.py
+++ b/tests/test_core/test_text/test_horiz_rule_layout_rect.py
@@ -27,7 +27,8 @@ class TestHorizRuleLayoutRect:
                             target_area=pygame.Rect(0, 0, 200, 20),
                             row_chunk_origin=0,
                             row_chunk_height=20,
-                            row_bg_height=20)
+                            row_bg_height=20,
+                            row_line_spacing_height=20)
 
         assert rule_surface.get_at((10, 2)) == pygame.Color(0, 0, 0, 0)
         assert rule_surface.get_at((10, 10)) == pygame.Color(255, 255, 255, 255)
@@ -42,7 +43,8 @@ class TestHorizRuleLayoutRect:
                             target_area=pygame.Rect(0, 0, 200, 20),
                             row_chunk_origin=0,
                             row_chunk_height=20,
-                            row_bg_height=20)
+                            row_bg_height=20,
+                            row_line_spacing_height=20)
 
         horiz_rule = HorizRuleLayoutRect(height=20,
                                          colour_or_gradient=pygame.Color('#FFFFFF'),
@@ -55,7 +57,8 @@ class TestHorizRuleLayoutRect:
                             target_area=pygame.Rect(0, 0, 200, 20),
                             row_chunk_origin=0,
                             row_chunk_height=20,
-                            row_bg_height=20)
+                            row_bg_height=20,
+                            row_line_spacing_height=20)
 
 
 if __name__ == '__main__':
diff --git a/tests/test_core/test_text/test_hyperlink_text_chunk.py b/tests/test_core/test_text/test_hyperlink_text_chunk.py
index 7eb99c3..0b4553b 100644
--- a/tests/test_core/test_text/test_hyperlink_text_chunk.py
+++ b/tests/test_core/test_text/test_hyperlink_text_chunk.py
@@ -54,7 +54,8 @@ class TestHyperlinkTextChunk:
                              target_area=pygame.Rect(0, 0, 200, 30),
                              row_chunk_origin=19,
                              row_chunk_height=20,
-                             row_bg_height=20)
+                             row_bg_height=20,
+                             row_line_spacing_height=20)
 
         assert rendered_chunk_surf.get_at((2, 6)) == pygame.Color('#FF0000')
         hyper_chunk.on_hovered()
@@ -88,7 +89,8 @@ class TestHyperlinkTextChunk:
                              target_area=pygame.Rect(0, 0, 200, 30),
                              row_chunk_origin=19,
                              row_chunk_height=20,
-                             row_bg_height=20)
+                             row_bg_height=20,
+                             row_line_spacing_height=20)
 
         assert rendered_chunk_surf.get_at((2, 6)) == pygame.Color('#FF0000')
         hyper_chunk.on_hovered()
@@ -125,7 +127,8 @@ class TestHyperlinkTextChunk:
                              target_area=pygame.Rect(0, 0, 200, 30),
                              row_chunk_origin=19,
                              row_chunk_height=20,
-                             row_bg_height=20)
+                             row_bg_height=20,
+                             row_line_spacing_height=20)
 
         assert rendered_chunk_surf.get_at((2, 6)) == pygame.Color('#FF0000')
         hyper_chunk.set_active()
@@ -159,7 +162,8 @@ class TestHyperlinkTextChunk:
                              target_area=pygame.Rect(0, 0, 200, 30),
                              row_chunk_origin=19,
                              row_chunk_height=20,
-                             row_bg_height=20)
+                             row_bg_height=20,
+                             row_line_spacing_height=20)
 
         assert rendered_chunk_surf.get_at((2, 6)) == pygame.Color('#FF0000')
         hyper_chunk.set_active()
diff --git a/tests/test_core/test_text/test_line_break_layout_rect.py b/tests/test_core/test_text/test_line_break_layout_rect.py
index dbe1bcd..d55ce80 100644
--- a/tests/test_core/test_text/test_line_break_layout_rect.py
+++ b/tests/test_core/test_text/test_line_break_layout_rect.py
@@ -24,11 +24,12 @@ class TestLineBreakLayoutRect:
                                  target_area=pygame.Rect(0, 0, 200, 30),
                                  row_chunk_origin=0,
                                  row_chunk_height=20,
-                                 row_bg_height=20)
+                                 row_bg_height=20,
+                                 row_line_spacing_height=20)
 
         assert rendered_chunk_surf.get_at((1, 5)) == pygame.Color(0, 0, 0)
         assert line_break_rect.width == 200
-        assert line_break_rect.height == 30
+        assert line_break_rect.height == 20
 
 
 if __name__ == '__main__':
diff --git a/tests/test_core/test_text/test_simple_test_layout_rect.py b/tests/test_core/test_text/test_simple_test_layout_rect.py
index 35c3ea2..72c7f5b 100644
--- a/tests/test_core/test_text/test_simple_test_layout_rect.py
+++ b/tests/test_core/test_text/test_simple_test_layout_rect.py
@@ -31,7 +31,8 @@ class TestSimpleTestLayoutRect:
                              target_area=pygame.Rect(0, 0, 200, 30),
                              row_chunk_origin=0,
                              row_chunk_height=20,
-                             row_bg_height=20)
+                             row_bg_height=20,
+                             row_line_spacing_height=20)
 
         assert rendered_chunk_surf.get_at((1, 5)) != pygame.Color(0, 0, 0)
         assert simple_rect.width == 200
diff --git a/tests/test_core/test_text/test_text_box_layout_row.py b/tests/test_core/test_text/test_text_box_layout_row.py
index f41708a..9e1a443 100644
--- a/tests/test_core/test_text/test_text_box_layout_row.py
+++ b/tests/test_core/test_text/test_text_box_layout_row.py
@@ -3,6 +3,7 @@ from collections import deque
 import pytest
 import pygame
 
+from pygame_gui.core.gui_font_pygame import GUIFontPygame
 from pygame_gui.core.gui_font_freetype import GUIFontFreetype
 from pygame_gui.core.text import HTMLParser, TextBoxLayoutRow, TextBoxLayout, TextFloatPosition
 from pygame_gui.core.text import SimpleTestLayoutRect, TextLineChunkFTFont
@@ -56,7 +57,7 @@ class TestTextBoxLayoutRow:
 
     def test_add_item(self, _init_pygame, _display_surface_return_none, default_ui_manager: UIManager):
         input_data = deque([])
-        line_spacing = 1.25
+        line_spacing = 1.0
         default_font = default_ui_manager.get_theme().get_font_dictionary().get_default_font()
         default_font_data = {"font": default_font,
                              "font_colour": pygame.Color("#FFFFFF"),
@@ -79,7 +80,7 @@ class TestTextBoxLayoutRow:
         assert len(layout_row.items) == 1
         assert layout_row.width == simple_rect.width
         assert layout_row.text_chunk_height == simple_rect.height
-        assert layout_row.height == int(simple_rect.height * line_spacing)
+        assert layout_row.height == int(simple_rect.height)
 
     def test_rewind_row(self, _init_pygame, _display_surface_return_none, default_ui_manager: UIManager):
         input_data = deque([])
@@ -361,8 +362,8 @@ class TestTextBoxLayoutRow:
                                       line_spacing=line_spacing,
                                       layout=text_box_layout)
 
-        font_1 = GUIFontFreetype(None, 30)
-        font_2 = GUIFontFreetype(None, 20)
+        font_1 = GUIFontPygame(None, 30)
+        font_2 = GUIFontPygame(None, 20)
         text_chunk_1 = TextLineChunkFTFont(text='hello ',
                                            font=font_1,
                                            underlined=False,
@@ -389,7 +390,7 @@ class TestTextBoxLayoutRow:
         layout_surface.fill((0, 0, 0, 0))
         layout_row.finalise(layout_surface)
 
-        assert layout_surface.get_at((3, 3)) == pygame.Color(255, 0, 0, 255)
+        assert layout_surface.get_at((0, 0)) == pygame.Color(255, 0, 0, 255)
 
     def test_set_default_text_colour(self, _init_pygame, _display_surface_return_none, default_ui_manager: UIManager):
         input_data = deque([])
diff --git a/tests/test_core/test_text/test_text_line_chunk.py b/tests/test_core/test_text/test_text_line_chunk.py
index aaf97ad..57eaa87 100644
--- a/tests/test_core/test_text/test_text_line_chunk.py
+++ b/tests/test_core/test_text/test_text_line_chunk.py
@@ -99,7 +99,8 @@ class TestTextLineChunkFTFont:
                          pygame.Rect(0, 0, 200, 300),
                          chunk_1.y_origin,
                          chunk_1.height,
-                         chunk_1.height)
+                         chunk_1.height,
+                         chunk_1.row_line_spacing_height)
 
         assert layout_surface.get_at((10, 10)) == pygame.Color('#FF0000')
 
@@ -118,7 +119,8 @@ class TestTextLineChunkFTFont:
                          pygame.Rect(0, 0, 200, 300),
                          chunk_2.y_origin,
                          chunk_2.height,
-                         chunk_2.height)
+                         chunk_2.height,
+                         chunk_2.row_line_spacing_height)
 
         assert layout_surface_2.get_at((10, 10)) == pygame.Color('#FF0000')
 
@@ -139,7 +141,8 @@ class TestTextLineChunkFTFont:
                          pygame.Rect(0, 0, 200, 300),
                          chunk_3.y_origin,
                          chunk_3.height,
-                         chunk_3.height)
+                         chunk_3.height,
+                         chunk_3.row_line_spacing_height)
 
         assert layout_surface_3.get_at((10, 10)) != pygame.Color('#00000000')
 
@@ -158,7 +161,8 @@ class TestTextLineChunkFTFont:
                          pygame.Rect(0, 0, 200, 300),
                          chunk_4.y_origin,
                          chunk_4.height,
-                         chunk_4.height)
+                         chunk_4.height,
+                         chunk_4.row_line_spacing_height)
 
         assert layout_surface_4.get_at((10, 10)) != pygame.Color('#00000000')
 
@@ -231,7 +235,8 @@ class TestTextLineChunkFTFont:
                        pygame.Rect(0, 0, 200, 300),
                        chunk.y_origin,
                        chunk.height,
-                       chunk.height)
+                       chunk.height,
+                       chunk.row_line_spacing_height)
 
         assert layout_surface.get_at((10, 10)) == pygame.Color('#FF00FF')
 
@@ -466,7 +471,8 @@ class TestTextLineChunkFTFont:
                        pygame.Rect(0, 0, 200, 300),
                        chunk.y_origin,
                        chunk.height,
-                       chunk.height)
+                       chunk.height,
+                       chunk.row_line_spacing_height)
 
         assert layout_surface.get_at((10, 10)) == pygame.Color('#FF00FF')
 
@@ -493,7 +499,8 @@ class TestTextLineChunkFTFont:
                        pygame.Rect(0, 0, 200, 300),
                        chunk.y_origin,
                        chunk.height,
-                       chunk.height)
+                       chunk.height,
+                       chunk.row_line_spacing_height)
 
         chunk.grab_pre_effect_surface()
         chunk.set_alpha(128)
@@ -520,7 +527,8 @@ class TestTextLineChunkFTFont:
                        pygame.Rect(0, 0, 200, 300),
                        chunk.y_origin,
                        chunk.height,
-                       chunk.height)
+                       chunk.height,
+                       chunk.row_line_spacing_height)
         chunk.grab_pre_effect_surface()
         chunk.set_offset_pos((10, 10))
         chunk.redraw()
@@ -543,7 +551,8 @@ class TestTextLineChunkFTFont:
                        pygame.Rect(0, 0, 200, 300),
                        chunk.y_origin,
                        chunk.height,
-                       chunk.height)
+                       chunk.height,
+                       chunk.row_line_spacing_height)
         chunk.grab_pre_effect_surface()
         chunk.set_scale(2.0)
         chunk.redraw()
@@ -566,7 +575,8 @@ class TestTextLineChunkFTFont:
                        pygame.Rect(0, 0, 200, 300),
                        chunk.y_origin,
                        chunk.height,
-                       chunk.height)
+                       chunk.height,
+                       chunk.row_line_spacing_height)
         chunk.grab_pre_effect_surface()
         chunk.set_rotation(45)
         chunk.redraw()