Commit 8c654f07ddb06fd161c6a26a67df23b2c73ba34a

sammy 2008-04-30T14:02:25

* Implement FTLayout::Error(). Nothing uses it yet and it's always zero, but it may come in handy later and we want a stable API.

diff --git a/include/FTLayout.h b/include/FTLayout.h
index 4dde6d6..737a21f 100644
--- a/include/FTLayout.h
+++ b/include/FTLayout.h
@@ -65,6 +65,8 @@ class FTGL_EXPORT FTLayout
 
         void Render(const wchar_t *string, int renderMode);
 
+        FT_Error Error() const;
+
     protected:
         FTLayoutImpl *impl;
 };
diff --git a/src/FTLayout/FTLayout.cpp b/src/FTLayout/FTLayout.cpp
index d5f0129..661b203 100644
--- a/src/FTLayout/FTLayout.cpp
+++ b/src/FTLayout/FTLayout.cpp
@@ -60,33 +60,44 @@ void FTLayout::BBox(const char* string, float& llx, float& lly,
     impl->BBox(string, llx, lly, llz, urx, ury, urz);
 }
 
+
 void FTLayout::BBox(const wchar_t* string, float& llx, float& lly,
                     float& llz, float& urx, float& ury, float& urz)
 {
     impl->BBox(string, llx, lly, llz, urx, ury, urz);
 }
 
+
 void FTLayout::Render(const char *string)
 {
     impl->Render(string);
 }
 
+
 void FTLayout::Render(const char *string, int renderMode)
 {
     impl->Render(string, renderMode);
 }
 
+
 void FTLayout::Render(const wchar_t *string)
 {
     impl->Render(string);
 }
 
+
 void FTLayout::Render(const wchar_t *string, int renderMode)
 {
     impl->Render(string, renderMode);
 }
 
 
+FT_Error FTLayout::Error() const
+{
+    return impl->err;
+}
+
+
 //
 //  FTLayoutImpl
 //
diff --git a/src/FTLayout/FTLayoutImpl.h b/src/FTLayout/FTLayoutImpl.h
index 2ad46d3..e74325b 100644
--- a/src/FTLayout/FTLayoutImpl.h
+++ b/src/FTLayout/FTLayoutImpl.h
@@ -140,6 +140,11 @@ class FTLayoutImpl
          * @return A reference to the charSize object of font.
          */
         FTSize &GetCharSize(FTFont *font);
+
+        /**
+         * Current error code. Zero means no error.
+         */
+        FT_Error err;
 };
 
 #endif  //  __FTLayoutImpl__