changeset 13703:64b55ae060e8

8227129: Better ligature for subtables Reviewed-by: bae
author mbalao
date Tue, 24 Sep 2019 19:07:02 -0300
parents e033daba121d
children 523d48606333
files src/share/native/sun/font/layout/AlternateSubstSubtables.cpp src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp src/share/native/sun/font/layout/LigatureSubstSubtables.cpp src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp src/share/native/sun/font/layout/MorphTables.cpp src/share/native/sun/font/layout/PairPositioningSubtables.cpp src/share/native/sun/font/layout/SegmentArrayProcessor.cpp src/share/native/sun/font/layout/SegmentArrayProcessor2.cpp src/share/native/sun/font/layout/SegmentSingleProcessor.cpp src/share/native/sun/font/layout/SegmentSingleProcessor2.cpp src/share/native/sun/font/layout/SimpleArrayProcessor.cpp src/share/native/sun/font/layout/SinglePositioningSubtables.cpp src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp src/share/native/sun/font/layout/SingleTableProcessor.cpp
diffstat 16 files changed, 76 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -42,6 +42,10 @@
 le_uint32 AlternateSubstitutionSubtable::process(const LEReferenceTo<AlternateSubstitutionSubtable> &base,
                                        GlyphIterator *glyphIterator, LEErrorCode &success, const LEGlyphFilter *filter) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     // NOTE: For now, we'll just pick the first alternative...
     LEGlyphID glyph = glyphIterator->getCurrGlyphID();
     le_int32 coverageIndex = getGlyphCoverage(base, glyph, success);
--- a/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -41,6 +41,10 @@
 
 le_uint32 CursiveAttachmentSubtable::process(const LEReferenceTo<CursiveAttachmentSubtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     LEGlyphID glyphID       = glyphIterator->getCurrGlyphID();
     le_int32  coverageIndex = getGlyphCoverage(base, glyphID, success);
     le_uint16 eeCount       = SWAPW(entryExitCount);
--- a/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -42,6 +42,10 @@
 
 le_uint32 LigatureSubstitutionSubtable::process(const LETableReference &base, GlyphIterator *glyphIterator, LEErrorCode &success, const LEGlyphFilter *filter) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     LEGlyphID glyph = glyphIterator->getCurrGlyphID();
     le_int32 coverageIndex = getGlyphCoverage(base, glyph, success);
 
--- a/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -53,6 +53,10 @@
 
 le_int32 MarkToBasePositioningSubtable::process(const LETableReference &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     LEGlyphID markGlyph = glyphIterator->getCurrGlyphID();
     le_int32 markCoverage = getGlyphCoverage(base, (LEGlyphID) markGlyph, success);
 
--- a/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -52,6 +52,10 @@
 
 le_int32 MarkToLigaturePositioningSubtable::process(const LETableReference &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     LEGlyphID markGlyph = glyphIterator->getCurrGlyphID();
     le_int32 markCoverage = getGlyphCoverage(base, (LEGlyphID) markGlyph, success);
 
--- a/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -53,6 +53,10 @@
 
 le_int32 MarkToMarkPositioningSubtable::process(const LETableReference &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     LEGlyphID markGlyph = glyphIterator->getCurrGlyphID();
     le_int32 markCoverage = getGlyphCoverage(base, (LEGlyphID) markGlyph, success);
 
--- a/src/share/native/sun/font/layout/MorphTables.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/MorphTables.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -46,8 +46,10 @@
 
 void MorphTableHeader::process(const LETableReference &base, LEGlyphStorage &glyphStorage, LEErrorCode &success) const
 {
-  le_uint32 chainCount = SWAPL(this->nChains);
-  LEReferenceTo<ChainHeader> chainHeader(base, success, chains); // moving header
+    if (LE_FAILURE(success)) return;
+
+    le_uint32 chainCount = SWAPL(this->nChains);
+    LEReferenceTo<ChainHeader> chainHeader(base, success, chains); // moving header
     LEReferenceToArrayOf<ChainHeader> chainHeaderArray(base, success, chains, chainCount);
     le_uint32 chain;
 
--- a/src/share/native/sun/font/layout/PairPositioningSubtables.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/PairPositioningSubtables.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -43,6 +43,10 @@
 
 le_uint32 PairPositioningSubtable::process(const LEReferenceTo<PairPositioningSubtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     switch(SWAPW(subtableFormat))
     {
     case 0:
@@ -74,6 +78,10 @@
 
 le_uint32 PairPositioningFormat1Subtable::process(const LEReferenceTo<PairPositioningFormat1Subtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     LEGlyphID firstGlyph = glyphIterator->getCurrGlyphID();
     le_int32 coverageIndex = getGlyphCoverage(base, firstGlyph, success);
     GlyphIterator tempIterator(*glyphIterator);
@@ -123,6 +131,10 @@
 
 le_uint32 PairPositioningFormat2Subtable::process(const LEReferenceTo<PairPositioningFormat2Subtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     LEGlyphID firstGlyph = glyphIterator->getCurrGlyphID();
     le_int32 coverageIndex = getGlyphCoverage(base, firstGlyph, success);
 
--- a/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -59,6 +59,8 @@
 
 void SegmentArrayProcessor::process(LEGlyphStorage &glyphStorage, LEErrorCode &success)
 {
+    if (LE_FAILURE(success)) return;
+
     const LookupSegment *segments = segmentArrayLookupTable->segments;
     le_int32 glyphCount = glyphStorage.getGlyphCount();
     le_int32 glyph;
--- a/src/share/native/sun/font/layout/SegmentArrayProcessor2.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/SegmentArrayProcessor2.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -59,6 +59,8 @@
 
 void SegmentArrayProcessor2::process(LEGlyphStorage &glyphStorage, LEErrorCode &success)
 {
+    if (LE_FAILURE(success)) return;
+
     const LookupSegment *segments = segmentArrayLookupTable->segments;
     le_int32 glyphCount = glyphStorage.getGlyphCount();
     le_int32 glyph;
--- a/src/share/native/sun/font/layout/SegmentSingleProcessor.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/SegmentSingleProcessor.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -59,6 +59,8 @@
 
 void SegmentSingleProcessor::process(LEGlyphStorage &glyphStorage, LEErrorCode &success)
 {
+    if (LE_FAILURE(success)) return;
+
     const LookupSegment *segments = segmentSingleLookupTable->segments;
     le_int32 glyphCount = glyphStorage.getGlyphCount();
     le_int32 glyph;
--- a/src/share/native/sun/font/layout/SegmentSingleProcessor2.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/SegmentSingleProcessor2.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -60,6 +60,8 @@
 
 void SegmentSingleProcessor2::process(LEGlyphStorage &glyphStorage, LEErrorCode &success)
 {
+    if (LE_FAILURE(success)) return;
+
     const LookupSegment *segments = segmentSingleLookupTable->segments;
     le_int32 glyphCount = glyphStorage.getGlyphCount();
     le_int32 glyph;
--- a/src/share/native/sun/font/layout/SimpleArrayProcessor.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/SimpleArrayProcessor.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -59,6 +59,8 @@
 
 void SimpleArrayProcessor::process(LEGlyphStorage &glyphStorage, LEErrorCode &success)
 {
+    if (LE_FAILURE(success)) return;
+
     le_int32 glyphCount = glyphStorage.getGlyphCount();
     le_int32 glyph;
 
--- a/src/share/native/sun/font/layout/SinglePositioningSubtables.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/SinglePositioningSubtables.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -42,6 +42,10 @@
 
 le_uint32 SinglePositioningSubtable::process(const LEReferenceTo<SinglePositioningSubtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     switch(SWAPW(subtableFormat))
     {
     case 0:
@@ -68,6 +72,10 @@
 
 le_uint32 SinglePositioningFormat1Subtable::process(const LEReferenceTo<SinglePositioningFormat1Subtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     LEGlyphID glyph = glyphIterator->getCurrGlyphID();
     le_int32 coverageIndex = getGlyphCoverage(base, glyph, success);
     if (LE_FAILURE(success)) {
@@ -85,6 +93,10 @@
 
 le_uint32 SinglePositioningFormat2Subtable::process(const LEReferenceTo<SinglePositioningFormat2Subtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     LEGlyphID glyph = glyphIterator->getCurrGlyphID();
     le_int16 coverageIndex = (le_int16) getGlyphCoverage(base, glyph, success);
     if (LE_FAILURE(success)) {
--- a/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -41,6 +41,10 @@
 
 le_uint32 SingleSubstitutionSubtable::process(const LEReferenceTo<SingleSubstitutionSubtable> &base, GlyphIterator *glyphIterator, LEErrorCode &success, const LEGlyphFilter *filter) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     switch(SWAPW(subtableFormat))
     {
     case 0:
@@ -67,6 +71,10 @@
 
 le_uint32 SingleSubstitutionFormat1Subtable::process(const LEReferenceTo<SingleSubstitutionFormat1Subtable> &base, GlyphIterator *glyphIterator, LEErrorCode &success, const LEGlyphFilter *filter) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     LEGlyphID glyph = glyphIterator->getCurrGlyphID();
     le_int32 coverageIndex = getGlyphCoverage(base, glyph, success);
     if (LE_FAILURE(success)) {
@@ -88,6 +96,10 @@
 
 le_uint32 SingleSubstitutionFormat2Subtable::process(const LEReferenceTo<SingleSubstitutionFormat2Subtable> &base, GlyphIterator *glyphIterator, LEErrorCode &success, const LEGlyphFilter *filter) const
 {
+    if (LE_FAILURE(success)) {
+        return 0;
+    }
+
     LEGlyphID glyph = glyphIterator->getCurrGlyphID();
     le_int32 coverageIndex = getGlyphCoverage(base, glyph, success);
     if (LE_FAILURE(success)) {
--- a/src/share/native/sun/font/layout/SingleTableProcessor.cpp	Wed Jun 19 15:23:53 2019 -0700
+++ b/src/share/native/sun/font/layout/SingleTableProcessor.cpp	Tue Sep 24 19:07:02 2019 -0300
@@ -59,6 +59,8 @@
 
 void SingleTableProcessor::process(LEGlyphStorage &glyphStorage, LEErrorCode &success)
 {
+    if (LE_FAILURE(success)) return;
+
     const LookupSingle *entries = singleTableLookupTable->entries;
     le_int32 glyph;
     le_int32 glyphCount = glyphStorage.getGlyphCount();