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 118639 - chained context substitutions applied wrongly
chained context substitutions applied wrongly
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.2.x
Other HP-UX
: Normal normal
: 1.2.4
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2003-07-30 04:49 UTC by Kailash C. Chowksey
Modified: 2003-08-25 14:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
utf testcase (12 bytes, application/octet-stream)
2003-07-30 04:50 UTC, Kailash C. Chowksey
  Details
bad rendering with substitution applied (627 bytes, image/png)
2003-07-30 04:50 UTC, Kailash C. Chowksey
  Details
correct rendering with substitution not applied (714 bytes, image/png)
2003-07-30 04:51 UTC, Kailash C. Chowksey
  Details
patch (cvs diff) also need fix for #118592 (1.22 KB, patch)
2003-07-30 04:52 UTC, Kailash C. Chowksey
none Details | Review

Description Kailash C. Chowksey 2003-07-30 04:49:23 UTC
In ftxgsub.c, Chained Context Substitutions are applied even
when the input glyphs do not meet the InputCoverage. eg. I
made a contrived font in :

http://www.arbornet.org/~klchxbec/Sampige-contrived.ttf
where lookup #5 says:

      <Lookup index="5">
        <LookupType value="6"/>
        <LookupFlag value="256"/>
        <!-- SubTableCount=1 -->
        <ChainContextSubst index="0" Format="3">
          <!-- BacktrackGlyphCount=0 -->
          <!-- InputGlyphCount=1 -->
          <InputCoverage index="0" Format="2">
            <Glyph value="#10"/>
            ...
            <Glyph value="#43"/>
          </InputCoverage>

Note that glyph #9 is deliberately removed from input coverage
to illustrate this bug.

          <LookaheadCoverage index="0" Format="2">
            ...
            <Glyph value="#57"/>
          </LookaheadCoverage>
          <!-- SubstCount=1 -->
          <SubstLookupRecord index="0">
            <SequenceIndex value="0"/>
            <LookupListIndex value="14"/>

Because the loop index starts from 1 instead of 0, the input
coverage is not checked and the substitution is applied as
seen in LookupListIndex=14.

I've attached the utf testcase, and screenshots with and without
the fix. Please note that none of the screenshots are correct
rendering as far as the language is concerned. They just depict
the bug.

Also note that the fix for bug#118592 is also required to
reproduce this bug.
Comment 1 Kailash C. Chowksey 2003-07-30 04:50:08 UTC
Created attachment 18743 [details]
utf testcase
Comment 2 Kailash C. Chowksey 2003-07-30 04:50:49 UTC
Created attachment 18744 [details]
bad rendering with substitution applied
Comment 3 Kailash C. Chowksey 2003-07-30 04:51:12 UTC
Created attachment 18745 [details]
correct rendering with substitution not applied
Comment 4 Kailash C. Chowksey 2003-07-30 04:52:18 UTC
Created attachment 18746 [details] [review]
patch (cvs diff) also need fix for #118592
Comment 5 Owen Taylor 2003-07-30 14:51:53 UTC
For Lookup_ChainContextSubst1 and Lookup_ChainContextSubst2,
the Coverage is the first thing checked:

    error = Coverage_Index( &ccsf1->Coverage, in->string[in->pos],
&index );
    if ( error )
      return error;
                                                                     
          
so, I don't think any changes are needed there.

It does look like this fix is needed for Lookup_ChainContextSubst3
and Lookup_ChainContextPos3.
Comment 6 Owen Taylor 2003-08-25 14:30:39 UTC
Mon Aug 25 10:17:21 2003  Owen Taylor  <otaylor@redhat.com>
 
        * pango/opentype/ftxgsub.c (Lookup_ChainContextSubst3)
        * pango/opentype/ftxgpos.c (Lookup_ChainContextPos3):
        Fix problems where the coverage wasn't being checked
        for the first input glyph. (#118639, Kailash C. Chowksey)