Click here to Skip to main content
13,591,625 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked
Posted 18 Aug 2011
Licenced CPOL

Working with Default FontSize in Windows Phone 7 Applications

, 18 Aug 2011
Rate this:
Please Sign up or sign in to vote.
In this post, we will learn about various font sizes defined in the default style library of Windows Phone 7, so you don't have to define them again and can reuse those styles which will be standard sizes all over any Phone 7 Application

Hope you already read my article series "Collection of Windows Phone 7 (Mango) Tutorials". During the tutorial series, we used the common styles "PhoneTextNormalStyle" and "PhoneTextTitle1Style" in the TextBlocks added to the TitlePanel. So what are those? These are all common styles defined by the style library of WP7 SDK.

In this post, we will learn about various font sizes defined in the default style library of Windows Phone 7. So, you don't have to define them again and can reuse those styles which will be standard sizes all over any Phone 7 Applications. Let's discuss them here. Read to know more about it. 


In XAML pages of Windows Phone 7, you will find the default styles used in the XAML for titles inside the TitlePanel. They uses some default font sizes internally and if you want to use them in your application, you can follow this post to understand them easily. 

The font sizes are already defined for generic Windows Phone 7 applications to keep standard between all Phone 7 applications. Let's start with their definitions first and then we will see a demonstration of them.

Default Style Definitions

The default font sizes for any WP7 applications are defined in various levels as mentioned below:

FontSize Style NameFontSize
PhoneFontSizeSmall14 pt
PhoneFontSizeNormal15 pt
PhoneFontSizeMedium17 pt
PhoneFontSizeMediumLarge19 pt
PhoneFontSizeLarge24 pt
PhoneFontSizeExtraLarge32 pt
PhoneFontSizeExtraExtraLarge54 pt
PhoneFontSizeHuge140 pt

This table is based on MSDN Documentation. No need to define them once again in your application. You can use them directly as per your need.


Let's have a demonstration of the FontSize in a small application. Create a new Windows Phone 7 application and modify the ContentPanel of the MainPage.xaml file as mentioned below:

<Grid x:Name="ContentPanel" Grid.Row="1">
    <StackPanel Orientation="Vertical">
        <TextBlock Text="Small" FontSize="{StaticResource PhoneFontSizeSmall}"/>
        <TextBlock Text="Normal" FontSize="{StaticResource PhoneFontSizeNormal}"/>
        <TextBlock Text="Medium" FontSize="{StaticResource PhoneFontSizeMedium}"/>
        <TextBlock Text="Medium Large" 

	FontSize="{StaticResource PhoneFontSizeMediumLarge}"/>
        <TextBlock Text="Large" FontSize="{StaticResource PhoneFontSizeLarge}"/>
        <TextBlock Text="Extra Large" 

	FontSize="{StaticResource PhoneFontSizeExtraLarge}"/>
        <TextBlock Text="Extra Extra Large" 

	FontSize="{StaticResource PhoneFontSizeExtraExtraLarge}"/>
        <TextBlock Text="Huge" FontSize="{StaticResource PhoneFontSizeHuge}"/>

Here each text block defines a different style from the standard style library. This will render the UI in the Windows Phone 7 screen as shown here:


Hope this post was helpful to you to understand the basic and standard font sizes. Stay tuned to read more tips on Silverlight and Windows Phone 7 in the coming days. Thanks for your time to read my blog posts. Don't forget to share them with your followers.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Kunal Chowdhury «IN»
Software Developer (Senior)
India India
Kunal Chowdhury is a Microsoft "Windows Platform Development" MVP (Most Valuable Professional), a Codeproject Mentor, Telerik Developer Expert, Nokia Developer Champion, Windows 10 Champion, Microsoft Rockstar, Speaker in various Microsoft events, Author, passionate Blogger and a Software Engineer by profession.

He is currently working in an MNC located in India. He has a very good skill over XAML, C#, Silverlight, Windows Phone, WPF and Windows Store (WinRT) app development. He posts his findings, articles, tutorials in his technical blog and CodeProject.

Book authored:

Connect with me on:

My CodeProject Awards/Prizes:

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.180618.1 | Last Updated 18 Aug 2011
Article Copyright 2011 by Kunal Chowdhury «IN»
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid