We have a WPF application in which we used the Roboto font, but when a user enters a hyphen (-) in a text field, it appears as a field. It is also reflected in all windows.
Please find an example code where the problem also exists:
MainWindow.xaml
<Grid>
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label FontFamily="{StaticResource RobotoLight}">Incident-Title:</Label>
<TextBox FontFamily="{StaticResource RobotoMedium}" Grid.Column="1" Margin="0,0,0,10" />
<Label FontFamily="{StaticResource RobotoNormal}" Grid.Row="1">Email-ID:</Label>
<TextBox Grid.Row="1" FontFamily="Arial" Grid.Column="1" Margin="0,0,0,10" />
<Label FontFamily="Agency FB" Grid.Row="2">Feedback:</Label>
<TextBox FontFamily="BELL MT" Grid.Row="2" Grid.Column="1" AcceptsReturn="True" />
</Grid>
</Grid>
App.xaml
<Application.Resources>
<FontFamily x:Key="RobotoNormal">pack://application:,,,/Fonts/#Roboto Normal</FontFamily>
<FontFamily x:Key="RobotoLight">pack://application:,,,/Fonts/#Roboto Light</FontFamily>
<FontFamily x:Key="RobotoMedium">pack://application:,,,/Fonts#Roboto Medium</FontFamily>
</Application.Resources>
If I print - in the first text field it is displayed as a field.
Note: The problem only occurs on a Windows computer that has Windows 7.
We found that the Roboto font is not installed on the computer, but problems occur even after manually installing the fonts.
The hyphen character works fine in Google Chrome and a text application on the same user machine.
source
share