aboutsummaryrefslogtreecommitdiffstats
path: root/Lib/defconQt/fontView.py
diff options
context:
space:
mode:
authorAdrien Tétar2015-06-13 17:33:24 +0200
committerAdrien Tétar2015-06-13 17:33:24 +0200
commitf39997844c7f477ef9ba795349fa08f9817fdcac (patch)
treec11d36089ea316ccfafdec808f348b29bc740ef9 /Lib/defconQt/fontView.py
parent86ebcfe18ea1ece54b2716cedc7eb891cb1efe32 (diff)
downloadtrufont-f39997844c7f477ef9ba795349fa08f9817fdcac.tar.bz2
Fix for cross-platformness
Diffstat (limited to 'Lib/defconQt/fontView.py')
-rw-r--r--Lib/defconQt/fontView.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/defconQt/fontView.py b/Lib/defconQt/fontView.py
index b15ba66..d7665d9 100644
--- a/Lib/defconQt/fontView.py
+++ b/Lib/defconQt/fontView.py
@@ -295,7 +295,9 @@ class CharacterWidget(QWidget):
self._maybeDragPosition = None
if self.lastKey == -1:
if self._maybeDragPosition is None:
- self._selection = {(event.y() // self.squareSize) * self.columns + event.x() // self.squareSize}
+ key = (event.y() // self.squareSize) * self.columns + event.x() // self.squareSize
+ if key > len(self.glyphs)-1: return
+ self._selection = {key}
self.computeCharacterSelected()
else:
lastKey = self.lastKey if self.lastKey < len(self.glyphs) else len(self.glyphs)-1
@@ -368,6 +370,8 @@ class CharacterWidget(QWidget):
markGradient = QLinearGradient(0, 0, 0, self.squareSize-GlyphCellHeaderHeight)
headerFont = QFont()
headerFont.setFamily('Lucida Sans Unicode')
+ headerFont.insertSubstitution('Lucida Sans Unicode', 'Luxi Sans')
+ headerFont.setPointSize(8)
metrics = QFontMetrics(headerFont)
for row in range(beginRow, endRow + 1):