From 898716f600302dc9af8fcaad8cea91543c2344ba Mon Sep 17 00:00:00 2001 From: nillerusr Date: Sun, 19 Jun 2022 15:17:06 +0300 Subject: [PATCH] game/client: make font size proportional --- game/client/hud_closecaption.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/game/client/hud_closecaption.cpp b/game/client/hud_closecaption.cpp index 0e25341b..b7847011 100644 --- a/game/client/hud_closecaption.cpp +++ b/game/client/hud_closecaption.cpp @@ -820,6 +820,8 @@ CHudCloseCaption::CHudCloseCaption( const char *pElementName ) vgui::Panel *pParent = g_pClientMode->GetViewport(); SetParent( pParent ); + SetProportional( true ); + m_nGoalHeight = 0; m_nCurrentHeight = 0; m_flGoalAlpha = 1.0f; @@ -1575,17 +1577,17 @@ void CHudCloseCaption::CreateFonts( void ) { vgui::IScheme *pScheme = vgui::scheme()->GetIScheme( GetScheme() ); - m_hFonts[CCFONT_NORMAL] = pScheme->GetFont( "CloseCaption_Normal" ); + m_hFonts[CCFONT_NORMAL] = pScheme->GetFont( "CloseCaption_Normal", true ); if ( IsPC() ) { - m_hFonts[CCFONT_BOLD] = pScheme->GetFont( "CloseCaption_Bold" ); - m_hFonts[CCFONT_ITALIC] = pScheme->GetFont( "CloseCaption_Italic" ); - m_hFonts[CCFONT_ITALICBOLD] = pScheme->GetFont( "CloseCaption_BoldItalic" ); + m_hFonts[CCFONT_BOLD] = pScheme->GetFont( "CloseCaption_Bold", true ); + m_hFonts[CCFONT_ITALIC] = pScheme->GetFont( "CloseCaption_Italic", true ); + m_hFonts[CCFONT_ITALICBOLD] = pScheme->GetFont( "CloseCaption_BoldItalic", true ); } else { - m_hFonts[CCFONT_SMALL] = pScheme->GetFont( "CloseCaption_Small" ); + m_hFonts[CCFONT_SMALL] = pScheme->GetFont( "CloseCaption_Small", true ); } m_nLineHeight = MAX( 6, vgui::surface()->GetFontTall( m_hFonts[ CCFONT_NORMAL ] ) );