Over a million developers have joined DZone.

Windows Phone Font Positioning With Readable Code

DZone's Guide to

Windows Phone Font Positioning With Readable Code

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

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:


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

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.


Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}