Sharing: 1,800 lines of code to achieve 3 actions...

Discuss FontCreator here, please do not post support requests, feature requests, or bug reports!
Post Reply
בן של מלך
Posts: 50
Joined: Wed May 25, 2022 4:29 pm
Location: Hadera, Israel

Sharing: 1,800 lines of code to achieve 3 actions...

Post by בן של מלך »

More than a year ago (!) I tried to apply some smart commands that would allow Jewish text editors to shorten work processes.

Introduction from GPT:

In Hebrew, employs diacritical marks known as "nikkud" to aid in the pronunciation and comprehension of texts. These marks are typically used in texts for children, learners, and sacred texts like the Torah. The primary nikkud in Hebrew are:

Dagesh: Dagesh represents a doubling of a consonant's sound and is marked by a dot inside the letter. It can shift the meaning of a word or provide clarity in pronunciation, In English it is usually expressed by doubling the letter (like Run-Running)

Shva: Shva is a diacritical mark that indicates a short, neutral vowel sound. It can be found under or near a letter and has no vocalization of its own, In English it is usually expressed without any punctuation letters (e.g. Spring - the letter Spng)

Kubutz and Shuruk: Both represent the "oo" sound, but while kubutz is placed below the letter Vav, shuruk is a dot within the Vav.

Tzeire and Segol: These diacritics represent the vowel sounds "ey" and "ay," respectively. Tzeire is written as two dots, while segol appears as three dots.

Patach and Kamatz: These diacritics represent the vowel sounds "ah" and "ahh." Patach is a single horizontal line beneath the letter, while kamatz looks like a small letter "T" (ָ) under the letter.
Holam: Holam is a diacritical mark that represents the long "o" sound and is marked as a dot above the letter Vav.

The use of nikkud in Hebrew is critical for learners and in sacred texts, as it ensures accurate pronunciation and comprehension of the text.

So far.

All this in a nutshell, in practice there is a lot to be precise about this, there are dozens of grammar books, and they are all unclear...

Out of all of them, there are three that are difficult, the Dagesh, the Qamatz and the Shva, they have several different functions and are with the same Unicode, what they all do is add another glyph with a different shape, and when necessary, change from the glyphs window.
Different text editors have to deal with it during design, produce scripts, go through word by word and check that there are no mistakes, but I finally decided to solve it.
The difficulty is that everything depends on the other letters and diacritics that are in the word, and sometimes even in another word in the sentence, in short, very complex.
So I studied FontCreator well, Erwin will be able to prove from my hundreds of correspondences with him and all my questions... (until he convinced me to move the discussion to the forum...) and some smart fonts I created, I decided to put all the weight on it and create a font that would be smart and able to recognize the These three cases and decide which glyph to show.
Over a year of specific investigations, in addition to the fact that I already knew the main thing (I was a good child and listened to all the rules in class...), and after reading hundreds of pages of grammar, I managed to create a formula that would cover all cases, and I'm really excited to tell about the result of many hours of work, trials and failures, disappointments and successes, and most importantly, about significant progress in the project I've dreamed about for a long time.
I decided to share here, and it's quite enough to upload pictures, because I'm sure no one will understand...
For now the file contains over 1,800 lines of code in 20 lookups, I am now in the process of shortening the formula as much as possible.
What do you think?

And sorry for the broken English...
Last edited by Bhikkhu Pesala on Wed Oct 11, 2023 3:55 am, edited 1 time in total.
Reason: Fixed Typos, broken English, and improved formatting
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9858
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: Sharing: 1,800 lines of code to achieve 3 actions...

Post by Bhikkhu Pesala »

Thank you for your efforts. You can include me in those who won't understand, but if a few do, it will have been worthwhile.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT11.0 @ Win 10 64-bit build 19045.2486
בן של מלך
Posts: 50
Joined: Wed May 25, 2022 4:29 pm
Location: Hadera, Israel

Re: Sharing: 1,800 lines of code to achieve 3 actions...

Post by בן של מלך »

Bhikkhu Pesala wrote: Wed Oct 11, 2023 3:57 am Thank you for your efforts. You can include me in those who won't understand, but if a few do, it will have been worthwhile.
I assumed that was it, just came to share that I did over 1,800 lines of code to achieve the result of 3 simple commands.
When I manage to shorten it, I'll share how many lines I got...
And- thanks for trying to understand...
Post Reply