After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 118456 - IGNORE_SPECIAL_MARKS handled wrongly
IGNORE_SPECIAL_MARKS handled wrongly
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.2.x
Other HP-UX
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2003-07-28 05:01 UTC by Kailash C. Chowksey
Modified: 2003-07-29 15:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
utf testcase (10 bytes, application/octet-stream)
2003-07-28 05:01 UTC, Kailash C. Chowksey
  Details
wrong rendering (no ligature) with this bug (581 bytes, image/png)
2003-07-28 05:02 UTC, Kailash C. Chowksey
  Details
correct rendering (with this fix) (615 bytes, image/png)
2003-07-28 05:03 UTC, Kailash C. Chowksey
  Details
patch fix (cvs diff) (1.12 KB, patch)
2003-07-28 05:03 UTC, Kailash C. Chowksey
none Details | Review
please use THIS patch for fix (cvs diff) (1.35 KB, patch)
2003-07-28 08:21 UTC, Kailash C. Chowksey
none Details | Review
My attempt at fixing CheckProperty (1.01 KB, patch)
2003-07-28 22:21 UTC, Owen Taylor
none Details | Review
Another attempt (1.77 KB, patch)
2003-07-29 03:20 UTC, Owen Taylor
none Details | Review

Description Kailash C. Chowksey 2003-07-28 05:01:16 UTC
In ftxgdef.c, Check_Property() does not handle the IGNORE_SPECIAL_MARKS
flag in the gsub lookup flags correctly. When this flag is seen, it should
left shift the flags by 8 to find the required class and then match it
against the class of the glyph. This causes the ligature rule for glyph269
in microsoft's tunga.ttf not to be honoured. A patch and screenshots and
utf test case is attached to this bug report. Please also refer to the
documentation for LookupFlag bit enumeration at

http://www.microsoft.com/typography/otspec/chapter2.htm

Note that it also means that the ftxgdef.c part of this patch is wrong:

http://people.redhat.com/otaylor/opentype-patches/pango-08-special-marks
Comment 1 Kailash C. Chowksey 2003-07-28 05:01:58 UTC
Created attachment 18660 [details]
utf testcase
Comment 2 Kailash C. Chowksey 2003-07-28 05:02:38 UTC
Created attachment 18661 [details]
wrong rendering (no ligature) with this bug
Comment 3 Kailash C. Chowksey 2003-07-28 05:03:00 UTC
Created attachment 18662 [details]
correct rendering (with this fix)
Comment 4 Kailash C. Chowksey 2003-07-28 05:03:38 UTC
Created attachment 18663 [details] [review]
patch fix (cvs diff)
Comment 5 Kailash C. Chowksey 2003-07-28 08:21:03 UTC
Created attachment 18666 [details] [review]
please use THIS patch for fix (cvs diff)
Comment 6 Owen Taylor 2003-07-28 19:45:50 UTC
Hmm. If you just wanted the standard classes, why would you
use IGNORE_SPECIAL_MARKS?

When I dump out the tunga.ttf using 'ttx' from
fonttools.sourceforge.net, I see the MarkAttach table:

    <MarkAttachClassDef Format="2">
      <ClassDef glyph=".notdef#65" class="2"/>
      <ClassDef glyph="u0C4D" class="1"/>
    </MarkAttachClassDef>

Which looks perfectly set up for this ligature:

      <Lookup index="4">
        <LookupType value="4"/>
        <LookupFlag value="512"/>
        <!-- SubTableCount=1 -->
        <LigatureSubst index="0" Format="1">
          <LigatureSet glyph=".notdef#140">
            <Ligature components=".notdef#65" glyph=".notdef#145"/>
          </LigatureSet>
          <LigatureSet glyph=".notdef#142">
            <Ligature components=".notdef#65" glyph=".notdef#146"/>
          </LigatureSet>
        </LigatureSubst>
      </Lookup>

Since 512 == 2 << 8. So, something seems to be going wrong with
the lookup in the MarkAttachClassDef table.

(.notdef#140 is glyph 269, .notdef#65 is glyph 194)
Comment 7 Owen Taylor 2003-07-28 22:21:35 UTC
Created attachment 18696 [details] [review]
My attempt at fixing CheckProperty
Comment 8 Owen Taylor 2003-07-28 22:25:44 UTC
I've attached my attempt at fixing IGNORE_SPECIAL_MARKS
special marks handling.

The main change is that the current code says:

 "Ignore everything but marks of the specified attach type"

While what the OpenType spec specificies is:

 "Ignore *marks* of types different than the specified attach type"

I've also changed the handling of setting the high byte along
with other bits in the flag; with my patch, if you

  (1 << 8) || IgnoreBaseGlyphs

it will ignore marks of attach type other than 1 *and* base glyphs,
rather than just marks of attach typeother than 1.

It works for your test case for me ... if you want to test it with
a wider set of text, that would be appreciated.
Comment 9 Owen Taylor 2003-07-29 03:20:59 UTC
Created attachment 18700 [details] [review]
Another attempt
Comment 10 Owen Taylor 2003-07-29 03:25:02 UTC
It occurred to me, while doing my laundry, that the last
attempt still wasn't right. So, I've attached another
patch, written in an extremely verbose and careful
style. None-the-less, it might be wrong, so testing is 
appreciated :-)

Comment 11 Kailash C. Chowksey 2003-07-29 04:53:54 UTC
tested your latest patch. it's good.
Comment 12 Owen Taylor 2003-07-29 15:07:22 UTC
Tue Jul 29 09:58:13 2003  Owen Taylor  <otaylor@redhat.com>
 
        * pango/opentype/ftxgdef.c (Check_Property): Rewrite
        handling of IGNORE_SPECIAL_MARKS to be properly
        "ignore marks of attachment type different than
        specified. (#118456, Kailash C. Chowksey)