aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/FbTk/XftFontImp.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/FbTk/XftFontImp.cc b/src/FbTk/XftFontImp.cc
index f5a6f9a..9c09a5c 100644
--- a/src/FbTk/XftFontImp.cc
+++ b/src/FbTk/XftFontImp.cc
@@ -78,8 +78,8 @@ bool XftFontImp::load(const std::string &name) {
78 // overflow'). to prevent something like this we detect the maximium 78 // overflow'). to prevent something like this we detect the maximium
79 // number of glyphs by calculating the amount of 'WW' (pretending a 'wide' 79 // number of glyphs by calculating the amount of 'WW' (pretending a 'wide'
80 // glyph) fitting into 32k pixels 80 // glyph) fitting into 32k pixels
81 unsigned int tw = textWidth("WW", 2); 81 unsigned int tw = std::max(textWidth("WW", 2), 1);
82 m_maxlength = 0x8000 / (tw == 0 ? 1 : tw); 82 m_maxlength = 0x8000 / tw;
83 83
84 return true; 84 return true;
85} 85}