diff options
author | akir <akir> | 2004-08-31 21:47:56 (GMT) |
---|---|---|
committer | akir <akir> | 2004-08-31 21:47:56 (GMT) |
commit | 6a098b07979ce22b3c239f7edb24423110ec7e36 (patch) | |
tree | 09ab0b1a4df52ef8788051d0a44187a8f3f931e8 /src/FbTk | |
parent | 622af75c929bfc3f49e3a13775f356be1fd17ee6 (diff) | |
download | fluxbox-6a098b07979ce22b3c239f7edb24423110ec7e36.zip fluxbox-6a098b07979ce22b3c239f7edb24423110ec7e36.tar.bz2 |
hopefully final fix for missing iconv
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/Font.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/FbTk/Font.cc b/src/FbTk/Font.cc index bf07ee0..85b79d6 100644 --- a/src/FbTk/Font.cc +++ b/src/FbTk/Font.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | //$Id: Font.cc,v 1.16 2004/08/31 21:24:05 fluxgen Exp $ | 22 | //$Id: Font.cc,v 1.17 2004/08/31 21:47:56 akir Exp $ |
23 | 23 | ||
24 | 24 | ||
25 | #include "StringUtil.hh" | 25 | #include "StringUtil.hh" |
@@ -279,8 +279,8 @@ Font::Font(const char *name, bool antialias): | |||
279 | // drawing functions | 279 | // drawing functions |
280 | m_utf8mode = true; | 280 | m_utf8mode = true; |
281 | } | 281 | } |
282 | } | ||
283 | #endif // HAVE_ICONV | 282 | #endif // HAVE_ICONV |
283 | } | ||
284 | 284 | ||
285 | #ifdef DEBUG | 285 | #ifdef DEBUG |
286 | cerr<<"FbTk::Font m_iconv = "<<(int)m_iconv<<endl; | 286 | cerr<<"FbTk::Font m_iconv = "<<(int)m_iconv<<endl; |
@@ -311,8 +311,10 @@ Font::Font(const char *name, bool antialias): | |||
311 | } | 311 | } |
312 | 312 | ||
313 | Font::~Font() { | 313 | Font::~Font() { |
314 | #ifdef HAVE_ICONV | ||
314 | if (m_iconv != (iconv_t)(-1)) | 315 | if (m_iconv != (iconv_t)(-1)) |
315 | iconv_close(m_iconv); | 316 | iconv_close(m_iconv); |
317 | #endif // HAVE_ICONV | ||
316 | } | 318 | } |
317 | 319 | ||
318 | void Font::setAntialias(bool flag) { | 320 | void Font::setAntialias(bool flag) { |
@@ -390,6 +392,7 @@ bool Font::load(const std::string &name) { | |||
390 | } | 392 | } |
391 | 393 | ||
392 | unsigned int Font::textWidth(const char * const text, unsigned int size) const { | 394 | unsigned int Font::textWidth(const char * const text, unsigned int size) const { |
395 | #ifdef HAVE_ICONV | ||
393 | if (m_iconv != (iconv_t)(-1)) { | 396 | if (m_iconv != (iconv_t)(-1)) { |
394 | char* rtext = recode(m_iconv, text, size); | 397 | char* rtext = recode(m_iconv, text, size); |
395 | if (rtext != 0) | 398 | if (rtext != 0) |
@@ -399,7 +402,7 @@ unsigned int Font::textWidth(const char * const text, unsigned int size) const { | |||
399 | delete rtext; | 402 | delete rtext; |
400 | return r; | 403 | return r; |
401 | } | 404 | } |
402 | 405 | #endif // HAVE_ICONV | |
403 | return m_fontimp->textWidth(text, size); | 406 | return m_fontimp->textWidth(text, size); |
404 | } | 407 | } |
405 | 408 | ||
@@ -425,7 +428,8 @@ void Font::drawText(Drawable w, int screen, GC gc, | |||
425 | 428 | ||
426 | // so we don't end up in a loop with m_shadow | 429 | // so we don't end up in a loop with m_shadow |
427 | static bool first_run = true; | 430 | static bool first_run = true; |
428 | 431 | ||
432 | #ifdef HAVE_ICONV | ||
429 | if (m_iconv != (iconv_t)(-1) && first_run) { | 433 | if (m_iconv != (iconv_t)(-1) && first_run) { |
430 | rtext = recode(m_iconv, text, len); | 434 | rtext = recode(m_iconv, text, len); |
431 | if (rtext != 0) { | 435 | if (rtext != 0) { |
@@ -433,7 +437,7 @@ void Font::drawText(Drawable w, int screen, GC gc, | |||
433 | // ok, we can't use utf8 mode since the string is invalid | 437 | // ok, we can't use utf8 mode since the string is invalid |
434 | } | 438 | } |
435 | } | 439 | } |
436 | 440 | #endif // HAVE_ICONV | |
437 | 441 | ||
438 | const char *real_text = rtext ? rtext : text; | 442 | const char *real_text = rtext ? rtext : text; |
439 | 443 | ||