diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-04-16 19:00:09 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-04-17 18:11:36 (GMT) |
commit | 7ed15ed98ee5f2a53a5dac8a75381bac6196c19e (patch) | |
tree | ef01c2e006c97cd6ae4daac6004239aa1a6e7a6d /cardtable.py | |
parent | 862171dbe24dbf6e877a672b22c14ac493bb096a (diff) |
Add combos to enable the user to change the font used in the cards. v2
This work is based in the contributions of
Flavio Danesse <fdanesse@activitycentral.com>
and Ariel Calzada <ariel.calzada@gmail.com>
The fonts are saved in the game file.
v2: Solve error in add-pair, and initialization of card font in the CardEditor
Signed-of-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'cardtable.py')
-rw-r--r-- | cardtable.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cardtable.py b/cardtable.py index b9ab29f..97428cc 100644 --- a/cardtable.py +++ b/cardtable.py @@ -88,7 +88,8 @@ class CardTable(gtk.EventBox): def load_game(self, widget, data, grid): self.data = data self.cards_data = grid - + font_name1 = data['font_name1'] + font_name2 = data['font_name2'] if self._workspace_size == 0: # widow is not allocated, thus postpone loading return @@ -129,12 +130,14 @@ class CardTable(gtk.EventBox): if card['ab'] == 'a': props['back_text'] = {'card_text': text1} + font_name = font_name1 elif card['ab'] == 'b': props['back_text'] = {'card_text': text2} + font_name = font_name2 align = self.data.get('align', '1') card = svgcard.SvgCard(identifier, props, jpg, - self.card_size, align) + self.card_size, align, '#000000', font_name) card.connect('enter-notify-event', self.mouse_event, [x, y]) card.connect('button-press-event', self.flip_card_mouse, identifier) |