@@ -48,6 +48,8 @@ internal sealed class DevConsoleMono : MonoBehaviour
4848 private const float MaxConsoleWidth = 1200 ;
4949 private const float MinConsoleHeight = 200 ;
5050 private const float MaxConsoleHeight = 900 ;
51+ private const int MinLogTextSize = 14 ;
52+ private const int MaxLogTextSize = 35 ;
5153 private const int CommandHistoryLength = 10 ;
5254 private const int MaxCachedEnumTypes = 6 ;
5355 private const float FpsUpdateRate = 4f ;
@@ -140,6 +142,7 @@ internal sealed class DevConsoleMono : MonoBehaviour
140142 private string _logTextStore = "" ;
141143 private readonly TextGenerator _textGenerator = new TextGenerator ( ) ;
142144 private int _vertexCount = 0 ;
145+ private int _initLogTextSize = 0 ;
143146
144147 #endregion
145148
@@ -626,6 +629,7 @@ private void Awake()
626629 _initPosition = _dynamicTransform . anchoredPosition ;
627630 _initSize = _dynamicTransform . sizeDelta ;
628631 _initLogFieldWidth = _logFieldPrefab . GetComponent < RectTransform > ( ) . sizeDelta . x ;
632+ _initLogTextSize = _logFieldPrefab . GetComponent < InputField > ( ) . textComponent . fontSize ;
629633 _currentLogFieldWidth = _initLogFieldWidth ;
630634 _resizeButtonColour = _resizeButtonImage . color ;
631635 _logFieldPrefab . SetActive ( false ) ;
@@ -1137,6 +1141,29 @@ private void InitBuiltInCommands()
11371141 }
11381142 ) ) ;
11391143
1144+ AddCommand ( Command . Create < int > (
1145+ "log_size" ,
1146+ "" ,
1147+ "Query or set the font size used in the developer console log" ,
1148+ Parameter . Create ( "fontSize" , "" ) ,
1149+ fontSize =>
1150+ {
1151+ if ( fontSize < MinLogTextSize || fontSize > MaxLogTextSize )
1152+ {
1153+ LogError ( $ "Invalid font size specified: { fontSize } . Must be between { MinLogTextSize } and { MaxLogTextSize } .") ;
1154+ return ;
1155+ }
1156+
1157+ Text text = _logFieldPrefab . GetComponent < InputField > ( ) . textComponent ;
1158+ int oldTextSize = text . fontSize ;
1159+ text . fontSize = fontSize ;
1160+ _logFields . ForEach ( x => x . textComponent . fontSize = fontSize ) ;
1161+ RefreshLogFieldsSize ( ) ;
1162+ LogSuccess ( $ "Successfully changed the log font size to { fontSize } (was { oldTextSize } ).") ;
1163+ } ,
1164+ ( ) => LogVariable ( "Log font size" , _logFields . First ( ) . textComponent . fontSize , $ " (Default: { _initLogTextSize } )")
1165+ ) ) ;
1166+
11401167 #endregion
11411168
11421169 #region Player commands
0 commit comments