Multi-lingual string gadgets to be used for creating and renaming files, drawers, etc.

Imports and exports multilingual ASCII files from and to PC and MAC

Ultra fast screen updating and scrolling

IFF graphics support (import and export).

Direct access to each one of the 256 characters per each font.

Using the code

The code samples used in this article are taken from Rashumon source code, as can be examined by any C++ compiler, even though they were created for Amiga Aztec C compiler.

Points of Interest

Now days we tend to forget some of the complexeity which was part of coding 20 years ago, and today is built in as part of any Operating System SDK, among them: bi directional editing, text editing in general, scorlling text and word wrapping.

Developing a multi-lingual graphic word for the Amiga, back in 1989, required in fact, writing parts of what would be today, part of an Operating System, but was missing back then.

Developing Rashumon

The Amiga was and still is a great computer, with great capabilities, especially when it comes to sound and video. However, basic elements such as a File Browse dialog box was missing, not to mention any support for right to left languages.

Today, all operating systems contain the core elements required to support multi-lingual text editing. The text is stored by the order it was typed, and displayed backward, when it comes to a right to left language. This makes it simple and easy to edit and manipulate it, since the storage reflects to the logical order of the text flow. Back then, there was a need to develop such building block, and it was have made my word processor too slow, had I displayed the text differently than the way it is stored.

Instead, I wanted to develop a word wrapping engine of my own. Word Wrapping is the mechanism that allows breaking lines without breaking words. Unlike the old type writer, where you get to the end of the line, and sometime break a word at the middle, word processors are able to move the last typed word to the next line, in case there is not enough room for it in the current line.

That becomes even more complex when you have to deal with proportional fonts, where each character has its own width, and when you allow combining several fonts. All of the above was not part of a high level API, but required calculating the predicted length of a given text, in pixels, taking into calculation each character width based on the character and the font, attribute (bold, italics) and size used, along with the margins selected.

So even if we deal only one direction (left to right) of editing, it was still complicated to develop from scratch.

To being with, I wrote the routine to calculate a length of a given line:

int LLen=(mode==GRAPHICS)?ln->Len:(ln->CharLen=strlen(ln->Txt))*8;

As you can see, there is a simple scenario where “mode” isn’t “GRAPHICS”, then the length is calculated based on the number of characters multiplied by 8 (which is the length of each character when mono spaced font is used).

When it comes to editing bi directional text using proportional and multiple fonts, it is more complex even to insert a single character:

// This is a rountine for adding a single character, taken
from Rashumon source code

The next step was to perform word wrap to bi-directional lines. As I have explained, the lines were displayed as they were stored in memory. The text “abcאבג” was stored exactly like it looks. Rashumon used double byte characters, meaning that each character was stored using 2 bytes. That was before UNICODE was invented, so the first byte was sufficient to store any character in any language supported. At that time, ASCII characters were in two forms, one form used the values from 0 to 127 and the expanded form uses values 0 to 255. I used the expanded form, and had to decide where to place the right to left languages.

There was no standard for right to left languages. IBM used places 128 to 154, but I found it problematic and chose the places starting of 224, which seems to be the right choice today, as it is identical to how right to left languages are represented today using Double Byte encoding.So if I open a floppy disk image from 1989 (.ADF file), all Rashumon Hebrew documents appear in the correct encoding.

As for the 2nd byte, it was used to store the character color (3 types, meaning up to 8 colors), font attributes (Bold, Italics and underline, or any combination between the 3), language (right to left or left to right) and the font, by pointing to an index of this font within a local list created from the entire list of fonts used per each document.

/* Line structure */

#define COLOR_BIT_1 1 /* 1 */

#define COLOR_BIT_2 2 /* 2 */

#define COLOR_BIT_3 4 /* 3 */

#define UNDL 8 /* 4 */

#define BOLD 16 /* 5 */

#define ITAL 32 /* 6 */

#define SELECT 64 /* 7 */

#define LANG 128 /* 8 */

#define TAB 256 /* 9 */

#define UNUSED_1 1024 /* 10 */

#define UNUSED_2 2048 /* 11 */

#define FONT_BIT_1 4096 /* 12 */

#define FONT_BIT_2 8192 /* 13 */

#define FONT_BIT_3 16384 /* 14 */

#define FONT_BIT_4 32768 /* 15 */

#define FONT_BIT_5 65536 /* 16 */

Key Mapping and Encoding

Key Mapping was used as an array of all characters per the places starting from “1” and to the end of the array.

Here is another part taken from Rashumon source code, where the keymaps are

As you can see, “regmap” is the Hebrew encoding, “engmap” is for the Latin text, “shiftmap” is for the characters typed with SHIFT button, and there was also a keymap for Russian (and later on, one for Arabic as well, thanks to John Hajjer, from Chicago, who spent a lot of time to help me release an Arabic version).

Switching between the two directions was made using a unique ruller with two versions: left to right and right to left:

Pressing the arrow, changed the direction of editing.

Scrolling Text

Even obvious things such as scrolling had to be invented back then. That includes determining how many lines of text to display, based on the current window size (Amiga windows had the ability to be resized by the end user, as well as maximized and minimized), displaying a scroll bar, and calculating the size of the scroll bar’s gauge which should be proportional to the possible movement and the available scroll.

But now let’s go back to the bi-directional text word wrap. Basically, the algorithm, developed by me along with Tamer Even –Zohar, and her husband Nimrod, was based on examining a given line and if it is longer than the size between the two margins (calculating the line width in pixels, taking into calculation each character, based on it’s independent attributes), we should remove the last word from it, and then check again the new length, and so on, until the line is within the width of the margins. The first question to ask is where is the “last” word? If it is a right to left paragraph, the last word will appear first, in the buffer.

In such case, I used the following function, which in fact measured the size (in pixels) of the first word in a given buffer. The following routines are based on mono space font, which is complicated enough…

/* returns the len of the first word in s */

#define BLNK(c) ((c)==‘ ‘ || (c)==‘\n’)

first_wordlen(s,margin,blnks1,blnks2)

char
*s;

int
margin, *blnks1, *blnks2;

{

registerint i, j;

/* for
(i=strlen(s)-1; BLNK(s[i]) && i; i–);

if
((strlen(s)-(i+1))>1) s[i+2] = ”;
*/

for
(i=margin; BLNK(s[i]) && s[i]; i++);

*blnks1 = i;

for
(; !(BLNK(s[i])) && s[i]; i++);

for
(j=i; BLNK(s[j]) && s[i]; j++);

*blnks2 = j-i;

return(i);

}

If the line is a left to right one, a different function was used:

last_wordlen(s,blnks1,blnks2,maxlen)

char
*s;

int
*blnks1, *blnks2, maxlen;

{

registerint i, j;

if
(!strlen(s)) return(0);

for
(i=strlen(s)-1; BLNK(s[i]) && i; i–);

if
(i==0) return(0);

*blnks1 =
(strlen(s)-(i+1));

for
(i=min(maxlen,strlen(s)-1); BLNK(s[i]) && i; i–);

for
(; !(BLNK(s[i])) && i; i–);

for
(j=i; BLNK(s[j]) && j; j–);

i++;

*blnks2 = i – j;

return(strlen(s)
– i);

}

Of course we do not only remove the last word from a line, but also place back the first word of the next line, when there is space available (for example, if the first word in the current line is deleted, and space becomes available), so another building block would be placing the next word (from the beginning of the next line) back to the end of the current line.

In Rashumon, the paragraph direction of text was automatically calculated by examining the encoding of each character in each line, and determining which direction is dominant. While brainstorming with Tamar Even Zohar and her husband Nimrod, we came to know that even space ” ” character can have a direction, and we had to decide if we wish to have Hebrew space character in addition to the Latin one. Well, this requirement became a “must”, as it is needed to word wrap paragraphs with multiple languages combined. For example:

Now, if you make change the margins, which word will “jump” to the next line, or “jump” back to the current line? The only way to determine that, is by knowing the direction of each character (either right to left or left to right), including special characters such as tabs, spaces, commas, etc. Rashumon can still be downloaded from Aminet at this link.

ינואר 1994

The Internet is boring. You browse the news. See a new funny kitten at YouTube, or update your status, but unlike, say, taking a journey to Antarctica or even just taking a walk in the neighborhood, the Internet is missing something…

The Internet is great when you are searching for something, but what if you don’t know exactly know what you are searching for?

In a real life scenario, you might sometime just go out, take a walk, wonder around and find yourself at a small bookshop down the street. An Internet scenario would be: you Google “bookshops” and follow a link… so, today’s Internet experience is much like being blindfolded. You start from somewhere and then when you want to move on, you need the assistance (of a search engine or knowing the web site address) to jump (or to be carried) from where you are right now, directly to your next destination. Since you are blindfolded, you miss the experience of actually going from one place to another, and can’t decide half the way, to stop just because you something else you like.

Since you just jump from one site to another, as there aren’t any distances, it is like if traveling from Los Angeles to New Zealand would feel the same as traveling to San Francisco. Your user experience is a direct result of the place you are visiting, which makes sense, but it lacks other factors such as the length of the journey and how easy or exhausting was it getting there.

So, on one hand, the Internet makes it too easy to jump from one place to another, and on the other hand, it is impossible to actually make the route between the two web sites, experiencing an actual journey, with exciting places along the way.

The Missing Link

The missing ingredient

So what is this ingredient that the Internet is missing? Well, you can call it spatial orientation.

When you go to a journey, you pass along your route many places, some of which are more interesting and some of them are less. If you ask what is common to the places you pass, say, two places: one of them is not worth looking at, while the other is so interesting that you decide to spend there several hours or days.

The answer is that they are both there. So to reflect the term “there” to the Internet, you need to create a space similar to the real world.

No. I am not talking about a new virtual reality game… “Virtual” is something that is not real, but the Internet is real. It doesn’t have to become an alternative “real world”, but should become a new and unique world (or universe).

Some of the attributes in our world are arbitrary but in fact, that’s what makes our word exciting, unpredictable and constantly revolving. Many things you experience happen “by accident”. You meet someone by accident. You discover a beautiful place by accident.

To go back to the bookshop example, when you found this small bookshop along your route, you didn’t have to Google “Books”. It was just there.

There were many attempts to add a “space” dimension as an attribute to the Internet, but in most cases, the space was a direct reflection of geo data taken from the real world. Google Street View allows you to travel as if you were really travelling.

But the Internet deserves its own existence; it deserves its own space. It is great to simulate traveling, flying, driving a car and meeting people in your area, but wouldn’t it be even greater to really travel through the Internet, as a reality, and not as a simulation of another reality?

To make it happen, we need to arbitrarily assign a place in the space to web sites, (which can be based on first comes first served basis), but with the ability to “physically” move from one place to another, similarly as taking a walk.

Traveling through the Internet

Mapping the Internet into a new and unique space, with distances, paths and its own spatial orientation, will unleash the real potential of the Internet. Think of it that way: why are we so dependent on search engines (i.e. Google …)? Why can’t we just travel through the Internet?

Creation of such space must start by assigning it arbitrated attributes, which will later become more meaningful. It will be similar to populating the earth millions years ago, compared to today, where there is a significant difference between living (or visiting) in one place compared to another, or finding a house at the center of a city compared to the suburbs.

Further, there should be more than one way to travel. Not just Googling, but having the endless potential option of just wondering around. As a result, the Internet experience will bring you to visit places you haven’t planned to visit in the first place. This will include, visiting places just because they are located near another place you were looking for in the first place, and the term “located near” will need to be implemented using a new mapping system and not to reflect any existing geographical system imported from the real world.

That will give the Internet what it deserve – its own existence as a cosmos.

Of course, as we would all be thrilled to be able to just jump from LA to New Zealand a split of a second, the old ways to experience the Internet will still be available, and will be used like before, but it is time to add this missing ingredient to the Internet so it becomes a standalone universe.

Additional directions

The universe which is encapsulated within the existence of the Internet has a lot in common with our own universe, which brings ideas such as filling the lack of spatial orientation, but there is also great potential for attributes which can’t be part of our own world, such as, time travel.

Travelling through the Internet can be filtered to a certain time or a time range (for example, the 20th century). If browsing the Internet can become an experience similar to travelling and exploring new worlds, such filer can make this experience a travel through time with a time machine.

New business models

In addition, a verity of means of transportation will be available to Internet traveler that not only will stop the restrictive dependency on search engines, but will also bring the option to choose how to travel. This will create new business models: Fast; Slow; Direct; or having many stops along the route. Speaking about the new business models, today all internet related business models are based on the visitation, and there is a new opportunity here to create new business models based on the actual travel from one web site to another. Based on such models, typically, a web site’s audience would be by default your neighborhood, (radius around you) and as such, can be provided for free, while charges might occur when it comes to a longer journey based on the Internet distance which reflects to the new way the Internet will be mapped.

The Neighborhood

By adding spatial orientation to the Internet, and by gathering web sites and pages into places, similar to neighborhoods, towns, states, countries and continents, a typical “Internet town” will have web sites of different nature residing next to another. Such sites may be a book store, a travel agency (the “commercial area” of our town), several personal blogs (the “residential area” of our town), museums, news agencies, etc. which will all share the same neighborhood. The real people and organizations behind these web sites, even though the web sites will be mapped to the same town, can be from around the world. Unlike ventures which aim to relate activity over the web to geographic locations, for example, in order to tell the end user who is in his or her area (friends, restaurants, etc.), this idea is about allowing the Internet to have its own geographic domain, with places, distances, and the ability to travel and explore them, regardless of where you are in the real world.

So such town will have these sites next to each other as a result of “supply and demand”. At first, the entire universe will be free to settle, and like the old explorers, people will have the opportunity to settle at any place and establish communities next to other people and companies, but the heterogeneity which is the core idea in this article, will bring all kind of ventures, business and people to the same community.

In the real world, one can open a barbershop next to an Internet café or a coffee shop, even though they have nothing in common except for arbitrarily reside next to each other. Residing next to each other without sharing the same content, ISP, audience, country of origin and even language… all of these shouldn’t prevent these web sites to reside in the same Internet neighborhood.

The ability to have web sites “close to” or “next to” another with the ability to provide end users the experience of wondering around and travelling through the Internet with less dependency on search engines is basically what today’s Internet is missing.

During 1989, while developing Rashumon, I found myself looking for a copy protection solution for Amiga software but there wasn’t any. The Amiga had a very non standard Parallel port, which made it impossible to just adopt a copy protection dongle from other platforms, and there was a need to develop a completely new system.

Hardware based copy protection systems are based on a hardware device which interact with the computer using the port assigned to it. Back then (1989), the USB wasn’t invented yet, and the Parallel port was used. The Parallel port was the port used for printers for many years, and therefore any dongle would need to have “pass through” connector allowing the printer to be connected to it, instead to the port directly.

Hardware based copy protection requires interaction with the device through most of the connector pins, being able to read each pin’s value, and to change each pin’s value from 0 to 1 and vice versa. The Amiga didn’t provide any API to do so, which made me look for undocumented features, and code directly to the hardware instead of using any existing SDK.

With the help of Shimon Groper, the founder of EliaShim, I have made many attempts to create a dongle compatible with the unique and undocumented hardware. I used to go from Tel-Aviv to Haifa, and after several hours, leave with a box, covered with many wires in all colors, which was supposed to be the prototype… Eventually I found the way to implement the first Amiga based copy protection dongle and instead of buying bulk dongles from Aladdin, I have accepted the kind offer of Yankee Margalit, their founder and CEO, to by the Amiga product from my small software house (HarmonySoft), and after a short period of negotiation, Aladdin paid me $12,000 and my product became the AmigaHASP.

An Italian magazine published an article about the AmigaHASP:

As part of the deal, I have trained the technical people from Aladdin about programming the Amiga, and even gave them Amiga books and magazines. We have announced the new product, and if Commodore wouldn’t have gone out of business, short after, the AmigaHASP would have probably been useful for many Amiga based software houses. I can tell from my own experience, that it was used for Rashumon, the multi lingual graphic word processor I have developed.

I recently have been using Visual Basic 6.0 for such 3 minutes applications, as I think VB6 is the Swiss Army Knife for such tasks. MSDN subscribers can any Microsoft product, including discontinued ones (say, Windows 3.11) , can be downloaded from their web site.

A new word processor for Amiga computers, by Commodore, has launched.
The word processor, Rashumon, was developed by HarmonySoft, and it has the ability to read out loud the text (currently only in English).
It is a multi-lingual word processor which enables typing and editing in various languages, using miltiple fonts and colors. The typed documents are printed exactly as shown on screen, like with Macintosh computers. 8 colors can be used simultaneously, chosen from 4096 available colors. Text can be highlighted in Bold, Italics and underline.