Merge lp:~rmattb1/freeicontospeech/0.5.04 into lp:freeicontospeech

Proposed by Matt Barkau
Status: Merged
Merged at revision: not available
Proposed branch: lp:~rmattb1/freeicontospeech/0.5.04
Merge into: lp:freeicontospeech
Diff against target: None lines
To merge this branch: bzr merge lp:~rmattb1/freeicontospeech/0.5.04
Reviewer Review Type Date Requested Status
Matt Barkau Approve
Review via email: mp+5226@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Matt Barkau (rmattb1) wrote :

Tests good on OLPC XO 1, also.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'clear_button.xml'
2--- clear_button.xml 2008-09-10 05:37:51 +0000
3+++ clear_button.xml 2009-04-05 04:05:37 +0000
4@@ -1,2 +1,1 @@
5-<control>Clear
6-</control>
7+<control>Clear</control>
8
9=== modified file 'concepts_actions.xml'
10--- concepts_actions.xml 2008-09-10 05:37:51 +0000
11+++ concepts_actions.xml 2009-04-05 04:05:37 +0000
12@@ -13,16 +13,14 @@
13 <word icon = 'icons/copy.png'>copy</word>
14 <word icon = 'icons/cut.png'>cut</word>
15 </category>
16- <category>food
17-and drink<word icon = 'icons/bake.png'>bake</word>
18+ <category>food and drink<word icon = 'icons/bake.png'>bake</word>
19 <word icon = 'icons/beat.png'>beat</word>
20 <word icon = 'icons/bite.png'>bite</word>
21 <word icon = 'icons/carve.png'>carve</word>
22 <word icon = 'icons/chew.png'>chew</word>
23 <word icon = 'icons/heat.png'>heat</word>
24 </category>
25- <category>health
26-and body<word icon = 'icons/breathe.png'>breathe</word>
27+ <category>health and body<word icon = 'icons/breathe.png'>breathe</word>
28 <word icon = 'icons/awake.png'>awake</word>
29 </category>
30 <category>play<word icon = 'icons/appear.png'>appear</word>
31
32=== modified file 'concepts_subjects.xml'
33--- concepts_subjects.xml 2008-09-10 05:37:51 +0000
34+++ concepts_subjects.xml 2009-04-05 04:05:37 +0000
35@@ -1,6 +1,5 @@
36 <subjects>
37- <category>assistive
38-technology<word icon = 'icons/AAC device.png'>AAC device</word>
39+ <category>assistive technology<word icon = 'icons/AAC device.png'>AAC device</word>
40 <word icon = 'icons/AT joystick.png'>AT joystick</word>
41 <word icon = 'icons/complex switch.png'>complex switch</word>
42 <word icon = 'icons/dwell software.png'>dwell software</word>
43@@ -16,8 +15,7 @@
44 <word icon = 'icons/track pad.png'>track pad</word>
45 <word icon = 'icons/trackball.png'>trackball</word>
46 </category>
47- <category>personal
48-electronics<word icon = 'icons/digital camera.png'>digital camera</word>
49+ <category>personal electronics<word icon = 'icons/digital camera.png'>digital camera</word>
50 <word icon = 'icons/ghetto blaster.png'>ghetto blaster</word>
51 <word icon = 'icons/headphones.png'>headphones</word>
52 <word icon = 'icons/MP3 player.png'>MP3 player</word>
53@@ -33,8 +31,7 @@
54 <word icon = 'icons/shocked 1.png'>shocked</word>
55 <word icon = 'icons/stubborn 1.png'>stubborn</word>
56 </category>
57- <category>health
58-and body<word icon = 'icons/bath.png'>bath</word>
59+ <category>health and body<word icon = 'icons/bath.png'>bath</word>
60 <word icon = 'icons/medicine.png'>medicine</word>
61 <word icon = 'icons/potty.png'>potty</word>
62 <word icon = 'icons/shampoo.png'>shampoo</word>
63
64=== modified file 'free_icon-to-speech.py'
65--- free_icon-to-speech.py 2008-09-14 19:12:03 +0000
66+++ free_icon-to-speech.py 2009-04-05 03:25:42 +0000
67@@ -101,10 +101,9 @@
68 pygame.mouse.set_cursor(a, b, c, d)
69 clock = pygame.time.Clock()
70 # pygame.mixer.init() # Not used in this version
71- size = (1200,900) # OLPC XO 1 native resolution
72 if olpcgames.ACTIVITY:
73 size = olpcgames.ACTIVITY.game_size
74- screen = pygame.display.set_mode(size)
75+ screen = pygame.display.set_mode(view.Sizes.SCREEN_SIZE)
76 concept_forest = view.ConceptForest()
77 gui = view.Gui(screen, concept_forest)
78
79
80=== modified file 'play_button.xml'
81--- play_button.xml 2008-09-10 05:37:51 +0000
82+++ play_button.xml 2009-04-05 04:05:37 +0000
83@@ -1,2 +1,1 @@
84-<control>Speak
85-</control>
86+<control>Speak</control>
87
88=== modified file 'undo_button.xml'
89--- undo_button.xml 2008-09-10 05:37:51 +0000
90+++ undo_button.xml 2009-04-05 04:05:37 +0000
91@@ -1,2 +1,1 @@
92-<control>Undo
93-</control>
94+<control>Undo</control>
95
96=== modified file 'view.py'
97--- view.py 2008-09-14 19:12:03 +0000
98+++ view.py 2009-04-05 03:26:03 +0000
99@@ -34,20 +34,23 @@
100 import xml.etree.ElementTree
101 from pygame import Rect, image
102 from time import sleep
103-from olpcgames import pangofont
104+#from olpcgames import pangofont
105 # Pangofont may be optimized for internationalization on the OLPC.
106
107
108 class Sizes():
109- CONCEPT_FONT_SIZE = 6
110- CATEGORY_FONT_SIZE = 7
111- BUTTON_FONT_SIZE = 9
112- BUFFER_FONT_SIZE = 12
113- CONCEPT_HOVER_SIZE = 30
114- CONCEPT_BRANCH_RADIUS = 52
115- CATEGORY_HOVER_SIZE = 46
116- CATEGORY_BKG_SIZE = 76
117- BUTTON_SIZE = 150
118+ OLPC_SCREEN_SIZE = (1200,900) #OLPC XO 1 native resolution
119+ SCREEN_SCALE = 1.0
120+ CONCEPT_FONT_SIZE = 6*2*SCREEN_SCALE
121+ CATEGORY_FONT_SIZE = 7*2*SCREEN_SCALE
122+ BUTTON_FONT_SIZE = 9*2*SCREEN_SCALE
123+ BUFFER_FONT_SIZE = 12*2*SCREEN_SCALE
124+ SCREEN_SIZE = (OLPC_SCREEN_SIZE[0]*SCREEN_SCALE, OLPC_SCREEN_SIZE[1]*SCREEN_SCALE)
125+ CONCEPT_HOVER_SIZE = 30*SCREEN_SCALE
126+ CONCEPT_BRANCH_RADIUS = 52*SCREEN_SCALE
127+ CATEGORY_HOVER_SIZE = 46*SCREEN_SCALE
128+ CATEGORY_BKG_SIZE = 76*SCREEN_SCALE
129+ BUTTON_SIZE = 150*SCREEN_SCALE
130
131
132 class Gui():
133@@ -69,11 +72,11 @@
134 self.speech_buffer = model.Buffer(self)
135 self.widgets = []
136 self.clear_button = model.ClearButton(self, self.concept_forest.clear_button_tree._root.text)
137- self.clear_button.position_center = (100, 750)
138+ self.clear_button.position_center = (100*Sizes.SCREEN_SCALE, 750*Sizes.SCREEN_SCALE)
139 self.undo_button = model.UndoButton(self, self.concept_forest.undo_button_tree._root.text)
140- self.undo_button.position_center = (275, 750)
141+ self.undo_button.position_center = (275*Sizes.SCREEN_SCALE, 750*Sizes.SCREEN_SCALE)
142 self.speak_button = model.SpeakButton(self, self.concept_forest.play_button_tree._root.text)
143- self.speak_button.position_center = (925, 750)
144+ self.speak_button.position_center = (925*Sizes.SCREEN_SCALE, 750*Sizes.SCREEN_SCALE)
145 #self.test_category = model.Category(self, "test category")
146 #self.test_category.position_center = (200, 550)
147 #self.test_concept = model.Concept(self, "test concept", "icons/AAC device.png")
148@@ -109,15 +112,15 @@
149 )
150 concept = model.Concept(gui, concept_branch.text)
151 # Graphics are stored at large size for nice look when large, and scaled down for small view.
152- concept.icon = Img(img = os.path.join(concept_branch.attrib['icon']), size = .5)
153- concept.icon_small = Img(img = os.path.join(concept_branch.attrib['icon']), size = .15)
154+ concept.icon = Img(img = os.path.join(concept_branch.attrib['icon']), size = .5*Sizes.SCREEN_SCALE)
155+ concept.icon_small = Img(img = os.path.join(concept_branch.attrib['icon']), size = .15*Sizes.SCREEN_SCALE)
156 concept.position_center = vector.sum(category.position_center, center_position_vector)
157 #gui.categories.append(concept)
158 concept_current_angle = concept_current_angle - concept_spacing_angle
159
160- create_section(self, 0, concept_forest.subjects_tree._root, (230, 250))
161- create_section(self, 1, concept_forest.actions_tree._root, (600, 525))
162- create_section(self, 2, concept_forest.objects_tree._root, (970, 250))
163+ create_section(self, 0, concept_forest.subjects_tree._root, (230*Sizes.SCREEN_SCALE, 250*Sizes.SCREEN_SCALE))
164+ create_section(self, 1, concept_forest.actions_tree._root, (600*Sizes.SCREEN_SCALE, 525*Sizes.SCREEN_SCALE))
165+ create_section(self, 2, concept_forest.objects_tree._root, (970*Sizes.SCREEN_SCALE, 250*Sizes.SCREEN_SCALE))
166
167
168 class ConceptForest():
169@@ -168,12 +171,14 @@
170
171 def render(self):
172 # This font may only be testable on the OLPC.
173- self.font = pangofont.PangoFont(size = self.size)
174+ #self.font = pangofont.PangoFont(size = self.size)
175+ # test of cross-platform font
176+ self.font = pygame.font.SysFont('Arial', self.size)
177 # Pygame font.size function
178 # (which measures pixel size of a rendered text block after rendering it)
179 # is easily confused with the size attribute of pangofont
180 # (which pre-specifies height of the text).
181- self.image = self.font.render(self.text, color = Colors.BLACK)
182+ self.image = self.font.render(self.text, True, Colors.BLACK)
183
184
185 class Vector():
186@@ -303,12 +308,12 @@
187 text_object = Text(self.text)
188 text_object.set_size(Sizes.BUFFER_FONT_SIZE)
189 text_object.render()
190- gui.screen.blit(text_object.image, (100, 800))
191+ gui.screen.blit(text_object.image, (100*Sizes.SCREEN_SCALE, 800*Sizes.SCREEN_SCALE))
192 # Draw text for a title
193 text_object = Text("Free Icon-To-Speech")
194- text_object.set_size(8)
195+ text_object.set_size(12*2*Sizes.SCREEN_SCALE)
196 text_object.render()
197- gui.screen.blit(text_object.image, (530, 10))
198+ gui.screen.blit(text_object.image, (530*Sizes.SCREEN_SCALE, 10*Sizes.SCREEN_SCALE))
199 return
200
201 raise Exception("Never found a draw function for this class: " + self.__class__.__name__)
202@@ -321,4 +326,4 @@
203 gui.screen.blit(self.surface, self.surface_positioning_rect)
204 gui.screen.blit(self.text_object.image, self.text_object_positioning_rect)
205 pygame.display.flip()
206- sleep(.1) # Allow button to stay yellow for a bit
207\ No newline at end of file
208+ sleep(.1) # Allow button to stay yellow for a bit

Subscribers

People subscribed via source and target branches

to all changes: