From 29114be0431e3cbfac15e5f332696c2ef41bdb6f Mon Sep 17 00:00:00 2001 From: Mats Bengtsson Date: Mon, 10 Feb 2003 15:41:17 +0000 Subject: [PATCH] * mf/*, buildscipts/* : Backport 1.7 changes. Fixes problems with incorrect font naming in .pfa files (i.e. broken PDF output). --- ChangeLog | 5 + buildscripts/make-font-dir.py | 262 ++++++++++++++++++++++++++++++++-- buildscripts/mf-to-table.py | 46 ++++-- mf/GNUmakefile | 104 +++++++++----- mf/feta-autometric.mf | 2 +- mf/feta-beugel.mf | 3 + mf/feta-din-code.mf | 5 + mf/feta-din.mf | 5 + mf/feta-generic.mf | 4 +- mf/feta-nummer-code.mf | 8 ++ mf/feta-nummer.mf | 1 + mf/feta-toevallig.mf | 19 ++- mf/parmesan-clefs.mf | 2 +- mf/parmesan-generic.mf | 1 + mf/parmesan-heads.mf | 9 +- 15 files changed, 401 insertions(+), 75 deletions(-) diff --git a/ChangeLog b/ChangeLog index e2411b3981..d93060360f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-02-10 Mats Bengtsson + + * 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 * make/lilypond.redhat.spec.in: set docdir to %{_docdir}/lilypond/ diff --git a/buildscripts/make-font-dir.py b/buildscripts/make-font-dir.py index bacceab664..5814fbab8b 100644 --- a/buildscripts/make-font-dir.py +++ b/buildscripts/make-font-dir.py @@ -1,24 +1,258 @@ #!@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 + # 3 weight: + # 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: + # 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 + + # 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 (), '-') diff --git a/buildscripts/mf-to-table.py b/buildscripts/mf-to-table.py index 998893c9f0..0bb63b0412 100644 --- a/buildscripts/mf-to-table.py +++ b/buildscripts/mf-to-table.py @@ -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) diff --git a/mf/GNUmakefile b/mf/GNUmakefile index 8d1574848d..ce0405733e 100644 --- a/mf/GNUmakefile +++ b/mf/GNUmakefile @@ -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)/$( $@ + +# 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 diff --git a/mf/feta-autometric.mf b/mf/feta-autometric.mf index 2484a23b4a..08b30d0b58 100644 --- a/mf/feta-autometric.mf +++ b/mf/feta-autometric.mf @@ -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; diff --git a/mf/feta-beugel.mf b/mf/feta-beugel.mf index 8f779e1c68..61ec9abec0 100644 --- a/mf/feta-beugel.mf +++ b/mf/feta-beugel.mf @@ -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; diff --git a/mf/feta-din-code.mf b/mf/feta-din-code.mf index e457b64ad2..0523d2189a 100644 --- a/mf/feta-din-code.mf +++ b/mf/feta-din-code.mf @@ -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 diff --git a/mf/feta-din.mf b/mf/feta-din.mf index 00d7211031..861959b9e2 100644 --- a/mf/feta-din.mf +++ b/mf/feta-din.mf @@ -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); diff --git a/mf/feta-generic.mf b/mf/feta-generic.mf index f23426bf6a..188f060b7d 100644 --- a/mf/feta-generic.mf +++ b/mf/feta-generic.mf @@ -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; diff --git a/mf/feta-nummer-code.mf b/mf/feta-nummer-code.mf index 28bd3b7a0d..aef2e9168b 100644 --- a/mf/feta-nummer-code.mf +++ b/mf/feta-nummer-code.mf @@ -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#; + diff --git a/mf/feta-nummer.mf b/mf/feta-nummer.mf index bdefb06809..c7c24fdf29 100644 --- a/mf/feta-nummer.mf +++ b/mf/feta-nummer.mf @@ -20,6 +20,7 @@ space# := design_size/2; font_x_height height#; font_normal_space space#; +font_coding_scheme "feta number"; % diff --git a/mf/feta-toevallig.mf b/mf/feta-toevallig.mf index b9e2b48fab..ab16af7d91 100644 --- a/mf/feta-toevallig.mf +++ b/mf/feta-toevallig.mf @@ -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") diff --git a/mf/parmesan-clefs.mf b/mf/parmesan-clefs.mf index de7bb2af77..d7ba3f5797 100644 --- a/mf/parmesan-clefs.mf +++ b/mf/parmesan-clefs.mf @@ -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; diff --git a/mf/parmesan-generic.mf b/mf/parmesan-generic.mf index 4ded9c8c04..b7e699bd72 100644 --- a/mf/parmesan-generic.mf +++ b/mf/parmesan-generic.mf @@ -1,3 +1,4 @@ + % -*-Fundamental-*- % parmesan-generic.mf -- implement generic stuff: include lots of files, % but don't set dims. diff --git a/mf/parmesan-heads.mf b/mf/parmesan-heads.mf index 49c964d937..3f15e6428b 100644 --- a/mf/parmesan-heads.mf +++ b/mf/parmesan-heads.mf @@ -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; -- 2.39.5