added fallback to narrow font on word length for envelope request dialogs
[rocksndiamonds.git] / src / tools.c
index e56516a016ef5cd04e40b08d3a55ae966e9fc968..a3aa3c34a9cbe12bf06beeb3c58395e6ae420019 100644 (file)
@@ -3176,6 +3176,13 @@ static void DrawEnvelopeRequestText(int sx, int sy, char *text)
   {
     char *src_text_ptr, *dst_text_ptr;
 
+    if (maxWordLengthInRequestString(text) > line_length)
+    {
+      font_nr = FONT_REQUEST_NARROW;
+      font_width = getFontWidth(font_nr);
+      line_length = max_text_width  / font_width;
+    }
+
     text_door_style = checked_malloc(2 * strlen(text) + 1);
 
     src_text_ptr = text;