LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File petitboot-multiple-font-sizes.patch of Package petitboot (Project DISCONTINUED:openSUSE:11.1)

---
 src/petitboot-gui.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

--- a/src/petitboot-gui.c
+++ b/src/petitboot-gui.c
@@ -64,7 +64,9 @@ static twin_screen_t *pboot_screen;
 #define PBOOT_RIGHT_OPTION_HEIGHT	(64 * PBOOT_SCALE)
 #define PBOOT_RIGHT_OPTION_STRIDE	(100 * PBOOT_SCALE)
 #define PBOOT_RIGHT_TITLE_TEXT_SIZE	(30 * PBOOT_SCALE * TWIN_FIXED_ONE)
-#define PBOOT_RIGHT_SUBTITLE_TEXT_SIZE	(18 * PBOOT_SCALE * TWIN_FIXED_ONE)
+#define PBOOT_RIGHT_SUB_TEXT_SIZE_L	(18 * TWIN_FIXED_ONE)
+#define PBOOT_RIGHT_SUB_TEXT_SIZE_M	(15 * TWIN_FIXED_ONE)
+#define PBOOT_RIGHT_SUB_TEXT_SIZE_S	(13 * TWIN_FIXED_ONE)
 #define PBOOT_RIGHT_TITLE_XOFFSET	(80 * PBOOT_SCALE)
 #define PBOOT_RIGHT_TITLE_YOFFSET	(30 * PBOOT_SCALE)
 #define PBOOT_RIGHT_SUBTITLE_XOFFSET	(100 * PBOOT_SCALE)
@@ -572,7 +574,14 @@ static void pboot_draw_option_cache(pboo
 	twin_path_empty (path);
 
 	if (opt->subtitle) {
-		twin_path_set_font_size(path, PBOOT_RIGHT_SUBTITLE_TEXT_SIZE);
+		int sub_length;
+		sub_length = strlen(opt->subtitle);
+		if (sub_length < 80)
+			twin_path_set_font_size(path, PBOOT_RIGHT_SUB_TEXT_SIZE_L);
+		else if (sub_length < 100)
+			twin_path_set_font_size(path, PBOOT_RIGHT_SUB_TEXT_SIZE_M);
+		else
+			twin_path_set_font_size(path, PBOOT_RIGHT_SUB_TEXT_SIZE_S);
 		twin_path_set_font_style(path, TWIN_TEXT_UNHINTED);
 		tx = twin_int_to_fixed(PBOOT_RIGHT_SUBTITLE_XOFFSET);
 		ty = twin_int_to_fixed(PBOOT_RIGHT_SUBTITLE_YOFFSET);