Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting FontFamily of a TextBox (linux) #9

Open
sarosigy opened this issue Dec 12, 2024 · 1 comment
Open

Setting FontFamily of a TextBox (linux) #9

sarosigy opened this issue Dec 12, 2024 · 1 comment

Comments

@sarosigy
Copy link

Current behavior

When trying to change the FontFamily of a TextBox in Hot Design, the font used to display the text in the TextBox is not updated (but the XAML source is).
The XAML looks like this after the Hot Desing update (I am not really sure that it is fine, because even a restart won't affect the font of the TextBox):

        <TextBox FontFamily="Uno.Fonts.OpenSans/Fonts/OpenSans_Condensed-Regular.ttf" AutomationProperties.AutomationId="HelloTextBlock"
          Text="Hello Uno Platform!"
          HorizontalAlignment="Center" />

And an error is displayed in the Debug Console when selecting one of the font names displayed in the Combobox of the Font Family in Hot Design:

fail: Microsoft.UI.Xaml.UIElement[0]
      Failed to raise 'PointerReleasedEvent': System.ArgumentException: baseValue (Parameter 'SelectedIndex cannot be set to invalid value when items are present')
         at Microsoft.UI.Xaml.Controls.Primitives.Selector.CoerceSelectedIndex(DependencyObject dependencyObject, Object baseValue, DependencyPropertyValuePrecedences _) in /__w/1/s/src/Uno.UI/UI/Xaml/Controls/Primitives/Selector.cs:line 320
         at Microsoft.UI.Xaml.DependencyObjectStore.InnerSetValue(DependencyProperty property, Object value, DependencyPropertyValuePrecedences precedence, DependencyPropertyDetails propertyDetails, Boolean isPersistentResourceBinding) in /__w/1/s/src/Uno.UI/UI/Xaml/DependencyObjectStore.cs:line 532
         at Microsoft.UI.Xaml.Controls.Primitives.Selector.set_SelectedIndex(Int32 value) in /__w/1/s/src/Uno.UI/UI/Xaml/Controls/Primitives/Selector.cs:line 285
         at Microsoft.UI.Xaml.Controls.ListViewBase.<OnItemClicked>g__SingleSelectionCase|130_0(<>c__DisplayClass130_0&) in /__w/1/s/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ListViewBase.cs:line 626
         at Microsoft.UI.Xaml.Controls.ListViewBase.OnItemClicked(Int32 clickedIndex, VirtualKeyModifiers modifiers) in /__w/1/s/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ListViewBase.cs:line 598
         at Microsoft.UI.Xaml.Controls.Primitives.Selector.OnItemClicked(SelectorItem selectorItem, VirtualKeyModifiers modifiers) in /__w/1/s/src/Uno.UI/UI/Xaml/Controls/Primitives/Selector.cs:line 666
         at Microsoft.UI.Xaml.Controls.Primitives.SelectorItem.OnPointerReleasedPrivate(PointerRoutedEventArgs args) in /__w/1/s/src/Uno.UI/UI/Xaml/Controls/Primitives/SelectorItem.cs:line 394
         at Microsoft.UI.Xaml.Controls.Primitives.SelectorItem.<>c.<.cctor>b__60_1(Object snd, PointerRoutedEventArgs e) in /__w/1/s/src/Uno.UI/UI/Xaml/Controls/Primitives/SelectorItem.cs:line 346
         at Microsoft.UI.Xaml.UIElement.InvokeHandler(Object handler, RoutedEventArgs args) in /__w/1/s/src/Uno.UI/UI/Xaml/UIElement.RoutedEvents.cs:line 983
         at Microsoft.UI.Xaml.UIElement.InvokeHandlers(IList`1 handlers, RoutedEventArgs args, Boolean& isHandled) in /__w/1/s/src/Uno.UI/UI/Xaml/UIElement.RoutedEvents.cs:line 949
         at Microsoft.UI.Xaml.UIElement.RaiseEvent(RoutedEvent routedEvent, RoutedEventArgs args, BubblingContext ctx) in /__w/1/s/src/Uno.UI/UI/Xaml/UIElement.RoutedEvents.cs:line 643
         at Microsoft.UI.Xaml.UIElement.RaiseOnParent(RoutedEvent routedEvent, RoutedEventArgs args, UIElement parent, BubblingContext ctx) in /__w/1/s/src/Uno.UI/UI/Xaml/UIElement.RoutedEvents.cs:line 773
         at Microsoft.UI.Xaml.UIElement.RaiseEvent(RoutedEvent routedEvent, RoutedEventArgs args, BubblingContext ctx) in /__w/1/s/src/Uno.UI/UI/Xaml/UIElement.RoutedEvents.cs:line 704
         at Microsoft.UI.Xaml.UIElement.RaisePointerEvent(RoutedEvent evt, PointerRoutedEventArgs args, BubblingContext ctx) in /__w/1/s/src/Uno.UI/UI/Xaml/UIElement.Pointers.cs:line 1213

Expected behavior

The font of the TextBox should be updated.

How to reproduce it (as minimally and precisely as possible)

  1. Place a TextBox somewhere
  2. Try to change the FontFamily property in Hot Design.

Workaround

Set the FontFamily in source.

Which tool(s) are affected?

Hot Design™

Affected platforms

Desktop (Skia)

Uno.Sdk version

5.5.54

IDE used

No response

IDE version

1.96.0

Uno Platform Extension version

0.18.5

Relevant plugins

No response

Anything else we need to know?

No response

@sarosigy sarosigy added difficulty/tbd kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Dec 12, 2024
@nickrandolph
Copy link

@sarosigy thanks for raising this, we'll investigate this

@nickrandolph nickrandolph removed the triage/untriaged Indicates an issue requires triaging or verification. label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants