notofonts / hebrew

Noto Hebrew
SIL Open Font License 1.1
2 stars 1 forks source link

3 Yiddish ligatures spacing should match component characters spacing (for a proportional font) #39

Closed markhdavid closed 7 months ago

markhdavid commented 7 months ago

Font

NotoSansHebrew-Regular.ttf Noto_Sans_Hebrew.zip NotoRashiHebrew-Regular.ttf Noto_Rashi_Hebrew.zip

Where the font came from, and when

https://fonts.google.com/noto/specimen/Noto+Sans+Hebrew https://fonts.google.com/noto/specimen/Noto+Rashi+Hebrew For each font, click Download family, unzip resulting download, find font file in static subdirectory. Date: 2024-02-06

Font Version

Sans: Version 2.003 Rashi: Version 1.006

Issue

For a proportional font such as any of the Noto Hebrew variants Sans, Rashi, or Serif, set widths for the three so-called Yiddish ligatures

U+05F0 [װ] HEBREW_LIGATURE_YIDDISH_DOUBLE_VAV U+05F1 [ױ] HEBREW_LIGATURE_YIDDISH_VAV_YOD U+05F2 [ײ] HEBREW_LIGATURE_YIDDISH_DOUBLE_YOD

and the alphabebetic presentation form variant

U+FB1F [ײַ] HEBREW_LIGATURE_YIDDISH_YOD_YOD_PATAH

ought to be the same as the sums of the set widths for their respective equivalent component base characters. E.g., the set width of

U+05F0 [װ] HEBREW_LIGATURE_YIDDISH_DOUBLE_VAV

which has as components two VAV characters should be the same as the sum of the set widths of two individual VAV characters, that is, a sequence of two of the following character

U+05D5 [ו] HEBREW_LETTER_VAV

Users ought to be able to expect that for any properly designed proportional font the spacing of a sequence of yod or vav characters will be correct and the same, whether the sequence is via the Yiddish ligature character or via a sequence of the equivalent components.

2 of the 3 Hebrew font families have some version of this general bug: Sans and Rashi. Details below.

  1. An easy way to observe this is to make a line of text consisting of a good number, say 30, of one of the ligature characters, e.g., (װ) side-by-side, with a vertical bar (|) character at the beginning and end. Then under that put a line of the same number of pairs of component characters, e.g., in this example וו, with the same vertical bars. See that the vertical bars line up. If not, this ligature's set width in the font is incorrect, and it ought to be adjusted to match the pair of component characters. (See below under character data for a sample text file incorporating the above approach.) Here's a sample test text for double-vav:

    |װװװװװװװװװװװװװװװװװװװװװװװװװװװװװװ| |וווווווווווווווווווווווווווווווווווווווווווווווווווווווווווו|

  2. After trying testing all the combinations in all three fonts Rashi, Sans, and Serif, here's a summary of the problem cases (marked "bad):

    Sans: bad U+05F0 [װ] Rashi: bad U+05F0 [װ], bad U+05F1 [ױ]

  3. Expected these ligature characters to have same set width as their corresponding component pair.

  4. Additional information

    (a) Users cannot be expected to be aware of which encoding they are using for pairs of base characters that are equivalent looking and equivalent functioning with the digraphs. The keyboards used by users typing Yiddish vary widely among operating systems and within operating system. Some do not offer all of the Yiddish digraphs from the main Hebrew block as standard keycaps; some only offer only a subset; some offer only the character from the Alphabetic Presentation forms section of Unicode to encode pasekh-tsvey-yudn as U+FB1F [ײַ]. Additionally, even if a digraph is offered as a defined keycap, there's nothing to prevent users from typing the equivalent with a pair of base characters. (b) Changing set widths in a font is usually a bad idea due to compatibility, but here we're only changing the set width of ligature characters primarily used for Yiddish, which is probably an extremely tiny minority in practice. Moreover, these fonts have other bugs that affect Yiddish, including some involving these same ligature characters, which probably made them unsuitable Yiddish, notably https://github.com/notofonts/hebrew/issues/38, by the same author, which should be worked on after this issue is resolved.

Character data

Compare

  1. U+05F0 [װ] HEBREW_LIGATURE_YIDDISH_DOUBLE_VAV vs. 2X: U+05D5 [ו] hebrew_letter_vav
  2. U+05F1 [ױ] hebrew_ligature_yiddish_vav_yod vs. U+05D5 [ו] hebrew_letter_vav, U+05D9 [י] hebrew_letter_yod
  3. U+05F2 [ײ] hebrew_ligature_yiddish_double_yod vs. U+FB1F [ײַ] hebrew_ligature_yiddish_yod_yod_patah vs. 2X: U+05D9 [י] hebrew_letter_yod

Here is a text file, test-all-yiddish-ligatures.txt, containing all the above cited test text and using the above testing approach, usable in the Tools section below: test-all-yiddish-ligatures.txt

Screenshot

Here's a screen shot using the commands under Font Tools below for each font with this bug:

Sans: issue demonstrated for U+05F0 [װ]:

sans-ligatures

Rashi: issue demonstrated for U+05F0 [װ] and U+05F1 [ױ]:

rashi-ligatures

Tools for reporting bugs

Harfbuzz hb-view and hb-shape

To reproduce for each of the two fonts that have this bug:

Starting in the static subdirectory of the Sans download directory, place the file provided above under Character data into this directory, then run the following command:

hb-view --font-file NotoSansHebrew-Regular.ttf --text-file test-all-yiddish-ligatures.txt --output-file "sans-ligatures.png"

Starting in the static subdirectory of the Rashi download directory, place the file provided above under Character data into this directory, then run the following command:

hb-view --font-file NotoRashiHebrew-Regular.ttf --text-file test-all-yiddish-ligatures.txt --output-file "rashi-ligatures.png"
markhdavid commented 7 months ago

This issue is very similar to issue https://github.com/meirsadan/david-libre/issues/19 for David Libre, filed by yours truly, @markhdavid.

markhdavid commented 7 months ago

I would like to be assigned this bug. I've been given the go-ahead by @simoncozens to work on https://github.com/notofonts/hebrew/issues/38. Note that the fix for this issue #39 should go in before #38, since it directly impacts it.

markhdavid commented 7 months ago

Upon further investigation, I tested additional weights, finding that double-yod ligature character (U+05D5 [ו] HEBREW_LETTER_VAV) in Thin weight for Rashi has this issue. This weight corresponds to Light layer in the .glyphs source file for these characters. I'll include fixes for this in my forthcoming PR.

Here's an hb-view command to test this and resulting screenshot: (Refer to issue description, under Harfbuzz hb-view and hb-shape, for additional details.)

hb-view --font-file NotoRashiHebrew-Thin.ttf --text-file test-all-yiddish-ligatures.txt --output-file "rashi-ligatures-Thin.png"

=> resulting rashi-ligatures-Thin.png image:

rashi-ligatures-Thin

Note that the screenshot also reveals defects with double-vav and vav-yud, but those were already known/reported. The newly discovered defect is with the double-yod ligature. Also note that the precomposed double-yod-with-patah ligature (U+FB1F [ײַ] HEBREW_LIGATURE_YIDDISH_YOD_YOD_PATAH) is correct in this weight.