Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Windows Phone Font Positioning With Readable Code

DZone's Guide to

Windows Phone Font Positioning With Readable Code

· Mobile Zone
Free Resource

Launching an app doesn’t need to be daunting. Whether you’re just getting started or need a refresher on mobile app testing best practices, this guide is your resource! Brought to you in partnership with Perfecto

An MSDN blog gives us an idea of the complexity that comes with font positioning.  The author tries to clean things up for the reader by having a lot of variables to keep the code readable:

Lecture for tonights class, which I would like to share with you dear reader, the first part is about how to position fonts on the screen using the least number lines of code.  Unfortunately, it requires a lot of variables, but there you go, complexity comes in many forms.  Variables are easy to understand, but the code is more messy than I like.  But to make neat code requires that the code readers understand what I am trying to do, and that can be difficult.


Here is the end result:

image



Go take a look at the code and download the package to see how the positioning works.  It'll take a bit of time to study.

Source: http://blogs.msdn.com/b/devschool/archive/2011/10/31/positioning-fonts-on-the-windows-phone-7-screen.aspx

Keep up with the latest DevTest Jargon with the latest Mobile DevTest Dictionary. Brought to you in partnership with Perfecto.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}