Re: Arabic/Hebrew coding for the Mac

From: Ted Hopp (
Date: Sun Jul 06 2003 - 13:15:50 EDT

  • Next message: Ben Dougall: "Re: Arabic/Hebrew coding for the Mac"


    Most of your "headaches" don't seem to be Mac-specific. A good source for
    getting a grasp on these issues is this Java documentation from Sun:
    Also indispensible is the Unicode Standard Annex #9
    which describes exactly how the Unicode BiDi algorithm works.

    Regarding the paragraph selection problem that you specifically mentioned
    (this happens even within one paragraph): text that runs both left-to-right
    and right-to-left can have, in the general case, a single selection range
    visually or a single selection range logically (RAM address), but not both.
    Various approaches are available to programmers to deal with this reality,
    but deal with it they must (to have anything like correct behavior).

    Also, for what it's worth, Java 1.4 has a lot of Hebrew/Arabic support
    built-in, and Apple is very committed to good Java support on OS X.



    P.S. "Backwards" is only if you think "forwards" means left-to-right.

    Ted Hopp, Ph.D.
    ZigZag, Inc.

    newSLATE is your personal learning workspace
       ...on the web at

    ----- Original Message -----
    From: "Theodore H. Smith" <>
    To: <>
    Sent: Sunday, July 06, 2003 10:33 AM
    Subject: Arabic/Hebrew coding for the Mac

    > Hi people,
    > I'm having a real headache trying to code for Arabic/Hebrew text
    > editing for the Mac. I'm developing a generalised editfield, of course
    > I'd like it to edit Japanese too, but Japanese can run in the English
    > direction, so that makes it a lot simpler!
    > I really am in need of some kind of forum or group with programmers
    > specialising in Arabic or Hebrew development on the Mac. I am running
    > into problems that seem very hard to solve, especially with the lack of
    > information and coverage on this.
    > The problem may be conceptual, I am having a hard time visualising
    > ATSUI's (MacOS's unicode display/edit API) modelling sometimes. I'm
    > finding in fact visualising reverse direction text a headache.
    > Especially seeing as I haven't seen code for working with it like a
    > proper text editor should do, yet.
    > Things like how does the paragraph selection work? This I find really
    > very awkward... Heres an example (pretend these numbers and letters are
    > Arabic, \r means return, ignore the spaces):
    > In RAM: 12356789 \r abcdefg \r xyz
    > Screen: 987654321 \r gfedcba \r zyx
    > So if I select the onscreen from 2 to \r, which looks perfectly in
    > order, then I am actually selecting a discontinuous range! But that
    > doesn't seem right! There should be no need to, right? Is an arabic UTF
    > document really backwards? So the first character in an arabic UTF
    > document is actually the last onscreen?
    > What really is going on here? What should be going on? Is my example
    > wrong? I really can't do any coding on reverse direction text till I
    > work out how these paragraphs are meant to be working. Its all really
    > rather twisted to me.
    > I do appreciate the problems here, in fact I made a theoretical
    > exploration and found that if we ordered in visual order instead of
    > logical, we'd just get a different set of headaches, not really less.
    > Such is computing for real-world problems!
    > Reply directly to me if you can please? At
    > --
    > Theodore H. Smith - Macintosh Consultant / Contractor.
    > My website: <>

    This archive was generated by hypermail 2.1.5 : Sun Jul 06 2003 - 13:54:06 EDT