]> git.donarmstrong.com Git - lilypond.git/blobdiff - buildscripts/make-font-dir.py
* input/test/ambitus-mixed.ly (texidoc): new file.
[lilypond.git] / buildscripts / make-font-dir.py
index 5248380d06d5451b061067fc448d6e0efb4a33c9..5814fbab8b266a16cd08d855148da762669ff9d0 100644 (file)
@@ -70,7 +70,7 @@ class Font_info:
                self.slant = 'r'
                self.setwidth = 'normal'
                self.style = ''
-               self.pixelsize = '' # '0'
+               self.pixelsize = '0'
                self.pointsize = '0'
                self.xresolution = '0'
                self.yresolution = '0'
@@ -83,7 +83,11 @@ class Font_info:
                if len (split) >= 4:
                        # Assume
                        #   Adobe FontName = X11 foundry-family-weight-style
-                       self.foundry, self.family = split[:2]
+                       if 1:
+                               self.foundry, self.family = split[:2]
+                       else: # testin'
+                               self.foundry = split[0]
+                               self.family = string.join (split[1:-2], ' ')
                        self.weight = string.join (split[2:-1], ' ')
                        self.style = split[-1:][0]
                        self.FamilyName = '%s %s' % (self.family, self.weight)
@@ -129,11 +133,15 @@ ls =  sys.stdin.readline ()
 ls = string.split (ls)
 
 sketch_p = 0
-if len (ls) and ls[0] == 'sketch':
+sodipodi_p = 0
+if len (ls) and ls[0] == 'sodipodi':
+       ls = ls[1:]
+       sodipodi_p = 1
+elif len (ls) and ls[0] == 'sketch':
        ls = ls[1:]
        sketch_p = 1
 
-if not sketch_p:
+if not (sketch_p or sodipodi_p):
        print len(ls)
        
 for filename in ls:
@@ -159,40 +167,40 @@ for filename in ls:
        # parameter as `Font', and X11's `Weight' parameter as `Style'.
 
        # Using X11 description/convention -- good for xfontsel:
-       # foundry: GNU
-       # family: LilyPond <basename>
-       # weight: <designsize>
-       # slant: r(oman) =upright
-       # setwidth: normal
-       # style:
-       # pixelsize: 0
-       # pointsize: 0 (20 crashes xfs, moved to style)
-       # xresolution: 0
-       # yresolution: 0
-       # spacing: p(roportional)
-       # averagewidth: 0
-       # registry: GNU
-       # encoding: fonstpecific
+       #  1 foundry: GNU
+       #  2 family: LilyPond <basename>
+       #  3 weight: <designsize>
+       #  4 slant: r(oman) =upright
+       #  5 setwidth: normal
+       #  6 style:
+       #  7 pixelsize: 0
+       #  8 pointsize: 0 (20 crashes xfs, moved to style)
+       #  9 xresolution: 0
+       # 10 yresolution: 0
+       # 11 spacing: p(roportional)
+       # 12 averagewidth: 0
+       # 13 registry: GNU
+       # 14 encoding: fonstpecific
 
        # gives:
        # feta20.pfa -GNU-LilyPond feta-20-r-normal--0-0-0-0-p-0-gnu-fontspecific
 
        # However, GNOME (gtkfontsel, gnome apps) seems to want:
 
-       # foundry: GNU
-       # family: LilyPond
-       # weight:  <basename>
-       # slant: r(oman) =upright
-       # setwidth: normal
-       # style: <designsize>
-       # pixelsize: 0
-       # pointsize: 0 (20 crashes xfs, moved to style)
-       # xresolution: 0
-       # yresolution: 0
-       # spacing: p(roportional)
-       # averagewidth: 0
-       # registry: GNU
-       # encoding: fonstpecific
+       #  1 foundry: GNU
+       #  2 family: LilyPond
+       #  3 weight:  <basename>
+       #  4 slant: r(oman) =upright
+       #  5 setwidth: normal
+       #  6 style: <designsize>
+       #  7 pixelsize: 0
+       #  8 pointsize: 0 (20 crashes xfs, moved to style)
+       #  9 xresolution: 0
+       # 10 yresolution: 0
+       # 11 spacing: p(roportional)
+       # 12 averagewidth: 0
+       # 13 registry: GNU
+       # 14 encoding: fonstpecific
 
        # which gives:
        # feta20.pfa -GNU-LilyPond-feta-r-normal--20-0-0-0-p-0-gnu-fontspecific
@@ -218,25 +226,33 @@ for filename in ls:
                
        family_name = string.join (string.split (fontinfo['FamilyName'],
                                                        '-'), ' ')
-       if not sketch_p:
-               print filename + ' -' + string.join (fontinfo.get_X11 (), '-')
-               
-       else:
+
+       if sodipodi_p:
+               print string.join ((os.path.abspath (filename),
+                                   fontinfo.FamilyName,
+                                   fontinfo.FamilyName,''
+                                   ),
+                                  
+                                  ',')
+                                  
+       elif sketch_p:
                # Sketch's lilypond.sfd map:
                s = string.join ([fontinfo.FontName,
                                  fontinfo.family,
                                  '%s %s' % (fontinfo.weight, fontinfo.style),
-                                 string.join (fontinfo.get_X11 ()[:5], '-'),
-                                 string.join (fontinfo.get_X11 ()[:-2], '-'),
+                                 string.join (fontinfo.get_X11 ()[:4], '-'),
+                                 string.join (fontinfo.get_X11 ()[-2:], '-'),
                                  fontinfo.name],
                                 ',')
                print s
 
-               s = string.join ([fontinfo.FamilyName,
+               s = string.join ([fontinfo.FamilyName + fontinfo.designsize,
                                  fontinfo.family,
                                  '%s %s' % (fontinfo.weight, fontinfo.style),
-                                 string.join (fontinfo.get_X11 ()[:5], '-'),
-                                 string.join (fontinfo.get_X11 ()[:-2], '-'),
+                                 string.join (fontinfo.get_X11 ()[:4], '-'),
+                                 string.join (fontinfo.get_X11 ()[-2:], '-'),
                                  fontinfo.name],
                                 ',')
                print s
+       else:
+               print filename + ' -' + string.join (fontinfo.get_X11 (), '-')