aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Font.hh
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2010-09-08 18:17:21 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2010-09-08 18:17:21 (GMT)
commit690d926ac444243611cd875fb84fabb4e6db2cf2 (patch)
treec8ef84056b295071f9a9207ffea5393c6cf4ad4d /src/FbTk/Font.hh
parent1e8fe2bc14856fa16508686a28a85e72cb0e422c (diff)
downloadfluxbox-690d926ac444243611cd875fb84fabb4e6db2cf2.zip
fluxbox-690d926ac444243611cd875fb84fabb4e6db2cf2.tar.bz2
introduced FbTk::BidiString
a 'BidiString' holds both the logical content and the visual reordered version of the content of a string. this helps to reduce the number of calls to reorder the string before drawing it (as introduced in the patch from Ken Bloom) and to be more consistent in menus and textboxes (drawing cursors and underlining text).
Diffstat (limited to 'src/FbTk/Font.hh')
-rw-r--r--src/FbTk/Font.hh14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/FbTk/Font.hh b/src/FbTk/Font.hh
index 28bbf22..fb399d9 100644
--- a/src/FbTk/Font.hh
+++ b/src/FbTk/Font.hh
@@ -75,7 +75,11 @@ public:
75 @param size length of text in bytes 75 @param size length of text in bytes
76 @return size of text in pixels 76 @return size of text in pixels
77 */ 77 */
78 unsigned int textWidth(const FbString &text, unsigned int size) const; 78 unsigned int textWidth(const char* text, unsigned int size) const;
79 unsigned int textWidth(const BiDiString &text) const {
80 return textWidth(text.visual().c_str(), text.visual().size());
81 }
82
79 unsigned int height() const; 83 unsigned int height() const;
80 int ascent() const; 84 int ascent() const;
81 int descent() const; 85 int descent() const;
@@ -99,8 +103,14 @@ public:
99 @param rotate if the text should be drawn rotated (if it's rotated before) 103 @param rotate if the text should be drawn rotated (if it's rotated before)
100 */ 104 */
101 void drawText(const FbDrawable &w, int screen, GC gc, 105 void drawText(const FbDrawable &w, int screen, GC gc,
102 const FbString &text, size_t len, 106 const char* text, size_t len,
103 int x, int y, FbTk::Orientation orient = ROT0) const; 107 int x, int y, FbTk::Orientation orient = ROT0) const;
108 void drawText(const FbDrawable &w, int screen, GC gc,
109 const BiDiString &text,
110 int x, int y, FbTk::Orientation orient = ROT0) const {
111 drawText(w, screen, gc, text.visual().c_str(), text.visual().size(), x, y, orient);
112 }
113
104 114
105 bool hasShadow() const { return m_shadow; } 115 bool hasShadow() const { return m_shadow; }
106 bool hasHalo() const { return m_halo; } 116 bool hasHalo() const { return m_halo; }