130 likes | 230 Views
Development of PostScript Procedures for Transformations of Digital Typography. Ph. D. Sc. Klaudio Pap, Ph. D. Sc. Vilko Žiljak. Faculty of Graphic Arts, Zagreb, Croatia. ICTVC Conference, 2007, Thessaloniki. Aim.
E N D
Development of PostScript Procedures for Transformations of Digital Typography Ph. D. Sc. Klaudio Pap, Ph. D. Sc. Vilko Žiljak Faculty of Graphic Arts, Zagreb, Croatia ICTVC Conference, 2007, Thessaloniki
Aim • to develop designer programmatical modules which has not existed in conventional graphic programs • researching of digital typography transformations which are based on the development of PostScript procedures • new possibilities of designing original typographic solutions
Em-Square transformations • Em-Square transformations according to transformation array (matrix) • Transformation matrix [a b c d tx ty ] defines linear transformation of the coordinated pair (x,y) into (x’,y’) as follows: x’=ax+cy+tx y’=bx+dy+ty
Em-Square transformations • By means of transformation matrix also are defined PostScript commands: translate, scale, rotate, scalefont: 10 20 translate => [1 0 0 1 1020] x’=x+10y’=y+20 24 scale => [2 0 0 4 00] x’=2xy’=4y 45 rotate => [cos(45) sin(45) -sin(45) cos(45) 0 0 ] x’=cos(45)x-sin(45)yy’=sin(45)x+cos(45)y 30 scalefont => [30 0 0 30 00] makefont x’=30xy’=30y
Em-Square transformations • Transformation of the font is executed by transforming the coordinated system of each character bounding box (Em-Square), while existing coordinated system stays intact • m a k e f o n t PostScript command provides forming new deformated (transformated) fonts: /fontname findfont [a b c d tx ty] makefont setfont Beginning of the new letter is defined by the movement of the s h o w command
Custom PostScript Typographic Procedures • k s h o w command enables the execution of the program procedure between every string character, as follows: {proc} string kshow 1. The first string character is drawn, and the current position is moved for the amount of a letter width; 2. Decimal number of ASCII of the first letter is set to stack, afterwards comes the second letter; 3. The procedure {proc} is executed; 4. Second letter is being printed… Procedure is not loaded before the first letter is shown. If the number of characters in the string is n, k s h o w command loads procedure n-1 time
Simple Program modules with combination Em-Square and custom functions • In our simple examples we use m a k e f o n t command in combination with k s h o w command • m a k e f o n t is used for Em-Square transformation • k s h o w is used for loading procedure n-1 time for n string characters and showing of characters
[k j 0 k 00] makefont x’=kxy’=jx+ky 200 300 moveto /j 140 def /jkorak -10 def /k 70 def /FSTimesRom findfont [k j 0 k 0 0 ] makefont setfont /H 0 def 1 18 div /Hkorak exch def 0 1 0.8 sethsbcolor { pop pop /FSTimesRom findfont [k j 0 k 0 0 ] makefont setfont /H H Hkorak add def /j j jkorak add def H 1 0.8 sethsbcolor } (Thessaloniki, 2007 Typography) kshow
[k 0 j k 00] makefont x’=kx+jyy’=jy 200 300 moveto /j 130 def /jkorak -10 def /k 70 def /FSTimesRom findfont [k 0 j k 0 0 ] makefont setfont /H 0 def 1 18 div /Hkorak exch def 0 1 0.8 sethsbcolor { pop pop /FSTimesRom findfont [k 0 j k 0 0 ] makefont setfont /H H Hkorak add def /j j jkorak add def H 1 0.8 sethsbcolor } ( Thessaloniki, 2007 Typography) kshow
[k j j k 00] makefont x’=kx+jyy’=jx+ky 20 300 moveto /j 140 def /jkorak -10 def /k 70 def /FSTimesRom findfont [k j j k 0 0 ] makefont setfont /H 0 def 1 18 div /Hkorak exch def 0 1 0.8 sethsbcolor { pop pop /FSTimesRom findfont [k j j k 0 0 ] makefont setfont /H H Hkorak add def /j j jkorak add def H 1 0.8 sethsbcolor } ( Thessaloniki, 2007 Typography) kshow
Complex Program module with combination Em-Square and custom function • in our complex program we use hybrid method of m a k e f o n t command in combination with k s h o w command • one control switch variable sklopka is implemented in k s h o w procedure for switching 3 different transformation matrices depending of j value • j value is changed in interval [130,-130] with step -10 starting from 130. When j is less or equal of -130 then j is reset on 130
200 100 moveto /j 130 def /jkorak -10 def /minj j neg def /maxj j def /k 70 def /m j def /n 0 def /sklopka 1 def /FSTimesRom findfont [k m n k 0 0 ] makefont setfont /H 0 def 1 18 div /Hkorak exch def 0 1 0.8 sethsbcolor { pop pop /FSTimesRom findfont [k m n k 0 0 ] makefont setfont -10 rotate /H H Hkorak add def H 1 0.8 sethsbcolor sklopka 1 eq {/m j def /n 0 def j 50 lt {/sklopka 2 def} if} if sklopka 2 eq {/m 0 def /n j def j 0 lt {/sklopka 3 def} if} if sklopka 3 eq {/m j def /n j def j minj le {/sklopka 1 def /j maxj def } if} if /j j jkorak add def } ( Thessaloniki, 2007 Digital Typography) kshow
Conclusion • Procedures are interpreted by PostScript interpreter for the given output resolution so their processing is on fastest possibly speed. • Procedures which are prepared in encapsulated format can be integrate with conventional vector graphics. • This work gives the contribution to the development of digital typography and typographic design through new native PostScript procedures and new possibilities of designing original typographic solutions