Saturday 14 June 2014

How To Embed Custom Fonts In Windows Store Apps

There is a competition now-a-days in App Development. The most eye catching attribute in App is "Graphic". Better the Graphic in any App, higher number of user's will prefer it. I love Bill Gates Quotes and mostly follow them. One of my favorite quote of Bill Gates is:

"If you can't make it good, at least make it look good - Bill Gates"

Now, If you analyse the quote, you may conclude that product must at-least look good or awesome. Use of "custom font" can't only make a good product but also make it look good.

How to load custom font and use it in Windows Store App:

Output of Our Result Would Be:


Now Step By Step Guide-How To Add Custom Font in Windows Store App:
1. First of All, Developer Must Have True Type Font(.ttf) saved.
2. Create/Open Windows Store App Project
3. Open "Solution Explorer" from Project ---OR--- press "Ctrl+Alt+L" ---OR--- From View Menu-> Select "Solution Explorer".
4. In Solution Explorer --- Right Click on "Assets" Folder. Choose "Existing Item" suboption from "Add" option as shown in figure:


5. Then Locate and Selected required font to be embedded i.e.


6. When you will add items... It will be listed in Assets Folder. (Note: Don't Change Font Name, It may cause problem)

7. Now Add Some TextBlock or TextBox to MainPage.xaml i.e:

<Grid Background="#FFC4F5A1">
        <TextBlock HorizontalAlignment="Left" FontFamily="Assets/AVidaNova.ttf#AVidaNova" FontSize="90" Foreground="Black" Margin="154,64,0,0" TextWrapping="Wrap" Text="Importing Fonts" VerticalAlignment="Top" Height="102" Width="818" FontWeight="Bold"/>
        <TextBlock HorizontalAlignment="Left" FontFamily="Assets/adler.ttf#adler" FontSize="100" Foreground="Black" Margin="154,545,0,0" TextWrapping="Wrap" Text="Importing Fonts" VerticalAlignment="Top" Height="143" Width="1154" FontWeight="Bold"/>
        <TextBlock HorizontalAlignment="Left" FontFamily="Assets/chiller.ttf#chiller" FontSize="90" Foreground="Black" Margin="154,427,0,0" TextWrapping="Wrap" Text="Importing Fonts" VerticalAlignment="Top" Height="113" Width="1091" FontWeight="Bold"/>
        <TextBlock HorizontalAlignment="Left" FontFamily="Assets/a Theme for murder.ttf#a Theme for murder" FontSize="140" Foreground="Black" Margin="154,271,0,0" TextWrapping="Wrap" Text="Importing Fonts" VerticalAlignment="Top" Height="151" Width="871" FontWeight="Bold"/>
        <TextBlock HorizontalAlignment="Left" FontFamily="Assets/catman.ttf#catman" FontSize="100" Foreground="Black" Margin="154,171,0,0" TextWrapping="Wrap" Text="Importing Fonts" VerticalAlignment="Top" Height="95" Width="920" FontWeight="Bold"/>
    </Grid>

8. Our Focus will be on line:
FontFamily="Assets/File_Name_With_Extension#File_Name
where FontFamily is Attribute of Following Tag, Assets is folder in our project contain data related to Project. Let Suppose We Want to include file "AVidaNova" with extension ".ttf" such that.
           File_Name_With_Extension = AVidaNova.ttf
           File_Name = AVidaNova
Then Our Attribute of TextBlock tag will become:
<TextBlock FontFamily="FontFamily="Assets/AVidaNova.ttf#AVidaNova" />

Thus... Try to Build/Run the app. I hope you will like style of fonts.

Note: Sometimes People Save font files in Control Panel->Font. This work fine on developer PC but when you publish it on Windows Store... Graphic may/may not be same as you expected. Thus try to add files to Assets.

I hope that you will like my article. Please feel free to give your valuable comments and feedback here.

Monday 26 May 2014

Privacy Policy

 This Privacy Policy governs the manner in which Ali Hassan collects, uses, maintains and discloses information collected from users (each, a “User”) of the www.alihassan92.blogspot.com website (“Site”). This privacy policy applies to the Site and all products and services offered by Ali Hassan.
Personal identification information
We may collect personal identification information from Users in a variety of ways, including, but not limited to, when Users visit our site, subscribe to the newsletter, fill out a form, and in connection with other activities, services, features or resources we make available on our Site. Users may be asked for, as appropriate, name, email address. Users may, however, visit our Site anonymously. We will collect personal identification information from Users only if they voluntarily submit such information to us. Users can always refuse to supply personally identification information, except that it may prevent them from engaging in certain Site related activities.
Non-personal identification information
We may collect non-personal identification information about Users whenever they interact with our Site. Non-personal identification information may include the browser name, the type of computer and technical information about Users means of connection to our Site, such as the operating system and the Internet service providers utilized and other similar information.
Web browser cookies
Our Site may use “cookies” to enhance User experience. User’s web browser places cookies on their hard drive for record-keeping purposes and sometimes to track information about them. User may choose to set their web browser to refuse cookies, or to alert you when cookies are being sent. If they do so, note that some parts of the Site may not function properly.
How we use collected information
Ali Hassan collects and uses Users personal information for the following purposes:
- To improve our Site
We continually strive to improve our website offerings based on the information and feedback we receive from you.
- To improve customer service
Your information helps us to more effectively respond to your customer service requests and support needs.
- To administer a content, promotion, survey or other Site feature
To send Users information they agreed to receive about topics we think will be of interest to them.
- To send periodic emails
The email address Users provide will only be used to respond to their inquiries, and/or other requests or questions. If User decides to opt-in to our mailing list, they will receive emails that may include company news, updates, related product or service information, etc. If at any time the User would like to unsubscribe from receiving future emails, we include detailed unsubscribe instructions at the bottom of each email or User may contact us via our Site.
How we protect your information
We adopt appropriate data collection, storage and processing practices and security measures to protect against unauthorized access, alteration, disclosure or destruction of your personal information, username, password, transaction information and data stored on our Site.
Sharing your personal information
We do not sell, trade, or rent Users personal identification information to others. We may share generic aggregated demographic information not linked to any personal identification information regarding visitors and users with our business partners, trusted affiliates and advertisers for the purposes outlined above.
Changes to this privacy policy
Ali Hassan has the discretion to update this privacy policy at any time. When we do, we will revise the updated date at the bottom of this page. We encourage Users to frequently check this page for any changes to stay informed about how we are helping to protect the personal information we collect. You acknowledge and agree that it is your responsibility to review this privacy policy periodically and become aware of modifications.
Your acceptance of these terms
By using this Site, you signify your acceptance of this policy. If you do not agree to this policy, please do not use our Site. Your continued use of the Site following the posting of changes to this policy will be deemed your acceptance of those changes.
Contacting us
If you have any questions about this Privacy Policy, the practices of this site, or your dealings with this site, please contact us searching_friendship33@yahoo.com