@@ -90,7 +90,7 @@ public SensorNotifyIcon(SystemTray sensorSystemTray, ISensor sensor,
9090 family = new FontFamily ( "Segoe UI" ) ;
9191 baseSize = 15 ;
9292 } else {
93- family = new FontFamily ( "Tahome" ) ; // SystemFonts.MessageBoxFont.FontFamily;
93+ family = SystemFonts . MessageBoxFont . FontFamily ;
9494 baseSize = 14 ;
9595 }
9696
@@ -209,16 +209,20 @@ private Icon CreateTransparentIcon() {
209209 graphics . Clear ( defaultBackColor ) ;
210210 }
211211
212+ var textShift = bitmap . Width / 8 - 1 ; //todo: tested for 16 & 32 only
212213 if ( small ) {
213214 if ( text [ 1 ] == '.' || text [ 1 ] == ',' ) {
214- TextRenderer . DrawText ( graphics , text . Substring ( 0 , 1 ) , font , new Point ( - 4 , - 2 ) , color , defaultBackColor ) ;
215- TextRenderer . DrawText ( graphics , text . Substring ( 1 ) , smallFont , new Point ( 8 , 4 ) , color , defaultBackColor ) ;
215+ var bigPart = text . Substring ( 0 , 1 ) ;
216+ var smallPart = text . Substring ( 1 ) ;
217+ TextRenderer . DrawText ( graphics , bigPart , font , new Point ( - 4 , - 2 ) , color , defaultBackColor ) ;
218+ TextRenderer . DrawText ( graphics , smallPart , smallFont , new Point ( 4 * textShift , 1 * textShift ) , color , defaultBackColor ) ;
219+ } else {
220+ TextRenderer . DrawText ( graphics , text , smallFont , new Point ( - 2 * textShift , 2 * textShift ) , color , defaultBackColor ) ;
216221 }
217- else
218- TextRenderer . DrawText ( graphics , text , smallFont , new Point ( - 4 , 1 ) , color , defaultBackColor ) ;
219222 }
220- else
221- TextRenderer . DrawText ( graphics , text , font , new Point ( - 4 , - 2 ) , color , defaultBackColor ) ;
223+ else {
224+ TextRenderer . DrawText ( graphics , text , font , new Point ( - 2 * textShift , - 1 * textShift ) , color , defaultBackColor ) ;
225+ }
222226
223227 var data = bitmap . LockBits (
224228 new Rectangle ( 0 , 0 , bitmap . Width , bitmap . Height ) ,
0 commit comments