Entries from December 1, 2011 - December 31, 2011

Saturday
Dec312011

PT Mono, a new FREE monospaced typeface by ParaType

A great way to end the year: ParaType releases a new, free, monospaced font: PT Mono

You can get it here: http://www.paratype.com/

image

 

Let’s take a look at some basic text. For the record, this text below from William Wordsworth has become my new person lorem ipsum placeholder text.

When from behind that craggy steep till then The horizon’s bound, a huge peak, black and huge, As if with voluntary power instinct, Upreared its head. I struck and struck again, And growing still in stature the grim shape Towered up between me and the stars, and still, for so it seemed with purpose of its own And measured motion like a living thing, Strode after me.

-William Wordsworth
The Prelude, lines 381-389

 

image

Overall, nice looking font for text. I like that it looks heaver than Courier New.

 

Now let’s look at some code.

image

 

The parenthesis are too rounded and when placed together form a distracting circle.

image

 

In a similar way, the square brackets form a little square.

image

I am also not a fan of the bottom curve in the lowercase “L”. It seems out of place in this typeface and reminds me of Ubuntu Mono.

image 

 

Overall, I like PT Mono a lot. It does a good job with serifs – something that I miss in Consolas (my favorite coding font) and Lucida Console (my previous favorite).

Thursday
Dec292011

Visio: Reset the Page Grid Origin to (0,0)

Here’s a tip for the perfectionists.

THE GRID ORIGIN

We need to get on the same page (that was not intended as a pun)…below the grid origin is shown.

image

 

Notice that it corresponds to a position of (0,0) according to the horizontal and vertical rulers.

image

We like it being (0,0). It’s the default. It’s natural. It feels good.

 

THE GRID ORIGIN GETS MESSED UP SOMETIMES

Sometimes, the origin changes to some other weird value. The most common cause in my experience has been due to interactively resizing the page as shown in this screencast. If you try it you’ll end up with something like this:

image

Notice that the grid origin is at (-3,1.5)

 

FIX IT IN VISIO 2010 USING THE RULER & GRID DIALOG BOX

Go to the View tab, and click on the little arrow in the bottom of the Show group.

image

The Ruler & Grid dialog box has settings for Grid origin that you can use to fix the problem. Set the values for both Ruler zero and Grid Origin.

image

 

FIX IT IN VISIO 2007 USING THE RULER & GRID DIALOG BOX

In Visio 2007, you access the Ruler & Grid Dialog box via the Tools menu

image

 

FIX IT IN THE SHAPESHEET (VISIO 2007 AND VISIO 2010)

And of course, you can fix it directly in the ShapeSheet. Right-click off the page, select Show ShapeSheet

image

Note that you’ll be two pairs of coordinates (XRulerOrigin,YRulerOrigin) and (XGridOrigin, YGridOrigin). This matches what we did in the Ruler & Grid dialog box.

image

Wednesday
Dec282011

Advanced Screenshots for your Blog: JPEG has its Place

Conventional wisdom says this: Always publish your screenshots on your blog as PNG. For the most part, this wisdom is still correct. However, sometimes on-balance JPEG has merits you should consider.

 

OUR IDEAL

 

Generally, what we want to achieve when putting screenshots in a blog post is to maintain FIDELITY and SMALL FILE SIZES. Fidelity means that our ideal is that the screenshots match pixel-for-pixel what was on our screen. And – of course - in we want keep file sizes as small as possible – readers of the blog don’t always have great bandwidth.

 

JPEG HATE

 

As we know it is lossy. The image seen will not look – to various degrees - like the image we captured. That loss of fidelity is visible as the infamous JPEG “artifacts” as shown in the screenshot below

 

PNG - 51Kb

This is exactly the kind of image PNGs do great at – sharp lines and text. large solid areas of a single color.

image

 

JPEG version (60% quality) – 60Kb

Not only is the JPEG version clearly lacking in fidelity, its file size is bigger than the PNG.

0601-60

 

 

 

CASE 1:  RESIZED SCREENSHOTS

 

Due to the screen real-estate available on blogs and as a convenience to readers, sometimes screenshots are resized.

Here’s the same PNG as above but resized to fit within 600pixels across.

 

PNG – 100Kb

The resized version substantially larger in file size than the original PNG despite it’s smaller dimensions.

0601-600pix

 

JPEG (60% quality) – 35Kb

The artifacts clearly visible.

0601-600pix-60

 

JPEG (70% quality) - 41Kb

0601-600pix-70

 

JPEG (80% quality) - 51Kb

0601-600pix-80

 

JPEG (90% quality) – 74Kb

It’s hard to see an artifacts at this point, and the file is still 25% smaller than the PNG equivalent.

0601-600pix-90

One of the points  I’d like to make here is the scaling the original PNG image down already caused a loss in fidelity – the resulting image is absolutely not the image we started with. This PNG also contains artifacts – the artifacts of that scaling. Therefore we can apply a bit more thinking into our choice of image format.

In the case of resized screenshots, especially if you have many of them, take a look at how PNG the files sizes are. You may find that selectively using JPEG for the resized images, will be a much better experience for your reader and result in only a minor and maybe imperceptible loss of fidelity.

 

CASE 2: WHERE PNG DOES POORLY

 

Remember PNG excels in compression certain kinds of images, but not all. If your screenshots feature applications that have complex content – gradient fills, soft shadows, photographic components.

Here’s the PNG version of my Windows 7 Start Menu.

PNG - 202Kb

image

 

JPEG (80% quality) – 51Kb

Minor artifacts

0604-80

 

JPEG (90% quality) – 78Kb

Tiny artifacts left around the text. .

0604-90

 

JPEG (95% quality) – 111Kb

Slight reduction artifacts left around the text. 111Kb. At a little over 50% of the original PNG size, it seems a fair tradeoff to make.

0604-95

 

TECHNICAL NOTES

  • The screenshots were taken with Hypersnap 6. You’ll see slightly different numbers with different encoders.
  • To see more about the variation in encoders take a loot at my analysis of the .Net framework PNG encoder: part 1 | part 2
  • using an <img> tag and relying on the browser to do resizing might address case 1. However I’ve never been satisfied how images look when leaving the resizing to the browser.

 

PARTING THOUGHTS

PNG is a great format. Most of the time it is the right choice for publishing your screenshots to your blog. However, at least under these two cases, especially if you have many screenshots to show, I suggest considering JPEG for publishing. You might achieve a very substantial saving in file size with only minor sacrifices in fidelity.

 

-Saveen

Wednesday
Dec212011

VisioAutomation: Moving Forward to Visio 2010

For those of you who want to control Visio via C# or VB.NET, I have a couple of updates I wanted mention about my VisioAutomation library: http://visioautomation.codeplex.com/

Versions and Naming

There’s now two libraries

VisioAutomation 2007 – this was previously called simply “VisioAutomation”. It is built against the Visio 2007 PIA but will work with Visio 2010. Of course, it doesn’t have any features specific to Visio 2010. This version is STABLE and only in bug-fix mode. The only additional code changes here will be adding samples and unit tests as needed. Continuing the previous numbering scheme this is “v4.0” as of today.

VisioAutomation 2010 – this library works only with Visio 2010. This will be a little unstable as I continue to refactor the APIs and add features specific to Visio 2010. My primary development effort will be in this codebase.

 

Changes

I spent a lot of the previous year, cleaning this library up. The API surface area grew “organically” – another way of saying “in a disorganized fashion” and so this latest release has clean it up quite a bit.

 

Documentation

The documentation on the codeplex wiki is still relatively accurate if incomplete. I’m still looking into how I can manage the docs effectively so that they are always up-to-date.

 

Get in Contact!

I love getting email from people who use this library or the tools built on it. It’s always so cool to see that people are doing great things with something I’ve built. If you have any questions, bug reports, feedback on the APIs, please do let me know.

Wednesday
Dec142011

Google MapMaker Update – Makes it Easy to Edit

Google’s MapMaker got some nice improvements yesterday, it’s become much easier to edit the maps. The announcement was made on Google’s Lat Long Blog

image

To celebrate, I added the buildings in the Microsoft Campus I work on (called “Advanta”). See the image below. The orange color indicates apparently that it has stored my edits, but they are not pending review. Very curious to see if the edits are approved and how long that will take. Assuming it does get approved, I look forward to having contributed some tiny element to human knowledge.

image