* 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
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__