#! perl

# Author          : Johan Vromans
# Created On      : Tue Apr 19 16:25:30 2011
# Last Modified By: Johan Vromans
# Last Modified On: Sat Apr 19 21:49:47 2014
# Update Count    : 49
# Status          : Unknown, Use with caution!

package App::Music::PlayTab::Output::PostScript::Preamble;

use strict;
use warnings;

our $VERSION = "1.003";

sub preamble {
<<'EOD';
%!PS-Adobe-2.0
%%Pages: (atend)
%%DocumentFonts: Helvetica
%%EndComments
%%BeginProcSet: Symbols 0
/tabdict 50 dict def
tabdict begin
/m { moveto } bind def
/glyphwidth { % name *glyphwidth* wx wy
    gsave nulldevice 0 0 moveto glyphshow currentpoint grestore
} bind def
/rshow {
    dup stringwidth pop 2 div neg 0 rmoveto show
} bind def
/dim {
    currentpoint
    /MSyms findfont 7 scalefont setfont
    1 8 rmoveto /Dim glyphshow moveto } def
/hdim {
    currentpoint
    /MSyms findfont 7 scalefont setfont
    1 8 rmoveto /HDim glyphshow moveto } def
/minus {
    currentpoint
    /Symbol findfont 12 scalefont setfont
    1 8 rmoveto (-) show moveto } def
/plus {
    currentpoint
    /Symbol findfont 12 scalefont setfont
    1 8 rmoveto (+) show moveto } def
/delta {
    /MSyms findfont 6 scalefont setfont
    1 -3 rmoveto /Major glyphshow -1 3 rmoveto } def
/sharp {
    /MSyms findfont sfsz scalefont setfont
    sfsz 5 gt { 2 } { 1 } ifelse 2 rmoveto
    /Sharp glyphshow
    sfsz 5 gt { 2 } { 1 } ifelse neg -2 rmoveto } def
/flat {
    /MSyms findfont sfsz scalefont setfont
    sfsz 5 gt { 2 } { 1 } ifelse 2 rmoveto
    /Flat glyphshow
    %sfsz 5 gt { 2 } { 1 } ifelse neg -2 rmoveto
    1 -2 rmoveto } def
/natural {
    /MSyms findfont 20 scalefont setfont
    2 0 rmoveto /Natural glyphshow -1 0 rmoveto } def
/addn {
    /Helvetica findfont 12 scalefont setfont
    0 -3 rmoveto show 0 3 rmoveto } def
/adds {
    /MSyms findfont 5 scalefont setfont
    1 -1 rmoveto /Sharp glyphshow 1 1 rmoveto
    /Helvetica findfont 12 scalefont setfont
    0 -3 rmoveto show 0 3 rmoveto } def
/addf {
    /MSyms findfont 5 scalefont setfont
    1 -1 rmoveto /Flat glyphshow 1 1 rmoveto
    /Helvetica findfont 12 scalefont setfont
    0 -3 rmoveto show 0 3 rmoveto } def
/root {
    /Helvetica findfont 16 scalefont setfont
    show
    /sfsz 6 def
} def
/hroot {
    /Helvetica findfont 12 scalefont setfont
    show
    /sfsz 4 def
} def
/slash {
    /Helvetica findfont 16 scalefont setfont
    2 -4 rmoveto (/) show } def
/bslash {
    /Helvetica findfont 16 scalefont setfont
    0 4 rmoveto (\\) show 0 3 rmoveto } def
/susp {
    /Helvetica findfont 12 scalefont setfont
    0 -3 rmoveto (sus) show show 0 3 rmoveto } def
/bar {
    1 setlinewidth
    currentpoint 0 -3 rmoveto 0 16 rlineto stroke moveto } def
/barn {
    gsave /Helvetica findfont 8 scalefont setfont
    % 0 14 rmoveto dup stringwidth pop 2 div neg 0 rmoveto
    -2 8 rmoveto dup stringwidth pop neg 0 rmoveto
    show grestore
    bar
    } def
/same1 {
    /MSyms findfont 4 scalefont setfont
    /Same2 dup glyphwidth pop 2 div neg 0 rmoveto glyphshow } def
/rest {
    /Helvetica findfont 16 scalefont setfont
    /endash glyphshow } def
/TF {
    /Helvetica findfont 16 scalefont setfont } def
/SF {
    /Helvetica findfont 12 scalefont setfont } def
end
%%EndProcSet
%%BeginProcSet: Grid 0 0
% Routines for the drawing of chords.
/griddict 10 dict def
griddict begin
  /gridscale $std_gridscale def
  /gridwidth gridscale 5 mul def
  /gridheight gridscale 4 mul def
  /half-incr gridscale 2 div def
  /dot-size gridscale 0.35 mul def
  /displ-font /Times-Roman findfont gridscale 1.25 mul scalefont def

  /grid {				% -- grid --
    gsave currentpoint
    6
    { 0 gridheight rlineto gridscale gridscale gridwidth sub rmoveto }
    repeat
    moveto
    5
    { gridwidth 0 rlineto 0 gridwidth sub gridscale rmoveto }
    repeat
    stroke grestore
  } def

  /dot {				% string fret dot --
    gsave
    exch 6 exch sub gridscale mul	% str fret -> fret y
    exch dup 5 exch abs sub gridscale mul half-incr sub	% fret y -> y fret x
    exch 3 1 roll rmoveto

    % It is tempting to use the more enhanced format (that places o
    % and x above the grid) but there is a chord caption.
    % fret {...} --
    -1 ne
    { currentpoint dot-size 0 360 arc fill }
    { gsave
      gridwidth 20 div
	    dup neg dup rmoveto
	    dup dup rlineto
	    dup dup rlineto
	    dup neg dup rmoveto
	    dup dup neg exch rmoveto
	    dup dup neg rlineto
	        dup neg rlineto
      gridwidth 50 div setlinewidth stroke
      grestore
    } ifelse
    grestore
  } def	
end
tabdict begin
/dots {				% e a d g b e offset dots --
    griddict begin
    gsave
    1 setlinewidth
    0 setgray

    grid

    % Chord offset, if greater than 1.
    % offset {...} --
    dup () ne
    { gsave
      half-incr neg gridheight gridscale sub rmoveto
      displ-font setfont
      dup stringwidth pop neg half-incr rmoveto show grestore
    }
    { pop }
    ifelse

    1 1 6
    {	% fret string {...} --
	exch dup
	0 ne
	{ dot }
	{ pop pop }
	ifelse
    }
    for
    end
} def
end
%%EndProcSet
%%EndProlog
%%BeginFont: MSyms
%!PS-AdobeFont-1.0: MSyms 000.100
%%Title: MSyms
%Version: 000.100
%%CreationDate: Fri Dec  7 13:24:47 2012
%%Creator: Johan Vromans
%Copyright: Free as a bird
% 2012-12-7: Created.
% Generated by FontForge 20120731 (http://fontforge.sf.net/)
%%EndComments

10 dict begin
/FontType 1 def
/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def
/FontName /MSyms def
/FontBBox {0 -1561 2494 2089 }readonly def
/PaintType 0 def
/FontInfo 9 dict dup begin
 /version (000.100) readonly def
 /Notice (Free as a bird) readonly def
 /FullName (Musical Symbols For Playtab) readonly def
 /FamilyName (MusicalSymbolsForPlaytab) readonly def
 /Weight (Medium) readonly def
 /ItalicAngle 0 def
 /isFixedPitch false def
 /UnderlinePosition -100 def
 /UnderlineThickness 50 def
end readonly def
/Encoding 256 array
 0 1 255 { 1 index exch /.notdef put} for
dup 33/Sharp put
dup 34/Flat put
dup 35/Natural put
dup 36/Same2 put
dup 37/Dim put
dup 38/HDim put
dup 39/Major put
readonly def
currentdict end
currentfile eexec

5E9431F964843C7C14CF7F664CF6
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
cleartomark
%%EndFont
%%BeginSetup
%%PaperSize: A4
%%EndSetup
EOD
}

1;

__END__

=head1 NAME

App::Music::PlayTab::PostScript::Preamble - PostScript preamble.

=head1 DESCRIPTION

This is an internal module for the App::Music::PlayTab application.
