Skip to content

Commit

Permalink
Freetype support in Keyboard
Browse files Browse the repository at this point in the history
Also updated gitignore for .ds files.
  • Loading branch information
furmada committed Dec 4, 2016
1 parent b83ea0f commit 11ad1ee
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@ docs/donau.ogg
.settings/
.project
.pydevproject
*.ds
11 changes: 7 additions & 4 deletions pyos.py
Expand Up @@ -1803,7 +1803,8 @@ def __init__(self, textEntryField=None):
self.baseContainer.setPosition((0, 2*(state.getGUI().height/3)))
self.keyWidth = self.baseContainer.computedWidth / 10
self.keyHeight = self.baseContainer.computedHeight / 4
if state.getTypingFont().freetype:
use_ft = state.getTypingFont().freetype != False
if use_ft:
self.shift_sym = u"\u21E7"
self.enter_sym = u"\u23CE"
self.bkspc_sym = u"\u232B"
Expand Down Expand Up @@ -1833,18 +1834,20 @@ def __init__(self, textEntryField=None):
button = GUI.KeyboardButton((sym * self.keyWidth, row * self.keyHeight), "", self.keys2[row][sym],
onClick=self.insertChar, onClickData=(self.keys1[row][sym],),
onLongClick=self.insertChar, onLongClickData=(self.keys2[row][sym],),
width=self.keyWidth*5, height=self.keyHeight)
width=self.keyWidth*5, height=self.keyHeight, freetype=use_ft)
else:
if symbol == self.shift_sym or symbol == self.enter_sym or symbol == self.bkspc_sym or symbol == self.delet_sym:
button = GUI.KeyboardButton((sym * self.keyWidth, row * self.keyHeight), self.keys1[row][sym], self.keys2[row][sym],
onClick=self.insertChar, onClickData=(self.keys1[row][sym],),
onLongClick=self.insertChar, onLongClickData=(self.keys2[row][sym],),
width=self.keyWidth, height=self.keyHeight, border=1, borderColor=state.getColorPalette().getColor("accent"))
width=self.keyWidth, height=self.keyHeight, border=1, borderColor=state.getColorPalette().getColor("accent"),
freetype=use_ft)
else:
button = GUI.KeyboardButton((sym * self.keyWidth, row * self.keyHeight), self.keys1[row][sym], self.keys2[row][sym],
onClick=self.insertChar, onClickData=(self.keys1[row][sym],),
onLongClick=self.insertChar, onLongClickData=(self.keys2[row][sym],),
width=self.keyWidth, height=self.keyHeight)
width=self.keyWidth, height=self.keyHeight,
freetype=use_ft)
self.baseContainer.addChild(button)
sym += 1
row += 1
Expand Down
1 change: 0 additions & 1 deletion res/dev-appdb-tool.ds

This file was deleted.

1 change: 0 additions & 1 deletion res/dev-hub.ds

This file was deleted.

1 change: 0 additions & 1 deletion res/gallery.ds

This file was deleted.

1 change: 0 additions & 1 deletion res/pman.ds

This file was deleted.

1 change: 0 additions & 1 deletion res/todo.ds

This file was deleted.

0 comments on commit 11ad1ee

Please sign in to comment.