From 8dcde27e8e9370571394da264a90a5a2cef52ff3 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Sat, 30 Dec 2017 23:52:45 -0500 Subject: [PATCH] Italic and bold support for SDL (1 and 2), in WIDE mode (TTF) only. To Do: Performance tuning? --- sdl1/pdcdisp.c | 3 +++ sdl2/pdcdisp.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sdl1/pdcdisp.c b/sdl1/pdcdisp.c index f088d05a..26612bc2 100644 --- a/sdl1/pdcdisp.c +++ b/sdl1/pdcdisp.c @@ -363,6 +363,9 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp) #ifdef PDC_WIDE chstr[0] = ch & A_CHARTEXT; + + TTF_SetFontStyle(pdc_ttffont, (ch & A_BOLD ? TTF_STYLE_BOLD : 0) | + (ch & A_ITALIC ? TTF_STYLE_ITALIC : 0)); pdc_font = TTF_RenderUNICODE_Solid(pdc_ttffont, chstr, pdc_color[foregr]); diff --git a/sdl2/pdcdisp.c b/sdl2/pdcdisp.c index 955179c6..4ca1f1f8 100644 --- a/sdl2/pdcdisp.c +++ b/sdl2/pdcdisp.c @@ -364,6 +364,9 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp) #ifdef PDC_WIDE chstr[0] = ch & A_CHARTEXT; + + TTF_SetFontStyle(pdc_ttffont, (ch & A_BOLD ? TTF_STYLE_BOLD : 0) | + (ch & A_ITALIC ? TTF_STYLE_ITALIC : 0)); pdc_font = TTF_RenderUNICODE_Solid(pdc_ttffont, chstr, pdc_color[foregr]);