* Get rid of all methods in FTLayoutImpl that were accessing FTFontImpl internals, since FTFont now has all the proper public methods for that.
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
diff --git a/src/FTFont/FTFontImpl.h b/src/FTFont/FTFontImpl.h
index d9891b1..7962e8e 100644
--- a/src/FTFont/FTFontImpl.h
+++ b/src/FTFont/FTFontImpl.h
@@ -32,12 +32,9 @@
class FTGlyphContainer;
class FTGlyph;
-class FTLayout;
class FTFontImpl
{
- /* Allow FTLayout classes to access CheckGlyph */
- friend class FTLayoutImpl;
friend class FTFont;
protected:
diff --git a/src/FTGL/FTFont.h b/src/FTGL/FTFont.h
index 568cc03..2a5e77a 100644
--- a/src/FTGL/FTFont.h
+++ b/src/FTGL/FTFont.h
@@ -372,9 +372,6 @@ class FTGL_EXPORT FTFont
virtual FTGlyph* MakeGlyph(FT_GlyphSlot slot) = 0;
private:
- /* Allow FTLayout classes to access this->impl. */
- friend class FTLayoutImpl;
-
/**
* Internal FTGL FTFont implementation object. For private use only.
*/
diff --git a/src/FTLayout/FTLayout.cpp b/src/FTLayout/FTLayout.cpp
index 193344e..5cdc083 100644
--- a/src/FTLayout/FTLayout.cpp
+++ b/src/FTLayout/FTLayout.cpp
@@ -77,33 +77,3 @@ FTLayoutImpl::~FTLayoutImpl()
;
}
-
-void FTLayoutImpl::DoRender(FTFont *font, const unsigned int chr,
- const unsigned int nextChr, int renderMode)
-{
- wchar_t string[3];
- string[0] = chr;
- string[1] = nextChr;
- string[2] = '\0';
-
- pen = font->Render(string, 1, pen, FTPoint(), renderMode);
-}
-
-
-void FTLayoutImpl::CheckGlyph(FTFont *font, const unsigned int Chr)
-{
- font->impl->CheckGlyph(Chr);
-}
-
-
-FTGlyphContainer * FTLayoutImpl::GetGlyphs(FTFont *font)
-{
- return font->impl->glyphList;
-}
-
-
-FTSize & FTLayoutImpl::GetCharSize(FTFont *font)
-{
- return font->impl->charSize;
-}
-
diff --git a/src/FTLayout/FTLayoutImpl.h b/src/FTLayout/FTLayoutImpl.h
index 4bc0aa6..c424105 100644
--- a/src/FTLayout/FTLayoutImpl.h
+++ b/src/FTLayout/FTLayoutImpl.h
@@ -46,45 +46,6 @@ class FTLayoutImpl
FTPoint pen;
/**
- * Expose <code>FTFont::DoRender</code> method to derived classes.
- *
- * @param font The font that contains the glyph.
- * @param chr current character
- * @param nextChr next character
- * @param renderMode Render mode to diplay
- * @see FTFont::DoRender
- */
- void DoRender(FTFont *font, const unsigned int chr,
- const unsigned int nextChr, int renderMode);
-
- /**
- * Expose <code>FTFont::CheckGlyph</code> method to derived classes.
- *
- * @param font The font that contains the glyph.
- * @param chr character index
- */
- void CheckGlyph(FTFont *font, const unsigned int Chr);
-
- /**
- * Expose the FTFont <code>glyphList</code> to our derived classes.
- *
- * @param font The font to perform the query on.
- * @param Char The character corresponding to the glyph to query.
- *
- * @return A pointer to the glyphList of font.
- */
- FTGlyphContainer *GetGlyphs(FTFont *font);
-
- /**
- * Expose the FTFont <code>charSize</code> to our derived classes.
- *
- * @param The font to perform the query on.
- *
- * @return A reference to the charSize object of font.
- */
- FTSize &GetCharSize(FTFont *font);
-
- /**
* Current error code. Zero means no error.
*/
FT_Error err;
diff --git a/src/FTLayout/FTSimpleLayout.cpp b/src/FTLayout/FTSimpleLayout.cpp
index 1fd24f0..ce8ce8d 100644
--- a/src/FTLayout/FTSimpleLayout.cpp
+++ b/src/FTLayout/FTSimpleLayout.cpp
@@ -235,11 +235,10 @@ inline void FTSimpleLayoutImpl::WrapTextI(const T *buf, int renderMode,
for(int i = 0; buf[i]; i++)
{
// Find the width of the current glyph
- CheckGlyph(currentFont, buf[i]);
- glyphBounds = GetGlyphs(currentFont)->BBox(buf[i]);
+ glyphBounds = currentFont->BBox(buf + i, 1);
glyphWidth = glyphBounds.Upper().Xf() - glyphBounds.Lower().Xf();
- advance = GetGlyphs(currentFont)->Advance(buf[i], buf[i + 1]).Xf();
+ advance = currentFont->Advance(buf + i, 1).Xf();
prevWidth = currentWidth;
// Compute the width of all glyphs up to the end of buf[i]
currentWidth = nextStart + glyphWidth;
@@ -282,7 +281,7 @@ inline void FTSimpleLayoutImpl::WrapTextI(const T *buf, int renderMode,
// Store the start of the next line
lineStart = breakIdx + 1;
// TODO: Is Height() the right value here?
- pen -= FTPoint(0, GetCharSize(currentFont).Height() * lineSpacing);
+ pen -= FTPoint(0, currentFont->LineHeight() * lineSpacing);
// The current width is the width since the last break
nextStart = wordLength + advance;
wordLength += advance;
@@ -444,7 +443,7 @@ inline void FTSimpleLayoutImpl::RenderSpaceI(const T *string, const int start,
pen += FTPoint(space, 0);
}
- DoRender(currentFont, string[i], string[i + 1], renderMode);
+ pen = currentFont->Render(string + i, 1, pen, FTPoint(), renderMode);
}
}