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 http://behnam.github.com/lytro_library_merger/

python-lfp-reader

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 http://pypi.python.org/pypi/lfp-reader or if you prefer the command-line, try "easy_install lfp-reader".

More on http://behnam.github.com/python-lfp-reader/

Moving to zwnj.behnam.es

It was eight years ago that I registered the domain zwnj.org 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, zwnj.behnam.es, as I'm moving my whole digital identity to one place, behnam.es.

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...

Sunday, February 08, 2009

RIRA.IRAN (ری‌را.ایران)

We got a new Persian domain name (IDN) for RiRa, the free Persian digital library. It's وب.ری‌را.ایران.ir. (translation: web.rira.iran.ir ;)

UDHR in Persian

Finally the Persian translation of the Universal Declaration of Human Rights is available on the UDHR in Unicode project. (get the PDF)

This Persian (Farsi) version is an encoding of this old printed version. If you know any newer translation available in public domain please inform us.

Jalali GCal 3.0 & Greasefire


Jalali GCal has a major update, version 3.0.
  • It's updated to recent changes by Google on the Calendars's HTML code;
  • now uses jQuery for some operations, which makes it somehow faster now and later updates will be easier as well;
Get the new English and Persian edition from the Google Code download page. If you cannot access Google Code, or have problems with Persian text, please try the userscripts.org mirror; English and Persian.

OTOH I found this handy Firefox/Greasemonkey extension named Greasefire, which lists all available user-scripts (from userscripts.org) for current site in just one click, and you can install them rightaway!

The exciting news is that Jalali GCal has the 6th place in the list of scripts for Google Calendar in Greasefire (actually userscripts.org)!

Friday, September 19, 2008

Jalali GCal moved to Google Code

Finally I created a project for Jalali GCal in code.google.com. Here are the Installation Guide and the downloads list.

Thanks to Mehdi Ahmadizadeh, the new versions work fine with current Google Calendar UI. Also some ideas from Shayan have been implemented.

Here are latest features (for version 2.4):
  • The userscript is now available in two editions: English and Persian. Using Persian edition gives you Persian numbers and months' names;
  • The font of Persian texts in Persian version is bigger than the default texts;
  • The name of the Jalali month is shown in the first day of the month (in the table).
Hope you enjoy it. Feel free to report enhancement requests, bugs, and issues.

Friday, April 25, 2008

Persian in Console, using Bicon and console-setup


This is a screen-shot of Persian translation of The Little Prince, in GNOME Terminal, using Bicon.

A few days ago Ahmed El-Mahmoudy told me about his recent work on Bicon, the Bidirectional Console program. He has made a Debian package, so I made one for Ubuntu Hardy, with a little fix on builddeps, through Launchpad's Private Package Archive build system. You can find the package at my PPA.

I just started using PPA and this is my first package there. By the way, I've also became a Launchpad Beta Tester and am using Launchpad as my OpenID server.

Also I found console-setup works fine with XKB's Iranian keyboard layout, with a change on CODESET. This is how you can get a Persian/Iranian keyboard on your Linux console. Open /etc/default/console-setup and change the lines like these:
CODESET="Arabic"

XKBMODEL="pc105"
XKBLAYOUT="us,ir"
XKBVARIANT=","
XKBOPTIONS="grp:shift_caps_toggle,lv3:ralt_switch,grp_led:scroll"

Bicon project is not so active, but if you need Persian support in console, it's a good start. Please report bugs, or inform us at #arabeyes at irc.freenode.net. Thanks.

Wednesday, January 30, 2008

Iranian Firefox Users Survey

A couple of friends have been running a survey for Iranian users of Firefox. It contains at most 17 questions, based on whether you use Firefox, and its version.

It's open for another couple of weeks, and the results will be out soon after that. Till now, there's been more than one thousand participants.

Friday, January 25, 2008

Dot-IR on Firefox IDN White-list

Just a quick notice. ".ir" TLD has been added to the IDN white-list of Firefox, and will be effective on next updates for 2.0 (Gecko 1.8.1.12) and beta-3.0 (Gecko 1.9).

Now you can use your Persian domain names, ".ایران.ir", easily in Firefox. Enjoy it!

P.S. ".ir" has been in white-list in IE since version 7.0.

Wednesday, January 09, 2008

On Bugmail RFE and My Bugzilla Accounts

After my RFE, about adding an option to Bugmail to not put my email address in To/CC fields of email header, rejected as WORKSFORME by one of bugzilla maintainers (Mozilla bug 410671), I had to change my Bugzilla email addresses (GNOME, Mozilla, and freedesktop.org for now). I have added a "bugs+" to the beginning of previous one, so it's bugs+<my-name>@<this-blog-domain> from now on.

The reason for this change is that I prefer to use the Mute feature of Gmail, so I can get rid of some discussions, which I cannot unsubscribe them directly. Now I get them in the same mail box, but Gmail doesn't detect them as a To or CC one for me, so when I mute a bug, I won't see the thread again. The more interesting part is when a bug's title changes, I'll get it again, which seems very useful.

Monday, October 15, 2007

Internationalized Top-Level Domains

After about a week that eleven Int'lized TLDs had been in root servers, yesterday ICANN officially announced them, the localized IDNwiki pages are open to the world. Here are the Persian one. Go ahead and test your softwares. Firefox has them in the IDN whitelist in the trunk, and will have them in an update for Firefox 2.0 soon. Unfortunately they started using pe as the two-letter code for Persian, which is not a standard, and know it's changed to per. I hope they fix it soon, and use just fa.

This is a big step forward to have dot-iran (.ایران) TLD in the root servers, which has currently more than two thousand registered domains. In fact supporting fully int'lized domain names was one of the major reasons of developing the new IRNIC domain registration system, which has been up since early September. Come on! Register a future dot-iran domain now!

Tuesday, January 02, 2007

Jalali GCal, Version 1.2

Here are an update for Jalali GCal (old: Jalali Calendar for Google Calendar). Installing the new one will replace the previous version. Also I changed its description to Jalali calendar for the web interface of Google Calendar. All features work well on Firefox 1.5 on my Linux desktop. Bug reports are welcomed.

Update: Jalali GCal moved to Google Code

Thursday, September 21, 2006

Mozilla/Firefox Hacks for Power Users (Hack 200C+0002)

Here is some preferences I have set, and you may like to set them, if you are a power user, bidi user, or your locale is not en-US, but have to use this locale.

Newbie HOWTO: use "about:config" to set this key/values.

Power User:
  • layout.word_select.stop_at_punctuation
  • layout.word_select.eat_space_to_next_word
Set them to TRUE if you want Ctrl+Left/Right-Arrows stop at the start/end of alpha-numeric words (like what you get on Gtk+/Gnome). Default values make it to jump to the next/previous Space/Tab character! The second one also affects word boundary on selecting with mouse double-click.

  • browser.triple_click_selects_paragraph
(Mozilla >= 1.9, Firefox >= 3.0a1)
This option allows you to select whether triple click should select the whole paragraph, or just the line you are clicking. If it's FALSE, you can select the whole paragraph with quadruple-click (Wait, it doesn't work on Gtk+/Gnome, as Gtk+ doesn't support quadruple-click. If you like it, here are the Mozilla bug: #348751.)

  • network.http.max-persistent-connctions-per-proxy
  • network.http.max-persistent-connctions-per-server
If you use Tor, or any other proxy in your LAN, just set the first one to a big number (I use 50). Also I set the second one to 8, as Flickr and many other photo-sharing sites use just one domain for almost all images on the their pages, so I cannot get even two pages simultaneously. (maps.google.com is smart enough)

  • network.protocol-handler.external.ed2k
  • network.protocol-handler.app.ed2k
Here are how you can define a protocol and set the external application. In this example, I set ED2K protocol. Create the first key as Boolean, and set the value to TRUE. Then create the second key as String, and set the path to your ed2k link-handler ("/usr/bin/ed2k" for me) as its value. That's it.
Homework: Create a protocol-handler and write a script to handle Yahoo! Messenger links, and make GAIM do the requested action (add buddy, send message, etc). Of course you should mail them to me to get your point. :D)

  • mousewheel.horizscroll.*.action
Try possible values for this key (0..4 IIRC) to get more functions under your fingers (horizontal scroll of your professional mouse, or the touch-pad of your laptop).


Localization:
  • printer.printer_PostScript/*.print_paper_name
If you live in a country (or organization) which the default paper size is A4, not Letter, just set the value of this key to "A4".

  • browser.fixup.alternate.suffix
And if your want to set the default ".com" value to something else (i.e. ".co.uk" or ".ir"), just set it in this key.


Bi-Directional:
  • bidi.browser.ui
And this is the best part for Arabic, Iranian (Persian), and Israeli (Hebrew) users. Setting this key to TRUE will do some magic for you. You can switch the text direction and alignment of input fields with just one keystroke: Ctrk+Shift+X! Also you can switch the page direction from the View menu. Help yourself!

  • mousewheel.horizscroll.*.numlines
If you use Mozilla/Firefox in a right-to-left locale, just set the value of these keys to "1" instead of default "-1". Here are the Mozilla bug: #350594.


Ok, that's all. Let me know if you have problem with this hacks, or other L10n (localization), Bidi (bi-directional), or RTL (right-to-left) problems with Mozilla/Firefox.

Friday, September 01, 2006

Metro Lines I Have Used

In order of time:




Here are Behdad's and Luis's. Should it be more than ten to blog it? I'm not sure... but, how you will update it?

Wednesday, August 30, 2006

What Microsoft did to the Persian Language

Recently I installed Microsoft's Persian UI for Windows XP. Seems like Microsoft can't do anything right for Persian. They use SPACE instead of ZWNJ everywhere in the UI. WTF?! After spending about 1.5 million USD on Persian (they even call it Farsi) support on Windows, the real Persian Windows is still a dream. They are practically removing ZWNJ from Persian, just because they don't know how to use it (or rather, their American-grown confused Iranians don't.)

Microsoft is the one who brought U+064A ARABIC LETTER YEH (Yeh with two dots bellow in final and isolate forms) to Persian, instead of U+06CC ARABIC LETTER FARSI YEH (Yeh without any dots in final and isolate forms), with their buggy fonts. Even Windows Persian keyboard layout have never been compatible with the Iranian standard layout. Now it's so common to see Arabic Yeh and Keh instead of Persian ones everywhere, everytime. More info.

This story reminds me of an old joke:
A British guy was arguing with a Hindi guy.
The British guy says:
We f**ked your country for one hundred years!
The Hindi guy responds:
We f**ked your language forever!

Sunday, August 20, 2006