Bug 81775 - Incorrect Rendering with harfbuzz-ng myanmar unicode
Summary: Incorrect Rendering with harfbuzz-ng myanmar unicode
Status: RESOLVED FIXED
Alias: None
Product: HarfBuzz
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Behdad Esfahbod
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-26 10:41 UTC by oanh
Modified: 2014-07-28 10:49 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Wrong display image (2.94 KB, text/plain)
2014-07-26 10:41 UTC, oanh
Details

Description oanh 2014-07-26 10:41:57 UTC
Created attachment 103496 [details]
Wrong display image

Android KK support Myanmar unicode.
I used Padauk-book.ttf and show string myanmar unicode such as u1030,u102F...

Paint paintText = new Paint(Paint.ANTI_ALIAS_FLAG);
paintText.setColor(Color.BLUE);
paintText.setTextSize(50);
paintText.setStyle(Style.FILL);
Typeface font = Typeface.createFromAsset(getAssets(), "font/Padauk-book.ttf");
paintText.setTypeface(font);
String captionString = "\u1030";//or 102F
Rect rectText = new Rect();
paintText.getTextBounds(captionString, 0, captionString.length(), rectText);
newCanvas.drawText(captionString, 0, captionString.length(),
0, rectText.height(), paintText);

Harfbuzz-ng will connect DOT_CIRCLE(0x25CC) with 0x1030 (hb-ot-shape-complex-myanmar.cc). 
This problem occur with case character is bottom of DOT_CIRCLE.
in top of DOT_CIRCLE such as 0x1034,0x1033. There is no problem.
Please help to fix it.

Thanks and Best Regards
Comment 1 Behdad Esfahbod 2014-07-26 23:15:40 UTC
Copying my comments from:

https://code.google.com/p/android/issues/detail?id=73977

Note that Padauk is pre-OpenType-Myanmar.  It uses generic shaper.  The font works fine with the graphite backend of HarfBuzz, but since we don't have that in Android, it goes through HarfBuzz OT generic shaper.

Ok, few things need to happen:

  - In Android, we don't set HB_BUFFER_FLAG_BOT/EOT.  We should.  I'll fix that...

  - Because of the above, generic shaper does NOT insert dotted-circle.  If we add the BOT flag and generic shaper insert dotted-circle, the bug goes away.

  - The *font* inserts dotted-circle using GSUB.  This new character inherits Unicode properties from the mark.  Then the shaper zeros its advance based on Unicode properties.

Uniscribe doesn't have the bug this.  I'm investigating and will try a fix.
Comment 2 Behdad Esfahbod 2014-07-26 23:20:02 UTC
commit 6f2d9ba52a6d1e3fc200da1ef0e85ba020fcd0dc
Author: Behdad Esfahbod <behdad@behdad.org>
Date:   Sat Jul 26 19:17:44 2014 -0400

    Add old-Myanmar shaper
    
    Looks like Unsicribe responds to the 'mymr' tag by zeroing marks
    GDEF_LATE instead of generic-shaper UNICODE_LATE.  Implement that.
    
    Fixes
    Bug 81775 - Incorrect Rendering with harfbuzz-ng myanmar unicode
    https://bugs.freedesktop.org/show_bug.cgi?id=81775
    
    Micro-test added based on Padauk.
Comment 3 oanh 2014-07-28 10:49:40 UTC
Dear Mr Behdad,

As your comment,

- Because of the above, generic shaper does NOT insert dotted-circle.

- The *font* inserts dotted-circle using GSUB.  This new character inherits Unicode properties from the mark.  Then the shaper zeros its advance based on Unicode properties.

I see in Padauk.ttf DOTTED_CIRCLE position is 0x25CC. I try to remove insert_dotted_circles in hb-ot-shape-complex-myanmar.cc. But It does not work.

Could you share to me how to do it?

Thanks


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.