#
#  Shell script for creating  thompson2.mpf
#  (part of the project MayaPS v 1.0, November 12, 2012)
#
#  This file can be used as a sample for creating a new MayaPS font
#  for mayaps.tex (v 0.24 of higher).
#  In this case the string "(XIV)" in the first line of the header
#  should be replaced by the numeral's initial characters string of the
#  font which is being created (for example, "(89)" for codex.mpf)
#
cat >mpf.mpf <<!
%
%  The font  thompson2.mpf v 2
%  for mayaps (v 0.24 and higher)
%  Glyphs and Tables updated by Bruno Delprat September 4, 2010
%
%  Author: Bruno Delprat
%  Created from bitmap images using cotrace/makefont
%
%  This LIMITED DEMO font contains 13 fixed square elements and 24 rotating affixes,
%  out of original 494 affixes, 450 main signs & 159 portraits from Thompson tables.
%

%V@ v 2, Oct 23, 2012

%%%%%%%%  The header for fonts produced by cotrace with -c option %%%%%%%%%
userdict begin MayaDict begin (XIV) 20 NewFont
%
% D,B,T,F,RD,l,d,ND,p,g,FN,A,Z,R,U,V,P,fn,Ft
%
/D{def}def/B{bind D}bind D/T{true}D/F{false}D/RD{readonly def}B/l{length}D/d{dup}D
/ND{noaccess def}B/X{exch}B/p 0 D/g 33 D/M(MayaT1f0pppppppp)D/FN{M 16 string copy d 7
4 gi iFont X cvs l 8 add 2 copy 5 2 roll 4 gi cvs l add 0 X gi}B/Z{show GEnd}B/A{0 0
moveto cvn findfont 1000 scalefont setfont}B/U{d 1 fn put d 3 get 0 g put B Ft begin
/CharStrings CharStrings d l 1 add dict copy d begin}B/V{1 index X ND end/Encoding
Encoding 256 array copy d g 5 4 roll put RD D end fn cvn Ft d l dict copy definefont
pop/g g 1 add d 256 eq{pop 33/p p 1 add D}if D}B/P{g 33 eq{/fn p FN D/Ft 11 dict def Ft
begin/FontInfo 7 dict d begin/version(1.0)RD/ItalicAngle 0 D/isFixedPitch F D/FullName
(MayaPS Font)RD end RD/FontName fn cvn D/Weight(Medium)RD/FamilyName(MayaPS Font)
RD/FontBBox{0 0 1000 1000}RD/PaintType 0 D/FontType 1 D/FontMatrix[.001 0 0 .001 0 0]RD
/Encoding 256 array 0 1 255{1 index exch/.notdef put}for RD end Ft/Private 16 dict d
begin/ND{noaccess def}executeonly D/BlueValues[-10 0]D/MinFeature{16 16}D/password 5839
D Ft/CharStrings 1 dict d begin/.notdef<7f2e4d927d91633f4a>ND end end put put}if}B

end end end
%%%%%%%%%% End of the header for fonts produced by cotrace -c %%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Table of Ligatures (substitutions)
%

%M@  (no substitutions in thompson2.mpf)
!
# To include a file `foo.txt' with definitions of substitutions,
# remove the '#' in the next line

# cat foo.txt >> mpf.mpf

cat >> mpf.mpf <<!

%@

userdict begin MayaDict begin 1000 0 AddGlyphs

%M@  Irregular Affixes

!
./addglyph T19   a "[()(r)(|)(r)(r)]"
./addglyph T58a  a "[()(r)(|)(r)()]"
./addglyph T59a  a "[()(r)(|)(r)()]"
./addglyph T612  a "[()(|r)(|)(|r)(|r)]"

cat >>mpf.mpf <<!

%M@  Regular Affixes

!
./addglyph T1    a
./addglyph T15   a
./addglyph T24   a
./addglyph T25   a
./addglyph T47   a
./addglyph T70   a
./addglyph T103  a
./addglyph T130  a
./addglyph T140  a "[()(|r)(|)(R)(|r)]"
./addglyph T152a a
./addglyph T168  a "[()(|r)(|)(R)(|r)]"
./addglyph T171  a

cat >>mpf.mpf <<!

%M@  Numerals (affixes)

!
./addglyph IIIn  a "[()(|r)(|)(R)(|r)]"
./addglyph IVn   a "[()(|r)(|)(R)(|r)]"
./addglyph VIn   a "[()(|r)(|)(R)(|r)]"
./addglyph VIIn  a "[()(|r)(|)(R)(|r)]"
./addglyph VIIIn a "[()(|r)(|)(R)(|r)]"
./addglyph XIn   a "[()(|r)(|)(R)(|r)]"
./addglyph XIIIn a "[()(|r)(|)(R)(|r)]"
./addglyph XVIn  a "[()(|r)(|)(R)(|r)]"

cat >>mpf.mpf <<!

%M@  Central Elements

%@ T0
/aT0 F D/wT0 100 D/hT0 100 D/mT0{}D
!
./addglyph	T533	c
./addglyph	T560	c
./addglyph	T567	c
./addglyph	T568b	c
./addglyph	T613	c
./addglyph	T648	c
./addglyph	T736a	c
./addglyph	T748	c
./addglyph	T791a   c
./addglyph	T1009c	c
./addglyph	T1018a	c
./addglyph	T1047a	c
./addglyph	T1026	c

cat >>mpf.mpf <<!
%@
end end end end
!
mv mpf.mpf thompson2.mpf
