locked
How to stop VS adding FontFamily="Global User Interface" to xaml controls when I click on a control?

    Question

  • Visual Studio keeps adding

    FontFamily="Global User Interface"

    when I click on to a XAML element in the XAML view for my Windows 8.1 app.

    For instance, if I am editing a style template for an App Bar button style... if I click on to a TextBlock, it will automatically add the FontFamily, and I won't notice until I run the app and realise the font has been changed, as it should be usning Segoe UI Symbol!

    It is very annoying.

    Does anyone know how to stop this from happening?


    Friday, July 18, 2014 10:45 AM

Answers

  • Hi B13ella,

    Thanks for your feedback, I believe it should be a issue and I found a similar post in the forum that describe almost same thing as you, adding the Global User Interface to the FontFamily without any user setting.

    http://social.msdn.microsoft.com/Forums/en-US/95073501-d7b0-41fe-b127-ebdcfb8ac3ab/visual-studio-2013-automatically-adding-fontfamily-attribute-to-textblock-elements?forum=winappswithcsharp

    I also found a blog post that meet the same thing: http://blog.galasoft.ch/posts/2013/12/blend-and-the-global-user-interface-font-mistery/ (it's from third party website, I'm not sure if it is a bug, but I know at least the author meet the same thing)

    Even I cannot reproduce it but I will still fire this as a bug report to seniors to see why it happens or if it is a bug. Anyway if you can delete the font-family or set one before it add automatically it could be a solution.

    --James

    ==

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.



    Thursday, July 24, 2014 8:59 AM
    Moderator

All replies

  • Hi B13ella,

    I am moving your thread into the Building Windows Store apps with C# or VB Forum for dedicated support. Thanks for your understanding.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, July 21, 2014 2:15 AM
  • Hi B13ella,

    Sorry I cannot reproduce the issue, I do the same thing as you did, create a AppBar button and modify its style, I click on the TextBlock, the font family is still a binding to 'FontFamily', which is pre-defined in the AppBarButton styles and templates.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, July 21, 2014 6:58 AM
    Moderator
  • Hi James,

    It doesn't do it every time. It is usually when I have been looking at another windows/programme, and then click back on to visual studio, and click on a textblock element. Then it will add it.

    It is hard to reproduce when trying. But it happens so often that I thought someone else out there must have experienced it too and know how to prevent it.

    Monday, July 21, 2014 11:30 AM
  • Oh, and when I say I click on to the textblock element, I mean click on the xaml view. I never use the design view.
    Monday, July 21, 2014 11:32 AM
  • Hi B13ella,

    I can see that the font of the TextBlock has been set to "Global User Interface" once I type <TextBlock /> into the xaml, did you mean this? I believe that the global user interface is the default system dialog font and TextBlock template does not contain any font setting so it inherit from system setting.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, July 22, 2014 6:29 AM
    Moderator
  • Hi James,

    Normally, TextBlocks are set to Segoe UI in the properties window.

    Normal TextBlock with Segoe UI FontFamily.

    But every now and again (not every time, but after working for about an hour this morning, it has just happened), I click into a TextBlock and it added the FontFamily.

    Visual Studio adds FontFamily=

    Tuesday, July 22, 2014 10:01 AM
  • It has just done it again!!!

    We have a custom font for some icons, which we reference the full path in the style. But it had put in FontFamily="OurCustomFontName" directly onto the TextBlock, and broke it, because it isn't the full path (/assets/fonts/OurCustomFontName.ttf#OurCustomFontName).

    So I did a search in the whole solution for FontFamily=" and found it had stuck our custom font (as well as the Global User Interface font), into other elements, such as a Usercontol header.

    mc:Ignorable="d"
    FontFamily="Global User Interface"
    d:DesignHeight="300"
    d:DesignWidth="400">

    And in a listview item!

    It just seems random. It doesn't do it all of the time. And I don't remember it ever doing it when we worked on Windows 8 applications. This seems to be since we have worked on Windows 8.1, which was Visual Studio 2013.

    Tuesday, July 22, 2014 10:39 AM
  • Hi B13ella,

    Thanks for your feedback, I believe it should be a issue and I found a similar post in the forum that describe almost same thing as you, adding the Global User Interface to the FontFamily without any user setting.

    http://social.msdn.microsoft.com/Forums/en-US/95073501-d7b0-41fe-b127-ebdcfb8ac3ab/visual-studio-2013-automatically-adding-fontfamily-attribute-to-textblock-elements?forum=winappswithcsharp

    I also found a blog post that meet the same thing: http://blog.galasoft.ch/posts/2013/12/blend-and-the-global-user-interface-font-mistery/ (it's from third party website, I'm not sure if it is a bug, but I know at least the author meet the same thing)

    Even I cannot reproduce it but I will still fire this as a bug report to seniors to see why it happens or if it is a bug. Anyway if you can delete the font-family or set one before it add automatically it could be a solution.

    --James

    ==

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.



    Thursday, July 24, 2014 8:59 AM
    Moderator
  • Hi Jamles,

    Are you aware of status of this bug? It's pretty annoying and happening to me in VS 2015 Preview as well :(

    Friday, January 02, 2015 12:36 PM