[ocrfeeder/langs: 5/15] Add the new language configuration to the DataBox class
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ocrfeeder/langs: 5/15] Add the new language configuration to the DataBox class
- Date: Tue, 5 Feb 2013 06:25:08 +0000 (UTC)
commit 1f20671f48e7f4ef50b4de25faef5caf9ffd2151
Author: Joaquim Rocha <jrocha igalia com>
Date: Mon Jan 28 15:24:57 2013 +0100
Add the new language configuration to the DataBox class
src/ocrfeeder/studio/dataHolder.py | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/ocrfeeder/studio/dataHolder.py b/src/ocrfeeder/studio/dataHolder.py
index 5860f55..084a345 100644
--- a/src/ocrfeeder/studio/dataHolder.py
+++ b/src/ocrfeeder/studio/dataHolder.py
@@ -28,7 +28,7 @@ from pango import WEIGHT_NORMAL, STYLE_NORMAL
class TextData:
- def __init__(self, face = 'Sans', size = 12, justification = ALIGN_LEFT, line_space = 0, letter_space = 0, style = STYLE_NORMAL, weight = WEIGHT_NORMAL):
+ def __init__(self, face = 'Sans', size = 12, justification = ALIGN_LEFT, line_space = 0, letter_space = 0, style = STYLE_NORMAL, weight = WEIGHT_NORMAL, language = ''):
self.face = face
self.size = size
self.line_space = line_space
@@ -37,10 +37,11 @@ class TextData:
self.style = style
self.weight = weight
self.angle = 0
+ self.language = language
def convertToDict(self):
dictionary = lib.getDictFromVariables(['face', 'size', 'line_space',
- 'letter_space', 'justification', 'angle'], self)
+ 'letter_space', 'justification', 'angle', 'language'], self)
dictionary['style'] = repr(self.style).split(' ')[1].strip('PANGO_')
dictionary['weight'] = repr(self.weight).split(' ')[1].strip('PANGO_')
return {'TextData': dictionary}
@@ -150,6 +151,12 @@ class DataBox(gobject.GObject):
def setLineSpacing(self, spacing):
self.text_data.line_space = spacing
+ def setLanguage(self, language):
+ self.text_data.language = language
+
+ def getLanguage(self):
+ return self.text_data.language
+
def getLetterSpacing(self):
return self.text_data.letter_space
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]