* Implement Render() for all Font types. Patch by Eric Beets.
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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
diff --git a/include/FTFont.h b/include/FTFont.h
index c6ae8cf..120d6bb 100644
--- a/include/FTFont.h
+++ b/include/FTFont.h
@@ -455,6 +455,7 @@ FTGL_EXPORT float ftglLineHeight (FTGLfont*);
FTGL_EXPORT void ftglBBox (FTGLfont*, const char *, float[]);
FTGL_EXPORT float ftglAdvance (FTGLfont*, const char *);
FTGL_EXPORT void ftglRender (FTGLfont*, const char *);
+FTGL_EXPORT void ftglRenderMode (FTGLfont*, const char *, int);
FTGL_EXPORT FT_Error ftglError (FTGLfont*);
diff --git a/include/FTGLBitmapFont.h b/include/FTGLBitmapFont.h
index 6b83105..ee9557e 100644
--- a/include/FTGLBitmapFont.h
+++ b/include/FTGLBitmapFont.h
@@ -80,14 +80,30 @@ class FTGL_EXPORT FTGLBitmapFont : public FTFont
void Render(const char* string);
/**
+ * Render a string of characters
+ *
+ * @param string 'C' style string to be output.
+ * @param renderMode Render mode to display
+ */
+ void Render(const char* string, int renderMode) { Render(string); }
+
+ /**
* Renders a string of characters
- *
+ *
* @param string 'C' style wide string to be output.
*/
void Render(const wchar_t* string);
+ /**
+ * Render a string of characters
+ *
+ * @param string wchar_t string to be output.
+ * @param renderMode Render mode to display
+ */
+ void Render(const wchar_t *string, int renderMode) { Render(string); }
+
// attributes
-
+
private:
/**
* Construct a FTBitmapGlyph.
@@ -96,7 +112,7 @@ class FTGL_EXPORT FTGLBitmapFont : public FTFont
* @return An FTBitmapGlyph or <code>null</code> on failure.
*/
inline virtual FTGlyph* MakeGlyph( unsigned int g);
-
+
/* Internal generic Render() implementation */
template <typename T>
inline void RenderI(const T* string);
diff --git a/include/FTGLOutlineFont.h b/include/FTGLOutlineFont.h
index aefe992..17cc068 100644
--- a/include/FTGLOutlineFont.h
+++ b/include/FTGLOutlineFont.h
@@ -88,12 +88,28 @@ class FTGL_EXPORT FTGLOutlineFont : public FTFont
void Render(const char* string);
/**
+ * Render a string of characters
+ *
+ * @param string 'C' style string to be output.
+ * @param renderMode Render mode to display
+ */
+ void Render(const char* string, int renderMode) { Render(string); }
+
+ /**
* Renders a string of characters
*
* @param string wchar_t string to be output.
*/
void Render(const wchar_t* string);
+ /**
+ * Render a string of characters
+ *
+ * @param string wchar_t string to be output.
+ * @param renderMode Render mode to display
+ */
+ void Render(const wchar_t *string, int renderMode) { Render(string); }
+
private:
/**
* Construct a FTOutlineGlyph.
diff --git a/include/FTGLPixmapFont.h b/include/FTGLPixmapFont.h
index 5394dc9..94e8e43 100644
--- a/include/FTGLPixmapFont.h
+++ b/include/FTGLPixmapFont.h
@@ -67,26 +67,42 @@ class FTGL_EXPORT FTGLPixmapFont : public FTFont
* @param bufferSizeInBytes the length of the buffer in bytes
*/
FTGLPixmapFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
-
+
/**
* Destructor
*/
~FTGLPixmapFont();
-
+
/**
* Renders a string of characters
*
* @param string 'C' style string to be output.
*/
void Render( const char* string);
-
+
+ /**
+ * Render a string of characters
+ *
+ * @param string 'C' style string to be output.
+ * @param renderMode Render mode to display
+ */
+ void Render(const char* string, int renderMode) { Render(string); }
+
/**
* Renders a string of characters
- *
- * @param string wchar_t string to be output.
+ *
+ * @param string wchar_t string to be output.
*/
void Render(const wchar_t* string);
+ /**
+ * Render a string of characters
+ *
+ * @param string wchar_t string to be output.
+ * @param renderMode Render mode to display
+ */
+ void Render(const wchar_t *string, int renderMode) { Render(string); }
+
private:
/**
* Construct a FTPixmapGlyph.
@@ -95,7 +111,7 @@ class FTGL_EXPORT FTGLPixmapFont : public FTFont
* @return An FTPixmapGlyph or <code>null</code> on failure.
*/
inline virtual FTGlyph* MakeGlyph(unsigned int g);
-
+
/* Internal generic Render() implementation */
template <typename T>
inline void RenderI(const T* string);
diff --git a/include/FTGLTextureFont.h b/include/FTGLTextureFont.h
index 9f95992..6ae67dc 100644
--- a/include/FTGLTextureFont.h
+++ b/include/FTGLTextureFont.h
@@ -84,19 +84,34 @@ class FTGL_EXPORT FTGLTextureFont : public FTFont
/**
* Renders a string of characters
- *
- * @param string 'C' style string to be output.
+ *
+ * @param string 'C' style string to be output.
*/
virtual void Render(const char* string);
-
+
+ /**
+ * Render a string of characters
+ *
+ * @param string 'C' style string to be output.
+ * @param renderMode Render mode to display
+ */
+ void Render(const char* string, int renderMode) { Render(string); }
+
/**
* Renders a string of characters
- *
- * @param string wchar_t string to be output.
+ *
+ * @param string wchar_t string to be output.
*/
virtual void Render(const wchar_t* string);
-
+ /**
+ * Render a string of characters
+ *
+ * @param string wchar_t string to be output.
+ * @param renderMode Render mode to display
+ */
+ void Render(const wchar_t *string, int renderMode) { Render(string); }
+
private:
/**
* Construct a FTTextureGlyph.
@@ -105,7 +120,7 @@ class FTGL_EXPORT FTGLTextureFont : public FTFont
* @return An FTTextureGlyph or <code>null</code> on failure.
*/
inline virtual FTGlyph* MakeGlyph( unsigned int glyphIndex);
-
+
/**
* Get the size of a block of memory required to layout the glyphs
*
diff --git a/src/FTGlue.cpp b/src/FTGlue.cpp
index d8d1a1b..7a861a6 100644
--- a/src/FTGlue.cpp
+++ b/src/FTGlue.cpp
@@ -163,6 +163,10 @@ C_FUN(float, ftglAdvance, (FTGLfont *f, const char* s),
// virtual void FTFont::Render(const char* string);
C_FUN(void, ftglRender, (FTGLfont *f, const char * s), return, Render, (s));
+// virtual void Render(const char* string, int renderMode);
+C_FUN(void, ftglRenderMode, (FTGLfont *f, const char *s, int r),
+ return, Render, (s, r));
+
// FT_Error FTFont::Error() const;
C_FUN(FT_Error, ftglError, (FTGLfont *f), return -1, Error, ());