tfbf / Bible-Punjabi-Pavitr-Bible-1945

Bible-Punjabi-Pavitr-Bible-1945
Other
5 stars 9 forks source link

Aside: the problems with how various browsers display multiple vowel signs in Gurmukhi #71

Open DavidHaslam opened 7 years ago

DavidHaslam commented 7 years ago

[This issue is written assuming you're viewing this in a modern browser on the Windows platform.]

The string below consists of the letter KA followed by 12 copies of the vowel sign U. An extremely unlikely example of an invalid glyph.

ਕੁੁੁੁੁੁੁੁੁੁੁੁੁ

It's clear from this illustration that the browser's font engine squashes up as many as four identical vowels at a time by superimposing three of them on the previous one.

cf. Here's the letter KA with only 9 copies of the vowel sign U. i.e. Three less in the string but only one less placeholder displayed!

ਕੁੁੁੁੁੁੁੁੁੁ

This demonstrates that it doesn't display the repeated vowels if there are only two or three of them present. Thus, with three vowel sign U it appears to be normal when in fact it's not:

ਕੁੁੁੁ

DavidHaslam commented 7 years ago

I imagine this is due to a bug in the smart font engine used by most modern browsers in rendering its web pages.

The issue is general one, not particular to our Bible text development project.

It probably affects many other scripts that use diacritics.

DavidHaslam commented 7 years ago

This issue was added for information only.

You may like to try the same tests in the Unicode text editor on your PC. Use a suitable font that can properly render Gurmukhi. Let's see some screenshots for comparison.

Please comment when you've read it and understood it. When all the contributors have read it, then I will close it.

DavidHaslam commented 7 years ago

btw. This is a browser specific issue. The same results are displayed in these Windows 7 browsers:

However, Internet Explorer displays all 12 of the vowel sign U in the first string separately, each on its own dotted circle placeholder, etc.

So the more modern non-Microsoft browser engines must use a smart font engine, whereas IE doesn't, and doesn't even render the first vowel sign correctly when this GitHub page is displayed.

I have since also tried Safari in Windows 7. See later comment below.

DavidHaslam commented 7 years ago

IE screenshot below:

screenshot 2017-01-09 17 33 52

DavidHaslam commented 7 years ago

Just for the record, here's a screenshot from Firefox x64 on Windows 7.

screenshot 2017-01-09 17 38 09

DavidHaslam commented 7 years ago

I've sent an email about this issue to send to my friend at the SIL Non-Roman Fonts Initiative.

DavidHaslam commented 7 years ago

The iOS app CodeHub shows all 12 vowel signs U as if there were only one!

DavidHaslam commented 7 years ago

So does this GitHub issue as viewed in the Safari browser on iOS.

This is worse than the four modern browsers I tested earlier on my Windows PC.

I wonder how Mac OS X behaves.

I now know, having posted an item in FaceBook. Chrome in Mac OS X behaves the same as iOS. No surprises there. At least that's consistent, even if they hide an infinite number of repeated diacritics.

DavidHaslam commented 7 years ago

And so does this issue viewed on my iPad Mini using the Firefox browser app. See screenshot.

file_000

Looks like a general issue in the iOS font engine.

DavidHaslam commented 7 years ago

OK - for the added experience, I just installed Safari 5.1.7 in my Windows 7 PC.

screenshot 2017-01-10 12 57 42

It displays 11 placeholder dotted circles for the first example, just like Internet Explorer.

NB. This warning came up: GitHub doesn't support older versions of Safari.

DavidHaslam commented 7 years ago

The reply received today from MH at the SIL NRSI indicated that it's most likely a font issue than a font engine issue. I agree with this conclusion.

The shaping engine, therefore is saying: I will handle up to 4 vowels on a base, and then inserts dotted circle bases to make sure there aren't more than 4 vowels per base. So far so good. But then the font doesn't do the right thing which is to handle more than one vowel on a base. It should be stacking them somehow. So I would suggest this is a bug in the font rather than the shaping engine. That's good news in that all we need now is a non buggy font rather than a non buggy shaping engine.

He continued:

Feel free to raise a bug with the appropriate font vendors. So the question is whether there is an appropriate Gurmukhi font that can be changed to give the correct behaviour.

DavidHaslam commented 7 years ago

My reply included:

It really is font dependent.

  • In BabelPad, with Code2000 or Arial Unicode MS or Raavi font and Complex Rendering, I see 11 placeholders; only the first vowel sign U is rendered correctly.
  • In BabelPad, with FreeSans or FreeSerif font and Complex Rendering, I see no placeholders; all 12 vowel signs get superimposed below the letter.

BabelPad has its own font engine (designed by Andrew West), so it's quite unlikely that any Unicode font will do what we've seen in Firefox, etc. And it has an Fonts option to switch to Simple Rendering, so one can check to see every code-point that's there.

I have no other installed font in my PC that attempts to render Gurmukhi. See attached screenshot from BabelPad Fonts | Composite Font Mappings screenshot 2017-01-11 10 55 22 Not quite true; unifont also does, but it's a bit dot matrix like, so it's never going to be part of the equation.

Since I wrote to you, I've elicited some further observations on various platforms and browsers, some of which I list next:

  • In Apple iOS and Mac OS X, , and we see no placeholders. It's not even app-dependent for iOS.
  • In Internet Explorer and Safari for Windows, we see 11 placeholders.
  • In Chrome, Brave and Opera for Windows, I see 3 placeholders, just like I did with Firefox.
  • In Firefox on Android and on Linux, we see 3 placeholders, the same as I reported in my email. It must be using the same smart font engine.
DavidHaslam commented 7 years ago

And further on, I included:

I think we now need to find further Unicode fonts that are specially designed for Gurmukhi and other Indic scripts. Then any website designed for providing access to this particular work can be specially tailored for best results.

The problem in general is that we have no control regarding what font is used by services such as GitHub where the text development is being done. I think this is one reason why these typos were so easily missed, though it could also be down to what offline Unicode text editor was used by each of the various team members.

DavidHaslam commented 7 years ago

See also issue #82 for more about Gurmukhi fonts.

DavidHaslam commented 7 years ago

See also these articles about rendering engines:

beniza commented 7 years ago

David,

I'll try to find out good Gurumukhi fonts. Noto fonts and Debian might have good fonts.

Benjamin

On Sun, Jan 15, 2017 at 3:46 PM, David Frank Haslam < notifications@github.com> wrote:

See also these articles about rendering engines:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tfbf/punjabi_bible_1945/issues/71#issuecomment-272685933, or mute the thread https://github.com/notifications/unsubscribe-auth/AErnq3SOqkgr8QpAYAiO394A1GqAANhCks5rSfHzgaJpZM4LeY32 .

DavidHaslam commented 7 years ago

I looked at Noto but one thing to watch out for in fonts is whether they also support the English alphabet as well as the target script - in this case Gurmukhi.

https://smartfonts.com/noto-sans-gurmukhi.font-family

beniza commented 7 years ago

Looks like these fonts includes only Gurumukhi alphabets, number and punctuation character only.

Benjamin

On Mon, Jan 16, 2017 at 3:33 AM, David Frank Haslam < notifications@github.com> wrote:

I looked at Noto but one thing to watch out for in fonts is whether they also support the English alphabet as well as the target script - in this case Gurmukhi.

https://smartfonts.com/noto-sans-gurmukhi.font-family

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tfbf/punjabi_bible_1945/issues/71#issuecomment-272727933, or mute the thread https://github.com/notifications/unsubscribe-auth/AErnqzJOKA8MRA_Wk5mV6cAcSlGfJZeXks5rSpfPgaJpZM4LeY32 .