OpenPecha / create-font-from-glyph

MIT License
0 stars 1 forks source link

OCR0046: Adding ligature replacement for stack with Tibetan vowels glyphs and fine tune the font. #20

Open 10kalden opened 1 month ago

10kalden commented 1 month ago

Description:

Implementation:

Image

Subtask:

Completion Criteria: To obtain a font with ligature replacement for stacks with the Tibetan vowel glyphs.

kaldan007 commented 1 month ago

@ta4tsering kindly review this card as per discussion

10kalden commented 1 month ago

Img.1: Pecha Image of Derge Kangyur

Image

Img.2: Text created from E-text using generated Derge Font

Image

10kalden commented 1 month ago

Img.1: Pecha Image of Derge Kangyur

Image

img.2 Fixed vowel displacement for derge font

Image

10kalden commented 1 month ago

Tibetan Scripts

Image

10kalden commented 1 month ago

Ligatures

-When creating fonts, we have ligature replacement. when certain letters are typed in sequence according to their unicode value, their respective ligature will be replaced. -In font creation, the superscript vowels ( ི ོ ེ) are independent of the glyphs, meaning they don't require ligature replacement as they will sit on top of whichever glyphs it is typed with. On the other hand the subscript vowel ( ུ ) is heavily dependent on the glyphs and require ligature replacement. -So, If we were to introduce ligature replacement for the superscript vowel, it would require us to crop a whole lot of extra glyphs with all the combination of the above structure.

Tibetan Glyph Count with vowel with 3 superscripts vowels

Consonants 30 consonants: 30 x 3 = 90 glyphs (all the glyphs for this are already present)

Superscripts ར (12 letters): 12 x 3 = 36 ལ (10 letters): 10 x 3 = 30 ས (11 letters): 11 x 3 = 33 Total superscripts glyphs = 99 glyphs

Subscripts ཡ (7 letters): 7 x 3 = 21 ར (13 letters): 13 x 3 = 39 ལ (6 letters): 6 x 3 = 18 ཝ (16 letters): 16 x 3 = 48 Total Subscripts glyphs = 126 glyphs

Combination of super scripts and subscripts རྐྱ་ རྒྱ་ རྨྱ་ སྐྱ་ སྒྱ་ སྤྱ་ སྦྱ་ སྨྱ་ སྐྲ་ སྒྲ་ སྤྲ་ སྦྲ་ སྨྲ་ སྣྲ་ གྲྭ་ དྲྭ་ ཕྱྭ་ རྒྭ་ རྩྭ. 19 glyphs x 3 = 57 glyphs

glyphs required for superscript vowels = 372 glyphs we already have 90 glyphs Total Glyphs required = 282 glyphs

ngawangtrinley commented 1 month ago

I just tried and don't get the vowels at the right place.

Image

Can you add versioning tags to the font names? Both the file name and inside the font, this way we can be sure we don't have miscommunication.

10kalden commented 1 month ago

@ngawangtrinley Ok, will do that

10kalden commented 1 month ago

@ngawangtrinley can you try this https://github.com/OpenPecha/create-font-from-glyph/tree/feature/font-from-scratch/fonts/derge_font

ta4tsering commented 1 month ago

@10kalden if this ttf is the one that you send me then, it is the same one that @ngawangtrinley has tested.

10kalden commented 1 month ago

The font requires several adjustments as discussed yesterday

10kalden commented 1 month ago

The generated font glyphs strokes looks thicker, that is due to the vectorization of png images, converting png to svg can help keep the font sharp at any size but it will also smooth out the pecha images glyphs which will cause the fonts to look visuallly different from the source text.

Image

Any thoughts on this @ngawangtrinley

10kalden commented 1 month ago

there are some glyphs which has noise due to incorrect annotation, for that, there is a approach to clean the glyphs using https://github.com/orgs/OpenPecha/projects/56/views/7?pane=issue&itemId=72223820

10kalden commented 1 month ago

as per @ngawangtrinley suggestion, resized the the png 10 times, and the resultant svg show less smoothing of glyphs

Image

10kalden commented 1 month ago

latest font, not perfect https://github.com/OpenPecha/create-font-from-glyph/tree/feature/font-from-scratch/fonts/derge_font

pecha image

Image

1st iteration font

Image

2nd iteration font

Image

3rd iteration font

Image

4th iteration font

Image

5th iteration

Image