Tuesday, March 6, 2012

Windows 8 Icons: Segoe UI Symbol

Here's a quick and easy tip for developing Windows 8 applications from my book, Building Windows 8 Apps with C# and XAML. (Be sure to check out the updated Windows 8.1 book Programming the Windows Runtime by Example). Are you looking for decent icons to use in your Application Bar? Windows 8 makes it incredibly easy by using the built-in Segoe UI Symbol font. There are tons of icons embedded in the font that are perfect for using in your applications.

Take a look at the following XAML snippet from the Microsoft quick start for adding an app bar:

<StackPanel Orientation="Vertical" Margin="0,14,0,5" Grid.Column="1">
   <Button Style="{StaticResource AppBarButtonStyle}"
       FontFamily="Segoe UI Symbol" FontSize="18.667" 
       Padding="8,8,0,0" Margin="0,0,0,10"
       Content="&#xE112;"/>
   <TextBlock Text="Back" />
</StackPanel>

It defines the section of the application bar you see below:

back

The key is in the content tag that specifies the arcane text &#xE112; – this is simply a notation that references the location of the symbol in the font (you can see the “font family” is set to the appropriate font). So how do you go about finding these icons? Fairly simple: on the Windows 8 machine, press the Windows Start Button (that button that has the Windows logo on it) or open the start menu and type “Character Map.” This will give you access to launch the Character Map application. Switch the font to Segoe UI Symbol and scroll down to the bottom until you see something like this:

segoeuisymbol

Now you can simply select the icon you wish to include. For this example I’ve selected the camera icon. Note the code at the bottom: U+E114. That is the code I need to know I can use &#xE114; in text for the Segoe UI Symbol font to make the camera icon appear.

How cool is that? You’ll find the font covers most of the icons you would need for your application. By using the icons from the font set, you also ensure consistency with other Metro applications. Users will be familiar with the fonts and it will make it easier for them to choose the right one for the task they intend to perform.

Check out more tips like this in Building Windows 8 Apps with C# and XAML. Learn how to develop Windows 8.1 apps in Programming the Windows Runtime by Example.

 

15 comments:

  1. The most useful appbar button styles are included for you in the VS templates, and I also created the verbose ones from the usable Symbol area you can see here http://timheuer.com/blog/archive/2012/03/05/visualizing-appbar-command-styles-windows-8.aspx

    ReplyDelete
  2. This doesn't seem to work in Win7. Instead of a camera, the above code results in a black rectangle within a white circle. Did the Segoe UI Symbol font get expanded for Win8?

    ReplyDelete
  3. Yes, I'm showing a different set on Windows 7 than Windows 8.

    ReplyDelete
  4. how to know the code of each symbol in this font

    Thanks in advance.

    ReplyDelete
  5. Great article, it helped get me going with my appBar icons. I was able to make my own white colored PNGs and attach those as images in the button, which works well in the normal and hover states. However, when it comes to the "pressed" state, I can't figure out how to get my own black colored image in there. Any suggestions? Is my only hope the Visual State Manager?

    ReplyDelete
  6. Thanks for this, it is also useful for UI Designers.

    ReplyDelete
  7. It also works with Windows 7. I copied the segoe ui Symbol font from a Windows 8 pc to 7 and it worked well (and it looks awesome)!

    ReplyDelete
  8. Do you know how to externalized the symbol to the resource file?

    ReplyDelete
  9. nice article ! love it very much .. thank u a lot !!!!

    could u please say how to increase the size of the appbarbutton ?!


    ReplyDelete
  10. the official list of names is here: Segoe UI Symbol icon list (Windows) - http://msdn.microsoft.com/en-us/library/windows/apps/jj841126.aspx

    ReplyDelete
  11. Is it possible to do also on Windows Phone ?

    ReplyDelete
  12. I created a master CSS file with named icons (https://github.com/geekytime/segoe-symbol-css) based on the Dev Center Symbol list linked above.

    ReplyDelete
  13. Segoe UI symbols font is installed in my system but its not showing symbols in charactor map. any hlep? using windows 7

    ReplyDelete
  14. This is a great tip. Thanks a lot!
    For everyone's convenience, here are all the glyphs in a big style:
    http://www.hzhang.org/segoe_ui_symbol

    ReplyDelete