Scale the video subtitle font with the resolution used.
parent
37d5fba2bd
commit
b3c2fabf16
|
@ -232,6 +232,9 @@ void WzMainWindow::resizeGL(int width, int height)
|
|||
screenWidth = width;
|
||||
screenHeight = height;
|
||||
|
||||
scaledFont.setFamily("DejaVu Sans");
|
||||
scaledFont.setPixelSize(12 * height / 480);
|
||||
|
||||
glViewport(0, 0, width, height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
|
@ -293,6 +296,8 @@ void WzMainWindow::setFontType(enum iV_fonts fontID)
|
|||
case font_small:
|
||||
setFont(smallFont);
|
||||
break;
|
||||
case font_scaled:
|
||||
setFont(scaledFont);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ private:
|
|||
QCursor *cursors[CURSOR_MAX];
|
||||
QTimer *timer;
|
||||
QTime tickCount;
|
||||
QFont regularFont, boldFont, smallFont;
|
||||
QFont regularFont, boldFont, smallFont, scaledFont;
|
||||
bool notReadyToPaint; ///< HACK Don't draw during initial show(), since some global variables apparently aren't set up.
|
||||
static WzMainWindow *myself;
|
||||
|
||||
|
|
|
@ -26,9 +26,10 @@
|
|||
|
||||
enum iV_fonts
|
||||
{
|
||||
font_regular,
|
||||
font_large,
|
||||
font_regular,
|
||||
font_large,
|
||||
font_small,
|
||||
font_scaled,
|
||||
};
|
||||
|
||||
extern void iV_TextInit(void);
|
||||
|
|
|
@ -157,7 +157,7 @@ bool seq_RenderVideoToBuffer(const char* sequenceName, int seqCommand)
|
|||
{
|
||||
//start the ball rolling
|
||||
|
||||
iV_SetFont(font_regular);
|
||||
iV_SetFont(font_scaled);
|
||||
iV_SetTextColour(WZCOL_TEXT_BRIGHT);
|
||||
|
||||
/* We do *NOT* want to use the user-choosen resolution when we
|
||||
|
@ -246,7 +246,7 @@ static bool seq_StartFullScreenVideo(const char* videoName, const char* audioNam
|
|||
}
|
||||
|
||||
cdAudio_Pause();
|
||||
iV_SetFont(font_regular);
|
||||
iV_SetFont(font_scaled);
|
||||
iV_SetTextColour(WZCOL_TEXT_BRIGHT);
|
||||
|
||||
/* We do not want to enter loop_SetVideoPlaybackMode() when we are
|
||||
|
@ -260,7 +260,7 @@ static bool seq_StartFullScreenVideo(const char* videoName, const char* audioNam
|
|||
// check to see if we need to pause, and set font each time
|
||||
cdAudio_Pause();
|
||||
loop_SetVideoPlaybackMode();
|
||||
iV_SetFont(font_regular);
|
||||
iV_SetFont(font_scaled);
|
||||
iV_SetTextColour(WZCOL_TEXT_BRIGHT);
|
||||
}
|
||||
|
||||
|
@ -476,7 +476,7 @@ bool seq_AddTextForVideo(const char* pText, SDWORD xOffset, SDWORD yOffset, SDWO
|
|||
// make sure we take xOffset into account, we don't always start at 0
|
||||
const unsigned int BUFFER_WIDTH = pie_GetVideoBufferWidth() - xOffset;
|
||||
|
||||
iV_SetFont(font_regular);
|
||||
iV_SetFont(font_scaled);
|
||||
|
||||
ASSERT(aSeqList[currentSeq].currentText < MAX_TEXT_OVERLAYS, "too many text lines");
|
||||
|
||||
|
|
Loading…
Reference in New Issue