Browse Source

Catch not just the generic utf8 exception, but a few specific ones as well (bug #244)

Bart van Strien 14 years ago
parent
commit
96a5a3e402
1 changed files with 20 additions and 0 deletions
  1. 20 0
      src/modules/graphics/opengl/Font.cpp

+ 20 - 0
src/modules/graphics/opengl/Font.cpp

@@ -174,6 +174,16 @@ namespace opengl
 				dx += glyph->spacing;
 				dx += glyph->spacing;
 			}
 			}
 		}
 		}
+		catch (utf8::invalid_code_point e)
+		{
+			glPopMatrix();
+			throw love::Exception(e.what());
+		}
+		catch (utf8::invalid_utf8 e)
+		{
+			glPopMatrix();
+			throw love::Exception(e.what());
+		}
 		catch (utf8::exception e)
 		catch (utf8::exception e)
 		{
 		{
 			glPopMatrix();
 			glPopMatrix();
@@ -210,6 +220,16 @@ namespace opengl
 				temp += static_cast<int>(g->spacing * mSpacing);
 				temp += static_cast<int>(g->spacing * mSpacing);
 			}
 			}
 		}
 		}
+		catch (utf8::invalid_code_point e)
+		{
+			glPopMatrix();
+			throw love::Exception(e.what());
+		}
+		catch (utf8::invalid_utf8 e)
+		{
+			glPopMatrix();
+			throw love::Exception(e.what());
+		}
 		catch (utf8::exception e)
 		catch (utf8::exception e)
 		{
 		{
 			throw love::Exception(e.what());
 			throw love::Exception(e.what());