@@ -141,6 +141,9 @@ private static readonly System.Runtime.CompilerServices.ConditionalWeakTable<Tex
141141 private const string MonoFontFamilySource = "Cascadia Code, Cascadia Mono, Consolas" ;
142142 private static readonly System . Runtime . CompilerServices . ConditionalWeakTable <
143143 Microsoft . UI . Dispatching . DispatcherQueue , FontFamily > s_monoFontByDispatcher = new ( ) ;
144+ private const string ChatTextFontFamilySource = "Segoe UI Variable Text, Segoe UI" ;
145+ private static readonly System . Runtime . CompilerServices . ConditionalWeakTable <
146+ Microsoft . UI . Dispatching . DispatcherQueue , FontFamily > s_chatTextFontByDispatcher = new ( ) ;
144147 private static FontFamily s_monoFontFamily
145148 {
146149 get
@@ -158,6 +161,23 @@ private static FontFamily s_monoFontFamily
158161 return family ;
159162 }
160163 }
164+ private static FontFamily s_chatTextFontFamily
165+ {
166+ get
167+ {
168+ var dispatcher = Microsoft . UI . Dispatching . DispatcherQueue . GetForCurrentThread ( ) ;
169+ if ( dispatcher is null )
170+ {
171+ return new FontFamily ( ChatTextFontFamilySource ) ;
172+ }
173+ if ( ! s_chatTextFontByDispatcher . TryGetValue ( dispatcher , out var family ) )
174+ {
175+ family = new FontFamily ( ChatTextFontFamilySource ) ;
176+ s_chatTextFontByDispatcher . Add ( dispatcher , family ) ;
177+ }
178+ return family ;
179+ }
180+ }
161181
162182 // Per-DispatcherQueue selection-highlight brushes for the user
163183 // bubble. The bubble background is the user's chosen system accent
@@ -1117,6 +1137,14 @@ Element RenderUserEntry(ChatTimelineItem entry, bool startsBurst, bool endsBurst
11171137 t . FontSize = 14 ;
11181138 t . Foreground = userBubbleFg ;
11191139 t . IsTextSelectionEnabled = true ;
1140+ t . FontFamily = s_chatTextFontFamily ;
1141+ t . TextTrimming = TextTrimming . None ;
1142+ t . MaxLines = 0 ;
1143+ t . LineHeight = 0 ;
1144+ t . CharacterSpacing = 0 ;
1145+ t . Width = double . NaN ;
1146+ t . MinWidth = 0 ;
1147+ t . MaxWidth = double . PositiveInfinity ;
11201148 // The default SelectionHighlightColor is the
11211149 // system accent — which equals the user bubble's
11221150 // background — so the highlight band is invisible
0 commit comments