File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -518,6 +518,7 @@ solves no longer exists, it will likely be removed in the future.
518518
519519 Set the height in pixels for a line of text with the font. When rendering
520520 multiple lines of text this refers to the amount of space between lines.
521+ The value must be non-negative.
521522
522523 .. versionadded :: 2.5.4
523524
Original file line number Diff line number Diff line change 2929#define DOC_FONT_FONT_METRICS "metrics(text, /) -> list\ngets the metrics for each character in the passed string"
3030#define DOC_FONT_FONT_GETITALIC "get_italic() -> bool\ncheck if the text will be rendered italic"
3131#define DOC_FONT_FONT_GETLINESIZE "get_linesize() -> int\nget the line space of the font text"
32- #define DOC_FONT_FONT_SETLINESIZE "set_linesize(linesize) -> int \nset the line space of the font text"
32+ #define DOC_FONT_FONT_SETLINESIZE "set_linesize(linesize) -> None \nset the line space of the font text"
3333#define DOC_FONT_FONT_GETHEIGHT "get_height() -> int\nget the height of the font"
34- #define DOC_FONT_FONT_SETPOINTSIZE "set_point_size(size, /) -> int \nset the point size of the font"
34+ #define DOC_FONT_FONT_SETPOINTSIZE "set_point_size(size, /) -> None \nset the point size of the font"
3535#define DOC_FONT_FONT_GETPOINTSIZE "get_point_size() -> int\nget the point size of the font"
3636#define DOC_FONT_FONT_GETASCENT "get_ascent() -> int\nget the ascent of the font"
3737#define DOC_FONT_FONT_GETDESCENT "get_descent() -> int\nget the descent of the font"
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
2- import sys
3- import os
42import io
5- import unittest
3+ import os
64import pathlib
75import platform
6+ import sys
7+ import unittest
88
99import pygame
1010from pygame import font as pygame_font # So font can be replaced with ftfont
@@ -409,6 +409,10 @@ def test_set_linesize(self):
409409 # check invalid linesize
410410 with self .assertRaises (ValueError ):
411411 f .set_linesize (- 1 )
412+ with self .assertRaises (OverflowError ):
413+ f .set_linesize (2 ** 100 )
414+ with self .assertRaises (TypeError ):
415+ f .set_linesize (12.0 )
412416
413417 def test_metrics (self ):
414418 # Ensure bytes decoding works correctly. Can only compare results
You can’t perform that action at this time.
0 commit comments