Utilisation de la police "Arial Unicode.ttf" qui comporte le caractère « ♭ ».
authorpin <pin@fe552daf-6dbe-4428-90eb-1537e0879342>
Fri, 9 Apr 2010 09:52:12 +0000 (09:52 +0000)
committerpin <pin@fe552daf-6dbe-4428-90eb-1537e0879342>
Fri, 9 Apr 2010 09:52:12 +0000 (09:52 +0000)
git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@132 fe552daf-6dbe-4428-90eb-1537e0879342

src/app/config.py
src/app/fonts/Arial Unicode.ttf [new file with mode: 0644]
src/app/musicxml.py

index ebca47b..2de1b90 100755 (executable)
@@ -8,6 +8,15 @@ $URL$
 
 import pygame
 import os.path
+
+_here = os.path.abspath(__file__).split(os.path.sep)[:-1]
+def _computePath(path) :
+    path = path.split('/')
+    path = _here + path
+    path = os.path.abspath(os.path.sep.join(path))
+    return path
+
+
 pygame.font.init()
 
 
@@ -22,11 +31,12 @@ ON_BOTTOM_LUMINANCE = 0.9
 ON_SATURATION = 1
 ON_COLUMN_OVERSIZING = 2
 ON_COLUMN_ALPHA = 1
-FONT = pygame.font.Font(None, 80)
+font_file = _computePath('fonts/Arial Unicode.ttf')
+FONT = pygame.font.Font(font_file, 50)
 FONT_COLOR = (0,0,0)
 DEFAULT_MIDI_VELOCITY = 96
 
-SONG_FILE_PATH = '../../chansons'
+SONG_FILE_PATH = _computePath('../../chansons')
 
 INSTRUMENTS = (
     {'name'   : 'accordeon',
@@ -70,11 +80,3 @@ INSTRUMENTS = (
      'octave' : -2
     },
 )
-
-# cuisine : ne pas modifier
-_here = os.path.abspath(__file__).split(os.path.sep)[:-1]
-SONG_FILE_PATH = SONG_FILE_PATH.split('/')
-SONG_FILE_PATH = _here + SONG_FILE_PATH
-SONG_FILE_PATH = os.path.abspath(os.path.sep.join(SONG_FILE_PATH))
-
-
diff --git a/src/app/fonts/Arial Unicode.ttf b/src/app/fonts/Arial Unicode.ttf
new file mode 100644 (file)
index 0000000..1537c5b
Binary files /dev/null and b/src/app/fonts/Arial Unicode.ttf differ
index 9302118..ec3be4a 100755 (executable)
@@ -244,7 +244,7 @@ class Tone(object) :
     def name(self) :
         name = '%s%d' % (self.step, self.octave)
         if self.alter < 0 :
-            alterext = 'b'
+            alterext = ''
         else :
             alterext = '#'
         name = '%s%s' % (name, abs(self.alter) * alterext)
@@ -254,10 +254,10 @@ class Tone(object) :
     def nom(self) :
         name = FR_NOTES[self.step]
         if self.alter < 0 :
-            alterext = 'b'
+            alterext = u'♭'
         else :
-            alterext = '#'
-        name = '%s%s' % (name, abs(self.alter) * alterext)
+            alterext = u'#'
+        name = u'%s%s' % (name, abs(self.alter) * alterext)
         return name