[sword-devel] Hebrew Fonts & building indexers.

Yeshiah Zalman sword-devel@crosswire.org
Thu, 23 Dec 1999 13:51:30 -0500


 OK I have created a special "MultiMode" ISO Hebrew Fontset which includes vowel points. The Font orks fine in windows but not in
 sword? I changed my BHS text to use this new Web Hebrew MultiMode" but see only gibberrish.   It IS a Symbol Font (only way to get
 windows to accept the entire mapping.

 So Either Word need to be altered to also accept Symbol Fonts or someone need to take the glymphs from my Fontset and recast them
 into a new FontMap. The Idea is if we can create a pointed hebrew text also ISO compatable.

 Yeshiah
 FONT available at
http://www.crosswire.org/sword/ALPHAcckswwlkrfre22034820285912/alpha/


 ----- Original Message -----
> From: Troy A. Griffitts <scribe@crosswire.org>
> To: Yeshiah Zalman <shayah@gatecom.com>; <sword-devel@crosswire.org>
> Sent: Tuesday, December 21, 1999 3:31 AM
> Subject: Re: Fw: building indexers.
>
>
> > > i dont know where to put what. sorry. how and when to call the routine. where in Sword?
> >
> > :)  You don't yet.  I will call your method.  I will put it all in
> > place, just needed the sort algorythm from you, and via our mail this
> > afternoon and this message, I believe we have it.
> >
> > Just to be sure I understand correctly, all characters in your index
> > words only contain the ascii values below (224-250)?
> >
> >
> > > i made the wieght table.
> > >
> > > hebrewCharacters[224]=0;    /* ŕalef */
> > > hebrewCharacters[225]=1;    /* ábet */
> > > hebrewCharacters[226]=2;    /* âgimel */
> > > hebrewCharacters[227]=3;    /* ădalet */
> > > hebrewCharacters[228]=4;    /* äheh */
> > > hebrewCharacters[229]=5;    /* ĺvav */
> > > hebrewCharacters[230]=6;    /* ćzayin */
> > > hebrewCharacters[231]=7;    /* çchet */
> > > hebrewCharacters[232]=8;    /* čtet */
> > > hebrewCharacters[233]=9;    /* éyod */
> > > hebrewCharacters[234]=10;    /* ęchaf-sofit */
> > > hebrewCharacters[235]=11;    /* ëchaf */
> > > hebrewCharacters[236]=12;    /* ělamed */
> > > hebrewCharacters[237]=13;    /* ímem-sofit */
> > > hebrewCharacters[238]=14;    /* îmem */
> > > hebrewCharacters[239]=15;    /* ďnun-sofit */
> > > hebrewCharacters[240]=16;    /* đnun */
> > > hebrewCharacters[241]=17;    /* ńsamech */
> > > hebrewCharacters[242]=18;    /* ňayin */
> > > hebrewCharacters[243]=19;    /* ópeh-sofit */
> > > hebrewCharacters[244]=20;    /* ôpeh */
> > > hebrewCharacters[245]=21;    /* őtzadi-sofit */
> > > hebrewCharacters[246]=22;    /* ötzadi */
> > > hebrewCharacters[247]=23;    /* ÷qof */
> > > hebrewCharacters[248]=24;    /* řresh */
> > > hebrewCharacters[249]=25;    /* ůshin */
> > > hebrewCharacters[250]=26;    /* útav */
> > >
> > > ----- Original Message -----
> > > From: Troy A. Griffitts <scribe@crosswire.org>
> > > To: Yeshiah Zalman <shayah@gatecom.com>; <sword-devel@crosswire.org>
> > > Sent: Monday, December 20, 1999 5:03 PM
> > > Subject: Re: Fw: building indexers.
> > >
> > > > OK, all you need to do is right a small C / C++ function that receive 2
> > > > character arrays and returns -1 if the first one is less than the second
> > > > one; 1 if the first one is greater than the second one, and 0 if they
> > > > are equal.  for ascii comparisons of standard english letters, I would
> > > > write something like this:
> > > >
> > > > int compare(char *value1, char *value2) {
> > > > int offset;
> > > >
> > > > while (true) { infinite loop that we will 'return' out of
> > > > if ((value1[offset] == 0) && (value2[offset] == 0))  // end of both
> > > > return 0; // strings are equal
> > > > if (value1[offset] == 0) // we've hit the end of the first string
> > > > return -1;
> > > > if (value2[offset] == 0)  // end of second string
> > > > return 1;
> > > > if (value1[offset] > value2[offset])
> > > > return 1;
> > > > if (value1[offset] < value2[offset])
> > > > return -1;
> > > > offset++; // characters at this pos must be ==
> > > > // goto next pos and continue checking
> > > >
> > > > }
> > > > }
> > > >
> > > > __________________________________________--
> > > >
> > > > you may need to create an array of ascii values and their 'weight' for
> > > > comparison.
> > > > char hebrewCharacters[255];
> > > > hebrewCharacters[<ascii value of Aleph>]  = 0;
> > > > hebrewCharacters[<ascii value of Bet>]    = 1;
> > > > hebrewCharacters[<ascii value of Gimmel>] = 2;
> > > > and so one...
> > > >
> > > > And then use this array in your comparison like:
> > > > Change the 2 checks above from:
> > > >
> > > > if (value1[offset] > value2[offset])
> > > > return 1;
> > > > if (value1[offset] < value2[offset])
> > > > return -1;
> > > >
> > > > to:
> > > > if (hebrewCharacters[value1[offset]] >
> > > > hebrewCharacters[value2[offset]])
> > > > return 1;
> > > > if (hebrewCharacters[value1[offset]] <
> > > > hebrewCharacters[value2[offset]])
> > > > return -1;
> > > >
> > > >
> > > > ______________________________________________________
> > > >
> > > > Hope this helps.....
> > > > Hope this code actually compiles :)
> > > >
> > > >
> > > >
> > > > Yeshiah Zalman wrote:
> > > > >
> > > > > I feel bad, you lost me!
> > > > > please be patient.
> > > > > Considering 2 months ago I knew NOTHING of
> > > > > Sword OR Cbuilder.
> > > > >
> > > > > Please explain step by step WHAT and where?
> > > > > Heh I develkoped a neat VB dictionary which sits as a BAR on the top of your screen. But C is harder.
> > > > >
> > > > > thank you for your patience.
> > > > >
> > > > > ----- Original Message -----
> > > > > From: Troy A. Griffitts <scribe@crosswire.org>
> > > > > To: Yeshiah Zalman <shayah@gatecom.com>; <sword-devel@crosswire.org>
> > > > > Sent: Monday, December 20, 1999 3:40 PM
> > > > > Subject: Re: Fw: building indexers.
> > > > >
> > > > > > Yeshiah,
> > > > > > I've been giving your delema some thought and believe that I have a
> > > > > > proper solution in mind instead of a hack.  I will allow you to
> > > > > > 'register' a 'compare' method for a lexdict module that will be used
> > > > > > when doing the lookup.  The compare method will take 2 char * (Strings)
> > > > > > and should return same as strcmp (<0 for 1 < 2; >0 for 1 > 2; and 0 for
> > > > > > 1 == 2).  The sig should be something like:
> > > > > >
> > > > > > int compare(char *value1, char *value2);
> > > > > >
> > > > > > This means that the file should be sorted in such a way that:
> > > > > > for (module == TOP; !module.Error(); module++) {
> > > > > > if (compare(module.KeyText(), (module + 1).KeyText()) > 0)
> > > > > > fprintf(stderr, "ERROR: %s is greater than %s", module.KeyText(),
> > > > > > (module + 1).KeyText());
> > > > > > }
> > > > > >
> > > > > > Does this make sense?  All I need from you is a proper implementation of
> > > > > > the compare method and a properly sorted module.
> > > > > >
> > > > > > Any feedback from you or anyone else on this implementation is greatly
> > > > > > appreciated....
> > > > > >
> > > > > > -Troy
>