]> git.donarmstrong.com Git - lilypond.git/commitdiff
* mf/*, buildscipts/* : Backport 1.7 changes. Fixes problems with
authorMats Bengtsson <mats.bengtsson@s3.kth.se>
Mon, 10 Feb 2003 15:41:17 +0000 (15:41 +0000)
committerMats Bengtsson <mats.bengtsson@s3.kth.se>
Mon, 10 Feb 2003 15:41:17 +0000 (15:41 +0000)
incorrect font naming in .pfa files (i.e. broken PDF output).

15 files changed:
ChangeLog
buildscripts/make-font-dir.py
buildscripts/mf-to-table.py
mf/GNUmakefile
mf/feta-autometric.mf
mf/feta-beugel.mf
mf/feta-din-code.mf
mf/feta-din.mf
mf/feta-generic.mf
mf/feta-nummer-code.mf
mf/feta-nummer.mf
mf/feta-toevallig.mf
mf/parmesan-clefs.mf
mf/parmesan-generic.mf
mf/parmesan-heads.mf

index e2411b398110eab6fb664477560d0d1c660c4439..d93060360f2368ba090cddc2decc3e170a458250 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-02-10  Mats Bengtsson  <mats.bengtsson@s3.kth.se>
+
+       * mf/*, buildscipts/* : Backport 1.7 changes. Fixes problems with 
+       incorrect font naming in .pfa files (i.e. broken PDF output).
+
 2003-01-20  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * make/lilypond.redhat.spec.in: set docdir to %{_docdir}/lilypond/
index bacceab6648d360b4864fdef75cdbedc2a8695fe..5814fbab8b266a16cd08d855148da762669ff9d0 100644 (file)
 #!@PYTHON
 
 
+
 ## make a fonts.scale file.
 
+
 import re
 import sys
 import string
+import os
+
+
+### mftrace/afm.py
+
+# Read some global vars 
+class Afm_reader:
+       def __init__ (self, filename):
+               self.filename = filename
+               self.lines = open (self.filename).readlines ()
+
+       def get_afm (self):
+               afm = Afm_font_metric (self.filename)
+               for i in self.lines[:20]:
+                       m = re.match ('([^ \t\n]*)[ \t]*(.*[^ \t\n])', i)
+                       if m and m.group (1):
+                               key = m.group (1)
+                               value = m.group (2)
+                               if key != 'Comment':
+                                       afm.__dict__[key] = value
+               return afm
+
+class Afm_font_metric:
+       def __init__ (self, filename):
+               m = re.match ('.*/(.+)', filename)
+               self.filename = m.group (1)
+               m = re.match ('([-_A-Za-z]*)([0-9]*)', self.filename)
+               self.name = m.group (1) + m.group (2)
+               self.basename = m.group (1)
+               self.designsize = m.group (2)
+       
+def read_afm_file (filename):
+       reader = Afm_reader (filename)
+       return reader.get_afm ()
+
+#if __name__ == '__main__':
+#      i = read_afm_file  (sys.argv[1])
+#      print i, i.FullName, i.FontName
+
+### mftrace
+
+class Font_info:
+       cm = {
+               'bx': ('bold', 'roman'),
+               'bxti' : ('bold', 'italic'),
+               'csc' : ('smallcaps', 'roman'),
+               'r' : ('regular', 'roman'),
+               'tt' : ('regular', 'typewriter'),
+               'ti' : ('regular', 'italic'),
+               }
+             
+       def set_defaults (self, name):
+               self.FontName = name
+               self.FullName = name
+               self.EncodingScheme = 'AdobeStandard'
+               
+               self.foundry = 'GNU'
+               self.family = 'LilyPond'
+               self.weight = 'Feta'
+               self.slant = 'r'
+               self.setwidth = 'normal'
+               self.style = ''
+               self.pixelsize = '0'
+               self.pointsize = '0'
+               self.xresolution = '0'
+               self.yresolution = '0'
+               self.spacing = 'p'
+               self.averagewidth = '0'
+               self.registry = 'GNU'
+               self.encoding = 'FontSpecific'
+
+               split = string.split (name, '-')
+               if len (split) >= 4:
+                       # Assume
+                       #   Adobe FontName = X11 foundry-family-weight-style
+                       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)
+                       self.designsize = self.style
+               elif name[:2] == 'cm':
+                       self.foundry = 'TeX' # Knuth?
+                       self.FamilyName = 'Computer Modern'
+                       self.family = self.FamilyName
+                       m = re.match ('^cm([a-z]*)([0-9]*)', name)
+                       self.weight = string.join (self.cm[m.group (1)], ' ')
+                       self.designsize = m.group (2)
+                       self.style = self.designsize
+               else:
+                       self.FamilyName = name
+
+       def __init__ (self, x):
+               if type (x) == type ("hallo"):
+                       m = re.match ('([-_A-Za-z]*)([0-9]*)', x)
+                       self.name = x
+                       self.basename = m.group (1)
+                       self.designsize = m.group (2)
+                       self.set_defaults (x)
+               elif type (x) == type ({}):
+                       self.set_defaults (x['FontName'])
+                       for k in x.keys ():
+                               self.__dict__[k] = x[k]
+
+       def __getitem__ (self, key):
+               return self.__dict__[key]
+
+       def get_X11 (self):
+               return (self.foundry, self.family, self.weight,
+                       self.slant, self.setwidth, self.style,
+                       self.pixelsize, self.pointsize,
+                       self.xresolution, self.yresolution,
+                       self.spacing, self.averagewidth,
+                       self.registry, self.encoding)
+
+fontinfo = {}
+
+# wat een intervaas...
 ls =  sys.stdin.readline ()
 ls = string.split (ls)
-print len(ls)
-for fn in ls:
-    name = re.sub ('\.pf[ab]', '',fn)    
-    name = re.sub ('-', ' ',name)
-
-    m = re.search ("([0-9]+)$", name)
-    designsize = 'normal'
-    if m:
-        designsize =  m.group (1)
-        name = re.sub ("([0-9]+)$", "", name)
-        
-    print '%s -lilypond-%s-regular-r-%s--0-0-0-0-p-0-adobe-fontspecific' % (fn, name, designsize)
-    
-    
+
+sketch_p = 0
+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 or sodipodi_p):
+       print len(ls)
+       
+for filename in ls:
+       basename = re.sub ('\.pf[ab]', '',filename)     
+       fontname = re.sub ('-', ' ',basename)
+
+       m = re.search ("([0-9]+)$", fontname)
+       designsize = 'normal'
+
+       
+       if m:
+               designsize =  m.group (1)
+               fontbase = re.sub ("([0-9]+)$", "", fontname)
+               
+
+       # FIXME: Font naming  -- what a mess
+       # Check sane naming with xfontsel and gtkfontsel
+
+       # Adobe's font naming scheme and X11's seem to be conflicting.
+       # Adobe's FontFamily seems to be X11's family + weight
+       # Also, text selection applets like gtkfontsel, gfontview and
+       # GNOME-applications specific ones, display X11's `family'
+       # parameter as `Font', and X11's `Weight' parameter as `Style'.
+
+       # Using X11 description/convention -- good for xfontsel:
+       #  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:
+
+       #  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
+       # foundry: GNU
+       
+       ## ouch, pointsize 20 crashes xfs
+       ## XXXfeta20.pfa -GNU-LilyPond Feta-regular-r-normal--0-20-0-0-p-0-gnu-fontspecific
+
+       ## feta20.pfa -GNU-LilyPond feta-regular-r-normal-20-0-0-0-0-p-0-gnu-fontspecific
+
+       afmfile = ''
+       if not afmfile:
+               #afmfile = find_file (basename + '.afm')
+               afmfile = basename + '.afm'
+               
+       if afmfile:
+               afmfile = os.path.abspath (afmfile)
+       if os.path.exists (afmfile):    
+               afm = read_afm_file (afmfile)
+               fontinfo = Font_info (afm.__dict__)
+       else:
+               fontinfo = Font_info (basename)
+               
+       family_name = string.join (string.split (fontinfo['FamilyName'],
+                                                       '-'), ' ')
+
+       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 ()[:4], '-'),
+                                 string.join (fontinfo.get_X11 ()[-2:], '-'),
+                                 fontinfo.name],
+                                ',')
+               print s
+
+               s = string.join ([fontinfo.FamilyName + fontinfo.designsize,
+                                 fontinfo.family,
+                                 '%s %s' % (fontinfo.weight, fontinfo.style),
+                                 string.join (fontinfo.get_X11 ()[:4], '-'),
+                                 string.join (fontinfo.get_X11 ()[-2:], '-'),
+                                 fontinfo.name],
+                                ',')
+               print s
+       else:
+               print filename + ' -' + string.join (fontinfo.get_X11 (), '-')
index 998893c9f0e596cb690a4454b407270d568afbe7..0bb63b0412efa5b9532828180aba7c7d66a022c7 100644 (file)
@@ -56,7 +56,9 @@ def tfm_checksum (fn):
                shift = shift - 8
 
        return cs
-  
+
+## ugh.  What's font_family supposed to be?  It's not an afm thing.
+font_family = 'feta'
 def parse_logfile (fn):
        (autolines, deps) = read_log_file (fn)
        charmetrics = []
@@ -80,11 +82,26 @@ def parse_logfile (fn):
                                }
                        charmetrics.append (m)
                elif tags[0] == 'font':
-                       global_info['FontName'] = string.join (tags[1:])
-                       global_info['FontFamily']=tags[1]
+                       global font_family
+                       font_family = (tags[3])
+                       # To omit 'GNU' (foundry) from font name proper:
+                       # name = tags[2:]
+                       #urg
+                       if 0: #testing
+                               tags.append ('Regular')
+                       name = tags[1:]
+                       global_info['FontName'] = string.join (name,'-')
+                       global_info['FullName'] = string.join (name,' ')
+                       global_info['FamilyName'] = string.join (name[1:-1],
+                                                                '-')
+                       if 1:
+                               global_info['Weight'] = tags[4]
+                       else: #testing
+                               global_info['Weight'] = tags[-1]
                        global_info['FontBBox'] = '0 0 1000 1000'
                        global_info['Ascender'] = '0'
                        global_info['Descender'] = '0'
+                       global_info['EncodingScheme'] = 'FontSpecific'
        
        return (global_info, charmetrics, deps)
 
@@ -102,23 +119,24 @@ def write_afm_char_metric(file, charmetric):
        
        
        file.write ('C %d ; WX %d ; N  %s ;  B %d %d %d %d ;\n'% tup)
-       
+
+def write_afm_header (file):
+       file.write ("StartFontMetrics 2.0\n")
+       file.write ("Comment Automatically generated by mf-to-table.py\n")
+
 def write_afm_metric (file, global_info, charmetrics):
-       file.write (r"""
-StartFontMetrics 2.0
-Comment Automatically generated by mf-to-table.py
-""")
        for (k,v) in global_info.items():
                file.write ("%s %s\n" % (k,v))
        file.write ('StartCharMetrics %d\n' % len(charmetrics ))
        for m in charmetrics:
                write_afm_char_metric (file,m)
        file.write ('EndCharMetrics\n')
-       file.write ('EndFontMetrics %d\n')
+       file.write ('EndFontMetrics\n')
 
 
 def write_tex_defs (file, global_info, charmetrics):
-       nm = global_info['FontFamily']
+       ##nm = global_info['FontFamily']
+       nm = font_family
        for m in charmetrics:
                file.write (r'''\gdef\%s%s{\char%d}%%%s''' % (nm, m['tex'], m['code'],'\n'))
        file.write ('\\endinput\n')
@@ -134,7 +152,8 @@ def write_ps_encoding (file, global_info, charmetrics):
        file.write ('] def\n')
        
 def write_fontlist (file, global_info, charmetrics):
-       nm = global_info['FontFamily']
+       ##nm = global_info['FontFamily']
+       nm = font_family
        file.write (r"""
 % Lilypond file to list all font symbols and the corresponding names
 % Automatically generated by mf-to-table.py
@@ -232,9 +251,10 @@ for filenm in files:
        cs = tfm_checksum (re.sub ('.log$', '.tfm', filenm))
        afm = open (afmfile_nm, 'w')
 
-       afm.write ("TfmCheckSum %u\n" % cs) 
+       write_afm_header (afm)
+       afm.write ("Comment TfmCheckSum %u\n" % cs)
+       write_afm_metric (afm, g, m)
        
-       write_afm_metric (afm, g,m)
        write_tex_defs (open (texfile_nm, 'w'), g, m)
        write_ps_encoding (open (enc_nm, 'w'), g, m)
        
index 8d1574848d5698bd83d3cbd23c7cc50d9c0d0ff6..ce0405733e8b4ce62a5668a94261da6d1ad2c116 100644 (file)
@@ -3,34 +3,28 @@ depth = ..
 STEPMAKE_TEMPLATES=metafont install install-out
 LOCALSTEPMAKE_TEMPLATES=asciifont
 
-
 include $(depth)/make/stepmake.make 
 
 AF_FILES = $(wildcard *.af) 
 
 EXTRA_DIST_FILES += README feta.tex
 
-# don't try to make fonts from test files
-TEST_FILES = $(wildcard *test*.mf)
-FET_FILES = $(filter-out $(TEST_FILES),\
-       $(wildcard feta[0-9]*.mf) $(wildcard parmesan[0-9]*.mf))\
-       $(wildcard feta-braces*[0-9].mf)
-
-FONT_FILES = $(filter-out $(TEST_FILES),\
-       $(wildcard feta*[0-9].mf) $(wildcard parmesan*[0-9].mf)) \
+# We don't use $(MF_FILES), because there's more .mf cruft here
+FETA_MF_FILES = $(wildcard feta[0-9]*.mf)\
+       $(wildcard feta-braces*[0-9].mf)\
+       $(wildcard feta-din*[0-9].mf)\
+       $(wildcard feta-nummer*[0-9].mf)\
+       $(wildcard parmesan[0-9]*.mf)
 
-XPM_FONTS = feta20 feta-nummer10 feta-braces20
-#CM_AFM_FILES = cmr10
+FETA_FONTS = $(FETA_MF_FILES:.mf=)
 
-$(outdir)/cmr10.afm:
-       -$(GUILE) $(buildscript-dir)/tfm2oafm.scm `kpsewhich cmr10.tfm`
-       -mv $(@F) $@
+XPM_FONTS = feta20 feta-din10 feta-nummer10 feta-braces20 parmesan20
 
-LOG_FILES = $(addprefix $(outdir)/, $(FET_FILES:.mf=.log) $(PARMESAN_FILES:.mf=.log))
-TEXTABLES = $(addprefix $(outdir)/, $(FET_FILES:.mf=.tex) $(PARMESAN_FILES:.mf=.tex))
-AFM_FILES = $(addprefix $(outdir)/, $(FET_FILES:.mf=.afm) $(PARMESAN_FILES:.mf=.afm) $(AF_FILES:.af=.afm) $(addsuffix .afm, $(CM_AFM_FILES)))
-ENC_FILES=$(TEXTABLES:.tex=.enc)
-TFM_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.tfm))
+LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
+TEXTABLES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tex)
+AFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.afm)
+ENC_FILES = $(TEXTABLES:.tex=.enc)
+TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm)
 
 
 # Make tfm files first, log files last, 
@@ -55,10 +49,21 @@ INSTALLATION_OUT_FILES3=$(TFM_FILES)
 # comment this out if you don't want pfa's to be generated
 # making pfas takes a lot of CPU time. Let's skip it for now.
 #MAKE_PFA_FILES=1
+#MAKE_PFB_FILES=1
+
+SAUTER_FONTS = cmbxti7 cmbxti8 cmbxti12 cmbxti14 \
+       cmcsc7 cmcsc12 cmtt17 cmbx14 cmbx17
+
+ALL_FONTS = $(FETA_FONTS) $(SAUTER_FONTS)
+
 
+PFA_FILES = $(ALL_FONTS:%=$(outdir)/%.pfa)
+PFB_FILES = $(PFA_FILES:%.pfa=%.pfb)
 
-SAUTER_FONT_FILES=cmbxti7 cmbxti8 cmbxti12  cmbxti14 cmcsc7 cmcsc12 cmtt17 cmbx14 cmbx17
-PFA_FILES= $(addprefix $(outdir)/, $(addsuffix .pfa, $(SAUTER_FONT_FILES)) $(FONT_FILES:.mf=.pfa)) 
+ifdef MAKE_PFB_FILES
+MAKE_PFA_FILES = 1
+ALL_GEN_FILES += $(PFB_FILES)
+endif
 
 ifdef MAKE_PFA_FILES
 ALL_GEN_FILES += $(PFA_FILES) $(outdir)/lilypond.map $(outdir)/fonts.scale
@@ -67,16 +72,11 @@ INSTALLATION_OUT_FILES4=$(PFA_FILES) $(outdir)/fonts.scale
 
 INSTALLATION_OUT_DIR5=$(local_lilypond_datadir)/dvips/
 INSTALLATION_OUT_FILES5=$(outdir)/lilypond.map
-
 endif
 
-$(outdir)/lilypond.map: 
-       echo $(notdir $(PFA_FILES:.pfa=)) | tr ' ' '\n' | \
-               sed 's/\(.*\)/\1 \1 <\1.pfa/' > $@
-
-$(outdir)/fonts.scale:
-       echo $(FONT_FILES:.mf=.pfa) | $(PYTHON) $(topdir)/buildscripts/make-font-dir.py  > $@
-
+ifdef MAKE_PFB_FILES
+INSTALLATION_OUT_FILES4 +=$(PFB_FILES)
+endif
 
 export MFINPUTS:=.:$(MFINPUTS)
 
@@ -84,16 +84,54 @@ default: $(ALL_GEN_FILES)
 
 ##
 ## todo: this also depends on .tfm, FIXME.
-$(outdir)/%.afm  $(outdir)/%.enc  $(outdir)/%.tex $(outdir)/%.dep: $(outdir)/%.log 
+$(outdir)/%.afm  $(outdir)/%.enc  $(outdir)/%.tex $(outdir)/%.dep: $(outdir)/%.log $(outdir)/%.tfm
        $(PYTHON) $(buildscript-dir)/mf-to-table.py --package=$(topdir) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep)  --afm $(outdir)/$(<F:.log=.afm)  --enc $(outdir)/$(<F:.log=.enc) --tex $(outdir)/$(<F:.log=.tex) --ly $(outdir)/$(<F:.log=list.ly) $<
 
+fontdir: $(addprefix $(outdir)/, lilypond.map lilypond.sfd private-fonts fonts.scale fonts.dir)
+
+## Urg
+mapentry=$(1) $(shell fgrep FontName $(outdir)/$(1).afm | sed -e 's/FontName *//') <$(1).pfaX
+
+map = $(foreach a,$(2),$(call $(1),$(a)))
+$(outdir)/lilypond.xmap: $(AFM_FILES)
+       echo '$(call map,mapentry,$(ALL_FONTS))' | \
+               tr 'X' '\n' | sed -e 's/^ *//'> $@
+
+# using shell for loop seems most robust
+$(outdir)/lilypond.map: $(AFM_FILES)
+       for i in $(FETA_FONTS); do echo $$i $$(fgrep FontName $(outdir)/$$i.afm | sed -e 's/FontName *//') '<'$$i.pfa; done > $@
+       for i in $(SAUTER_FONTS); do echo "$$i $$i <$$i.pfa"; done >> $@
+
+
+$(outdir)/fonts.scale: $(PFA_FILES)
+#      cd $(outdir) && echo $(FETA_MF_FILES:.mf=.pfa) $(FETA_MF_FILES:.mf=.pfb) | $(PYTHON) $(topdir)/buildscripts/make-font-dir.py  > $(@F)
+       cd $(outdir) && echo *.pfa *.pfb | $(PYTHON) $(topdir)/buildscripts/make-font-dir.py  > $(@F)
+
+$(outdir)/fonts.dir: $(outdir)/fonts.scale
+       cd $(outdir) && mkfontdir
+
+# Sketch map file
+$(outdir)/lilypond.sfd:
+#      cd $(outdir) && echo sketch $(FETA_MF_FILES:.mf=.pfa) | $(PYTHON) $(topdir)/buildscripts/make-font-dir.py  > $(@F)
+       cd $(outdir) && echo sketch *.pfa | $(PYTHON) $(topdir)/buildscripts/make-font-dir.py  > $(@F)
+
+# Sodipodi map file
+SODIPODI_FONTS = parmesan20 feta-braces0 feta-nummer10 feta20
+$(outdir)/private-fonts:
+       cd $(outdir) && echo sodipodi $(SODIPODI_FONTS:%=%.pfa) | $(PYTHON) $(topdir)/buildscripts/make-font-dir.py  > $(@F)
+
 local-clean:
        rm -f mfplain.mem mfplain.log 
        rm -f *.tfm *.log
 
-pfa: $(PFA_FILES)   $(outdir)/lilypond.map $(outdir)/fonts.scale
+afm: $(AFM_FILES)
+pfa: afm $(PFA_FILES) fontdir
+pfb: afm $(PFB_FILES) fontdir
 
 # needed for web documentation
-$(addprefix $(outdir)/, $(SAUTER_FONT_FILES:=.pfa)):
-       $(foreach i, $(SAUTER_FONT_FILES), \
+$(SAUTER_FONTS:%=$(outdir)/%.pfa):
+       $(foreach i, $(SAUTER_FONTS), \
                $(MFTRACE) -I $(outdir)/ --pfa --simplify --keep-trying $(i) && mv $(i).pfa $(outdir)/ && ) true
+$(SAUTER_FONTS:%=$(outdir)/%.pfb):
+       $(foreach i, $(SAUTER_FONTS), \
+               $(MFTRACE) -I $(outdir)/ --pfa --pfb --simplify --keep-trying $(i) && mv $(i).pfb $(i).pfa $(outdir)/ && ) true
index 2484a23b4a42f190bbd6ad49bf9cf36746f4b030..08b30d0b587b6b77a2ce2440123e2234026a9821 100644 (file)
@@ -20,7 +20,7 @@ message "******************************************************";
 def fet_beginfont(expr name,size) =
        font_identifier:=name&decimal size;
        font_size size;
-       message "@{font@:"&name&"@:"&decimal size&"@}";
+       message "@{font@:GNU@:LilyPond@:"&name&"@:"&decimal size&"@}";
        message "";
        enddef;
 
index 8f779e1c6894a129cc70ef503c45f2d59eff9d24..61ec9abec0624cf8b284d2ba0cb511abf1077ce3 100644 (file)
@@ -2,6 +2,9 @@ input feta-autometric;
 input feta-macros;
 input feta-params;
 
+font_coding_scheme "feta braces";
+
+
 fet_beginfont("feta-braces", 16);
 mode_setup;
 
index e457b64ad2cedb7af31b1a741bb32cc35c0265d7..0523d2189a1dc17f939fc932256ea43e7999d2a5 100644 (file)
@@ -6,6 +6,11 @@ med_thick = round (1.5 stafflinethickness);
 bottom_blot = 1.3 serif_thick;
 
 
+code := 32;
+fet_beginchar("Space", "space", "space")
+       set_char_box(0, horizontal_space#,  0, ex#);
+fet_endchar;
+
 
 %
 % Couldn't find many z examples. This one is losely inspired 
index 00d7211031f18499dd01bbaf96d086e6a0115a93..861959b9e2352ae6c4310001081c98f5c215c69d 100644 (file)
@@ -14,6 +14,11 @@ ascender# := 0.72 ex#;
 staffspace# := 1.75 / 2.0 * ex#;
 stafflinethickness# := staffspace# / 10;
 
+horizontal_space# :=  .66 ex#;
+
+font_x_height ex#;
+font_normal_space horizontal_space#;
+
 define_pixels (staffspace, stafflinethickness, ex, descender, ascender);
 
 fet_beginfont("feta-din", design_size);
index f23426bf6a538c9b935844333791ef2d2a1dffb7..188f060b7d515c203329e2a32aa1faf89b763680 100644 (file)
@@ -39,11 +39,11 @@ if test = 0:
        input feta-solfa;
        
 else:
-       input feta-bolletjes;   
+%      input feta-bolletjes;   
 %      input feta-banier;
 %      input feta-eindelijk;
 %      input feta-klef;
-%      input feta-toevallig;
+       input feta-toevallig;
 %      input feta-schrift;
 %      input feta-haak;
 %      input feta-timesig;
index 28bd3b7a0d60e5b3225a005194edf8f69d69e596..aef2e9168be6f46225b8d1802643fde22e5767bd 100644 (file)
@@ -317,6 +317,11 @@ fet_beginchar("Numeral 2", "2", "two")
 
 fet_endchar;
 
+
+%%
+% TODO: should widen a bit. The right edge of the 3 bumps into next glyph in
+% combinations 
+%
 fet_beginchar("Numeral 3", "3", "three")
        set_char_box(0, 2/3height#*widen, 0, height#);
        message "w:"&decimal w;
@@ -579,3 +584,6 @@ fet_endchar;
 
 fet_endgroup("number")
 
+ligtable "3" : "3" kern 0.1 space#,  "0" kern 0.1 space#; 
+ligtable "2" : "7" kern 0.15 space#;
+
index bdefb0680915385c93651b05ab0abc388d74e9c8..c7c24fdf29dfaaf9e8898d1a7c9c733ec601e0a2 100644 (file)
@@ -20,6 +20,7 @@ space# := design_size/2;
 
 font_x_height height#;
 font_normal_space space#;
+font_coding_scheme "feta number";
 
 
 %
index b9e2b48fab06e24f99020da18f743cbb9d93756c..ab16af7d91fb9fa511011d507ef6e41c1fff956c 100644 (file)
@@ -171,8 +171,13 @@ def draw_meta_flat(expr xcenter, w, crook_fatness) =
        save top_stem_thick, bottom_stem_thick, hair, smaller_hole;
        save center;
        pair center;
+       save clearing;
        center = (xcenter, 0);
 
+% the shouldn't reach to the top staff line.
+%% TODO: should take from height.
+       clearing = 1.2 stafflinethickness; 
+
 %
 %  TODO: parameterize  this
 %
@@ -181,12 +186,12 @@ def draw_meta_flat(expr xcenter, w, crook_fatness) =
        else:
                smaller_hole = 0.0 stafflinethickness;
        fi
-       crook_thinness = 1.1 stafflinethickness;
-       top_stem_thick = 2 stafflinethickness;
+       crook_thinness = 1.25 stafflinethickness;
+       top_stem_thick = 2.2 stafflinethickness;
        bottom_stem_thick = 1.2 stafflinethickness;
 
 
-       z1 = (0, 2 staff_space) + center;
+       z1 = (0, 2 staff_space) + center - (0, stafflinethickness/2 + clearing);
        z2 = (0, - 1/2 staff_space)+  center;
 
        penpos1(top_stem_thick, 0);
@@ -251,8 +256,8 @@ enddef;
 % unfortunately, 600dpi is not enough to show the brush of the stem.
 %
 fet_beginchar("Flat", "-1", "flat")
-       set_char_box(1.2 stafflinethickness#, .8 staff_space#, 0.6 staff_space#, 2 staff_space#);
-       draw_meta_flat(0, w, 1/3 staff_space);
+       set_char_box(1.2 stafflinethickness#, .8 staff_space#, 0.6 staff_space#, 1.9 staff_space#);
+       draw_meta_flat(0, w, 0.31 staff_space);
        fet_endchar;
 
 
@@ -261,10 +266,10 @@ fet_beginchar("Double Flat", "-2", "flatflat")
        left_wid = .7;
        right_wid = .8;
        overlap = .05;
-       set_char_box(1.2 stafflinethickness#, (left_wid + right_wid -overlap) *staff_space#, .6 staff_space#, 2 staff_space#);
+       set_char_box(1.2 stafflinethickness#, (left_wid + right_wid -overlap) *staff_space#, .6 staff_space#, 1.9 staff_space#);
        draw_meta_flat(0, left_wid*  staff_space, 1/3 staff_space);
        draw_meta_flat((left_wid - overlap) *staff_space,  
-               right_wid *staff_space, 1/3 staff_space);
+               right_wid *staff_space, 0.33 staff_space);
        fet_endchar;
 
 fet_beginchar("Double Sharp", "2", "sharpsharp")
index de7bb2af77b4f09b338f8c23b33c39852ee9031c..d7ba3f5797fa13e00e05dc3565ebf4f9847a6415 100644 (file)
@@ -695,7 +695,7 @@ def draw_petrucci_g_clef(expr exact_center, reduction) =
        % inspired by Josquin Desprez, "Stabat Mater", Libro tertio,
        % 1519, printed by Petrucci, in: MGG, volume 7, Table 11.
 
-       set_char_box(0.6 staff_space#, 0.8 staff_space#, 0.6 staff_space#, 
+       set_char_box(1.0 staff_space#, 0.5 staff_space#, 0.6 staff_space#, 
          4.0 staff_space#);
 
        save reduced_il, reduced_slt;
index 4ded9c8c04ceadc58d3f7256e7444256cc903606..b7e699bd7220a5f814c9ed59515583f3535b77dd 100644 (file)
@@ -1,3 +1,4 @@
+
 % -*-Fundamental-*-
 % parmesan-generic.mf --  implement generic stuff: include lots of files,
 % but don't set dims.
index 49c964d93752faa5efd3215f659da63cd67e077c..3f15e6428b336d1a1fce937323c06d0242ab0401 100644 (file)
@@ -309,7 +309,7 @@ def punctum_char (expr verbose_name, internal_name, mudela_name,
                2beta# = ht# * b_h;
                a# = beta# * a_b;
                wd# = 2a# / a_w;
-               set_char_box(0.50wd#, 0.10wd#, 0.5ht#, 0);
+               set_char_box(0.00wd#, 0.40wd#, 0.5ht#, 0);
                black_notehead_width# := wd#;
 
                % direction
@@ -439,7 +439,7 @@ def inclinatum_char(expr verbose_name, internal_name, mudela_name,
                2beta# = ht# * b_h;
                a# = beta# * a_b;
                wd# = 2a# / a_w;
-               set_char_box(0.3wd#, 0.3wd#, 0.5 ht#, 0.5 ht#);
+               set_char_box(0.2wd#, 0.2wd#, 0.5 ht#, 0.5 ht#);
                black_notehead_width# := wd#;
 
                save za, alpha, size;
@@ -572,7 +572,8 @@ fet_beginchar("Ed. Vat. quilisma", "vaticana_quilisma", "vatquilismahead")
        2beta# = ht#*b_h;
        a# = beta#*a_b;
        wd# = 2a# / a_w;
-       set_char_box(0.4wd#, 0.00wd#, 0.5 ht#, 0.5 ht#);
+       set_char_box(0.5stafflinethickness#, 0.40wd# + 0.5stafflinethickness#,
+                    0.31 ht#, 0.41 ht#);
        black_notehead_width# := wd#;
 
        define_pixels(ht, wd);
@@ -633,7 +634,7 @@ fet_beginchar("Solesmes oriscus", "solesmes_oriscus",
        2beta# = ht# * b_h;
        a# = beta# * a_b;
        wd# = 2a# / a_w;
-       set_char_box(0.5wd#, 0.0wd#, 0.5ht#, 0.5ht#);
+       set_char_box(0.0wd#, 0.5wd#, 0.5ht#, 0.5ht#);
        black_notehead_width# := wd#;
 
        save convexity;