From d11c77aca5faa4cef39d1ede50f1664f5524168c Mon Sep 17 00:00:00 2001 From: Qua-non Date: Sun, 18 Mar 2012 19:35:58 +0530 Subject: [PATCH 1/2] fix markup positioning incase of glyphs with kerning --- kivy/core/text/markup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kivy/core/text/markup.py b/kivy/core/text/markup.py index 4d2e586a1..f8f6c5a73 100644 --- a/kivy/core/text/markup.py +++ b/kivy/core/text/markup.py @@ -228,7 +228,8 @@ class MarkupLabel(MarkupLabelBase): # (extract all extents of the part, # sum the width, and get the maximum height) pg = [cache[g] for g in part] - pw = sum([g[0] for g in pg]) + #pw = sum([g[0] for g in pg]) + pw = get_extents(part)[0] ph = max([g[1] for g in pg]) options = copy(options) From aeb57e5614c1f6e8e23534b0d9ba579c78a7e025 Mon Sep 17 00:00:00 2001 From: Qua-non Date: Mon, 19 Mar 2012 12:22:51 +0530 Subject: [PATCH 2/2] add note about kerning in comment --- kivy/core/text/markup.py | 4 ++-- kivy/data/style.kv | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kivy/core/text/markup.py b/kivy/core/text/markup.py index f8f6c5a73..6cdf612f8 100644 --- a/kivy/core/text/markup.py +++ b/kivy/core/text/markup.py @@ -226,9 +226,9 @@ class MarkupLabel(MarkupLabelBase): # calculate the size of the part # (extract all extents of the part, - # sum the width, and get the maximum height) + # calculate width through extents due to kerning + # and get the maximum height) pg = [cache[g] for g in part] - #pw = sum([g[0] for g in pg]) pw = get_extents(part)[0] ph = max([g[1] for g in pg]) diff --git a/kivy/data/style.kv b/kivy/data/style.kv index 74d8b2184..4b527e21c 100644 --- a/kivy/data/style.kv +++ b/kivy/data/style.kv @@ -93,7 +93,7 @@ padding_y: 6 canvas.before: Color: - rgb: self.background_color + rgba: self.background_color BorderImage: border: (16, 16, 16, 16) pos: self.pos @@ -105,7 +105,7 @@ pos: map(int, self.cursor_pos) size: 1, -self.line_height Color: - rgb: self.foreground_color + rgba: self.foreground_color : size_hint: None, None