[fondue-commits] [SCM] Fondue Font Editor branch, master, updated. 2f660c606d28eb19c70ec2b13095419175f260cc

Eugeniy Meshcheryakov eugen at debian.org
Wed Apr 2 14:22:37 UTC 2008


The following commit has been merged in the master branch:
commit 2f660c606d28eb19c70ec2b13095419175f260cc
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Wed Apr 2 16:22:24 2008 +0200

    make ttf export work again

diff --git a/nongui/glyph.cxx b/nongui/glyph.cxx
index 4b6ef95..23d830d 100644
--- a/nongui/glyph.cxx
+++ b/nongui/glyph.cxx
@@ -292,10 +292,13 @@ bool Glyph::computeMetrics(qreal &xMin, qreal &xMax, qreal &yMin, qreal &yMax) c
 	// TODO do something with open contours
 	if (content().isEmpty()) {
 		xMin = xMax = yMin = yMax = 0;
-	return false;
+		return false;
 	}
 	const GlyphContour *c = qobject_cast<const GlyphContour *>(content().at(0));
-	Q_ASSERT(c);
+	if (!c) {
+		qDebug() << "Not a contour. Reference?" << qobject_cast<const GlyphReference*>(content().at(0));
+		return false; // TODO should work with refs too
+	}
 	if (c->points().isEmpty())
 		return false; // empty contours are not allowed
 	xMin = xMax = c->points().at(0).x();
@@ -319,7 +322,10 @@ bool Glyph::computeMetrics(qreal &xMin, qreal &xMax, qreal &yMin, qreal &yMax) c
 		pointNo = 0;
 		if (contNo < content().size()) {
 			c = qobject_cast<const GlyphContour*>(content().at(contNo));
-			Q_ASSERT(c);
+			if (!c) {
+				qDebug() << "Not a contour. Reference?" << qobject_cast<const GlyphReference*>(content().at(contNo));
+				return false; // TODO should work with refs too
+			}
 		}
 		else
 			break;

-- 
Fondue Font Editor



More information about the fondue-commits mailing list