Nathan's blog

tags = tech
blogtechcollegeresearchpublications

Hebrew on the mac

Nathan Clapham
2007-03-21T01:35:53Z

I started to organise some vocab. for Hebrew and there were a few technical issues to deal with. So, here are some tips for getting your mac setup for Hebrew.

The problem

If you want to use the TekniaHebrew font, then there will be one main issue: you will have to type in Hebrew words backwards -- that is, if you want to write from right to left (try it).

Macosx can change the directon of the line. But because the TekniaHebrew font simply changes the English characters into Hebrew characters, Macosx doesn't know any better than to treat the font the same as it does for English.

The answer: Unicode

You can think of unicode as an encoding that specifies unique codes for the world's characters. This is helpful for us now, but (gripe) character unification means that some nations are upset because they lost their version of particular characters (e.g. Japan). Anyway, follow these steps:

1. Enable the Hebrew-QWERTY Keyboard Layout

  1. Enable the international menu -
    1. Open System Preferences
    2. Under Personal, go to the Internation settings
    3. Select the Input Menu tab
    4. At the very bottom select "Show input menu in menu bar"
    5. Under the list of keyboard layouts, select Hebrew-QWERTY (this makes it show in the menu)
  2. From the input menu in the menu bar, select the Hebrew-QWERTY and try typing in TextEdit or similar application
  3. TIP: you can use Command-Space to switch between the two last language settings

2. Get a better unicode font

You are now ready to type in Hebrew, simple! But you will need to get a good font. I have tried many of the free fonts available, but with many of them the vowels are out of place. This was slightly annoying.

However, I found one good free font The Cardo Font, available at - http://scholarsfonts.net/cardofnt.html.

Install Cardo and give it a go!

For other fonts, you may like to see http://www.redlers.com/downloadfont.html

If you can read the following, your system can understand unicode: אָדָם

3. Another keyboard layout with the accent

One more thing. I can't find the accent on the Hebrew-QWERTY keyboard layout. If you can find it please let me know. For now, I have created a new keyboard layout, based on Hebrew-QWERTY, but with the accent on the "Option-/" key combination.

Download: Hebrew-QWERTY+.keylayout

Install: Place this in your "Users/username/Library/Keyboard Layouts" directory. You will need to logout and login to see it become available: the select it and it will act exactly like Hebrew-QWERTY, but with the accent available

Conclusion

I hope this helps. If there are any requests please contact me.

Dashboard and prototype

Nathan Clapham
2006-11-17T23:01:39Z

I began a first attempt to build a Dashboard widget. Below are a few simple tips.

Use the Prototype JavaScript Library

While I was getting involved with JavaScript again I came across the Prototype JavaScript library. It turns out that Prototype is very useful for Dashboard programming.

See the following resources for information on Prototype:

Prototype has many useful functions for Dashboard programming. Some functions include interacting with forms and elements, extensions to the Array class and AJAX utilities. But I particularly like the easy access to elements: $("element_id") rather than document.getElementById("element_id").

Utility functions for Dashboard

This simple idea got me thinking. I hate the the long function name to access widget preferences (e.g. widget.preferenceForKey("pref_name")). So, taking the excellent idea of the "utility functions" from Prototype, I've created some for Dashboard widgets. It is so simple, it is hardly worth mentioning, but I have found them useful. I'll call it Dashscript.

Now, to access preferences you can use:

  • $P("pref_name") rather than widget.preferenceForKey("pref_name")
  • Prefs.set("pref_name", pref_value) rather than widget.setPreferenceForKey(pref_value,pref_name);
  • Prefs.load("element_id", "pref_name") -- load a preference into a form input field for example.

I'm sure there are many other useful utility functions that could be included. Feel free to use Dashscript and add to it yourself. Email me ('nathan' at my domain 'claphams.info') to share your ideas and I will add them to Dashscript.

You can get the functions here: dashscript.js

Note that there is one line of code that requires the Prototype library to be included; so get a copy of Prototype also.