Wednesday, February 05, 2014

Microsoft and the Persian Keyboard Layouts

It was eight years ago that I initially wrote about the Microsoft products rarely getting the Persian language right and the fact that something is always broken in the very basic levels. Well, there has been some improvements and I feel obligated to write a quick update.

Starting with Windows Vista, the name of the language was corrected, becoming "Persian" instead of "Farsi". But no one upgraded to Vista, so most people found out about this change later in Windows 7. And in a few more years, with Windows 8, came the "Persian (Standard)" keyboard layout, which was based on the Iranian national standard, ISIRI 9147, but—wait for it—this new layout was not in compliance with the standard! One of the best parts of the standard keyboard layout was missing: being able to type ZWNJ character using Shift+Space. Result: not so helpful for the user.

At the 2013 Unicode conference, I brought up the issue with Microsoft's Michael Kaplan, let him know that we have been providing alternate solutions for years, using their own MSKLC, and suggested him to think about enhancing the old Microsoft layout with the same feature, as I did back in 2011.

Michael responded to my request on his blog: (archived)
Well, I can always look at loosening up the definition of what is legal for the space character. 
To be honest, we always have good reasons for wanting to keep the rules tight, but every time we change anything the definition gets loosened more. 
And ZWNJ is a worthy one to consider. 
I will look into it for the future.... 
Thanks for the great suggestion!!
Today, I’m glad to inform you that the “Persian (Standard)” keyboard layout on Windows 8 (and 8.1, with their latest updates) does have ZWNJ mapped on Shift+Space key and allows easily writing Persian correctly.

And, it doesn’t end there! You also get the real Persian numbers with this “Persian (Standard)” layout. Therefore, the updated layout does meet all the requirements of the ISIRI standard and even a little more! Don't forget to thank Michael, if you like these outcomes.

Thursday, September 20, 2012

Some Magic for CSS3 Linear Gradients

About a year ago, I was implementing linear gradients for an OpenType font renderer (using Cairo graphics library) and I decided to support CSS3 Linear Gradient syntax and functionality. Soon I realized that the specification is missing a basic feature of corner-to-corner linear gradients, that is getting the gradient's perpendicular lines (the lines that get the same color) sticking to the other opposite corners. This feature is pretty useful for the Web, where the page designer cannot be sure of the aspect ratio of the box in the user's end — as opposed to the traditional graphics design practice where document was delivered with a solid fixed layout.

I wrote to the CSS3 working group about the problem and proposed to add a keyword to enable this behavior, and temporarily called the keyword magic, as it was supposed to do something traditionally was done manually (and having a good eye). Although, the working group decided to totally change the behavior of the corner keywords and not add yet another keyword for this feature, the name magic corners stuck and is used for the invisible ending points of the gradient vector that makes this magical behavior possible.

This is the story of the name magic corners.

Now for you: The following box uses CSS3 (and some browser-specific directives) to set a magical linear gradient that is supposed to look like the image on the top of this post. If they do look alike, Congratulations! You've got some magic in your browser!

A box with magic-corner linear gradient.

background: linear-gradient(to top right, red, white, blue);

Wednesday, August 08, 2012

Lytro Camera and Light Field Pictures (LFP)

Finally got my Lytro camera two month ago and have already filled up my Lytro photo library with more than one thousand pictures, which stores more than 20GB wroth of data on my hard driver. Of course I keep a backup on my Dropbox folder, which means another 20GB on my hard driver and my paid cloud storage service.

Light field cameras are new technologies, as well as light field pictures. Lytro, Inc. has developed a new file format, called LFP (which is short for Light Field Photography or Light Field Pictures), that is used for almost everything, let it be storing some (about 1GB) mixture of text and binary data about the camera, including the lens array calibration information and wifi MAC address, or storing the raw data and/or the processed data for a light field picture. Now, the best thing about the Lytro, Inc. is that, besides developing this new file format (which is simple enough to reverse-engineer quickly), they are keeping everything transparent, making it easy to understand the logic behind their software and be able to liberate our own data. More importantly, this method allows using common technologies to develop for the Lytro camera, the Lytro Desktop application, and the light field pictures.

Since Lytro released a Windows version of the Lytro Desktop application a couple of weeks ago, I was able to play with my photo library and LFP files. The result is two new pet projects.

Lytro Library Merger

This small Python application lets you merge any Lytro Desktop photo library to your main photo library. For example, if you have a photo library on a Mac OS X machine and have created another one on a Windows machine, now you can merge these two and get all your photos in one place.

More on Lytro Library Merger at


This is small Python library that comes with some very useful command-line scripts for working with LFP files. But the more interesting feature for some users can be lfp_picture_viewer which displays any processed LFP image and allows you to refocus the image; and it works (almost) any platform that supports Python, including Linux, Windows, and Mac OS X.

Download it at or if you prefer the command-line, try "easy_install lfp-reader".

More on

Moving to

It was eight years ago that I registered the domain and began writing about software engineering, the Internet and the Persian language. I am still going to do the same, more or less, but I have decided to move this blog to a new address,, as I'm moving my whole digital identity to one place,

Wednesday, July 01, 2009

First release of Persian Mozilla Firefox ever!

Download Persian Mozilla Firefox 3.5 now! This is the first time Firefox is released in Persian. The number of supported languages has raised to 70 this time!

I started the Mozilla Persian localization team back in 2002 and after almost 7 years, this is our first release, which is very very close to perfect! I should thank Ehsan Akhgari for his great help to the Persian team and the Mozilla project generally in the past couple of years.

Sunday, February 15, 2009

Gmail Wish

Wish Gears had GPG integrity so Gmail could sign and encrypt emails via the web UI...