hopefully final fix for missing iconv
akir akir
1 files changed,
9 insertions(+),
5 deletions(-)
jump to
M
src/FbTk/Font.cc
→
src/FbTk/Font.cc
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -//$Id: Font.cc,v 1.16 2004/08/31 21:24:05 fluxgen Exp $ +//$Id: Font.cc,v 1.17 2004/08/31 21:47:56 akir Exp $ #include "StringUtil.hh"@@ -279,8 +279,8 @@ // the non utf-8 string to utf-8 and use utf-8
// drawing functions m_utf8mode = true; } - } #endif // HAVE_ICONV + } #ifdef DEBUG cerr<<"FbTk::Font m_iconv = "<<(int)m_iconv<<endl;@@ -311,8 +311,10 @@
} Font::~Font() { +#ifdef HAVE_ICONV if (m_iconv != (iconv_t)(-1)) iconv_close(m_iconv); +#endif // HAVE_ICONV } void Font::setAntialias(bool flag) {@@ -390,6 +392,7 @@ return m_fontimp->load(fname.c_str());
} unsigned int Font::textWidth(const char * const text, unsigned int size) const { +#ifdef HAVE_ICONV if (m_iconv != (iconv_t)(-1)) { char* rtext = recode(m_iconv, text, size); if (rtext != 0)@@ -399,7 +402,7 @@ if (rtext != 0)
delete rtext; return r; } - +#endif // HAVE_ICONV return m_fontimp->textWidth(text, size); }@@ -425,7 +428,8 @@ char* rtext = 0;
// so we don't end up in a loop with m_shadow static bool first_run = true; - + +#ifdef HAVE_ICONV if (m_iconv != (iconv_t)(-1) && first_run) { rtext = recode(m_iconv, text, len); if (rtext != 0) {@@ -433,7 +437,7 @@ len = strlen(rtext);
// ok, we can't use utf8 mode since the string is invalid } } - +#endif // HAVE_ICONV const char *real_text = rtext ? rtext : text;