r16456 by jghali - #9842: Crash when using Gabriola Regular font

scribus-commit scribus-commit at lists.scribus.net
Thu Mar 17 22:17:28 CET 2011


Author: jghali
Date: Thu Mar 17 21:17:28 2011
New Revision: 16456

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16456
Log:
#9842: Crash when using Gabriola Regular font

Modified:
    trunk/Scribus/scribus/fonts/scface_ttf.cpp

Modified: trunk/Scribus/scribus/fonts/scface_ttf.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16456&path=/trunk/Scribus/scribus/fonts/scface_ttf.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ttf.cpp (original)
+++ trunk/Scribus/scribus/fonts/scface_ttf.cpp Thu Mar 17 21:17:28 2011
@@ -157,8 +157,18 @@
 					quint16 Start ( toUint16 ( rBase ) );
 					quint16 End ( toUint16 ( rBase + 2 ) );
 // 					quint16 StartCoverageIndex ( toUint16 ( rBase + 4 ) );
-					for ( unsigned int gl ( Start ); gl <= End; ++gl )
-						coverages[SubTable]  << gl;
+					// #9842 : for some font such as Gabriola Regular
+					// the range maybe be specified in reverse order
+					if (Start <= End)
+					{
+						for ( unsigned int gl ( Start ); gl <= End; ++gl )
+							coverages[SubTable]  << gl;
+					}
+					else
+					{
+						for ( unsigned int gl ( Start ); gl >= End; --gl )
+							coverages[SubTable]  << gl;
+					}
 				}
 			}
 			else




More information about the scribus-commit mailing list