5

We have a WPF application in which we have used the Roboto font, but when the user is typing the hyphen(-) in the textbox it is displayed as the box.It is also reflected in all the windows.

Please find the sample code in which the issue 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 type - in the first text box, it is displayed like the box.

Note: The issue occurs only in the Windows machine which is having the Windows 7 os.

We have found that the Roboto font is not installed on the machine, but the issues occur even after installing the fonts manually also.

The hyphen character is working fine in the google chrome and word application on the same user machine.

Venkat
  • 2,549
  • 2
  • 28
  • 61
  • 2
    You got the latest version? I remember once a problem in general with windows 7/8 and the Roboto fonts – dsdel Apr 13 '18 at 05:01
  • @dsdel; Thanks for your comment. Could you please suggest how did you overcome the problem. – Venkat Apr 13 '18 at 05:15
  • 1
    Probably ensure that all Patches and Service Packs for Windows 7 are installed? – Uwe Keim Apr 13 '18 at 05:19
  • @UweKeim: We will try to check this point, Thank you. – Venkat Apr 13 '18 at 05:22
  • I have referred here , but I am not getting the solution: https://superuser.com/questions/371282/my-windows-7-has-suddenly-stopped-displaying-unicode-symbols – Venkat Apr 13 '18 at 05:50
  • 1
    @Downvoters: Please share us your concerns in the comment section so that I can improve the quality of the question or provide more details. – Venkat Apr 13 '18 at 06:34
  • 1
    @Verikat it was a problem with the font version. Downloaded a newer version of the font fixed the problem – dsdel Apr 13 '18 at 06:48
  • @dsdel: Thanks for the update, We will also check this case. – Venkat Apr 13 '18 at 07:08
  • 1
    I am getting the same issue - it happens on user's computer - he does not have "Roboto" installed but neither do I! And it's fine on mine. However, it seems to be falling back to "Segoe UI" (visual inspection - WPF inspector doesn't seem to give this information) - but we both have Segoe UI installed... – komodosp Oct 31 '18 at 09:27

0 Answers0