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
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
Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}