Blame


1 13f7391e 2004-05-15 devnull %
2 13f7391e 2004-05-15 devnull % An example logo character. Building the PostScript program that prints
3 13f7391e 2004-05-15 devnull % your company logo is not addressed here; we assume you already have
4 13f7391e 2004-05-15 devnull % such a program, that it's relatively simple, and that it prints the
5 13f7391e 2004-05-15 devnull % logo by itself on a page. What you'll find here are instructions for
6 13f7391e 2004-05-15 devnull % converting that logo program into a character that can be accessed by
7 13f7391e 2004-05-15 devnull % troff and dpost.
8 13f7391e 2004-05-15 devnull %
9 13f7391e 2004-05-15 devnull % Building a new charlib character involves some PostScript programming.
10 13f7391e 2004-05-15 devnull % We've tried to isolate parameters that you'll need to change (Xoffset,
11 13f7391e 2004-05-15 devnull % Yoffset, and Scaling), but we can't guarantee things will work properly
12 13f7391e 2004-05-15 devnull % with every logo program. PostScript is a complex language and subtle
13 13f7391e 2004-05-15 devnull % interactions between your logo program and what we've done here can
14 13f7391e 2004-05-15 devnull % cause problems.
15 13f7391e 2004-05-15 devnull %
16 13f7391e 2004-05-15 devnull % Tuning the new character is an iterative process. You may want to adjust
17 13f7391e 2004-05-15 devnull % the size of the logo (via Scaling), it's position relative to adjacent
18 13f7391e 2004-05-15 devnull % characters and the baseline (Xoffset and Yoffset), and the distance troff
19 13f7391e 2004-05-15 devnull % moves after printing the character (width field in file ../S1). The steps
20 13f7391e 2004-05-15 devnull % to follow are:
21 13f7391e 2004-05-15 devnull %
22 13f7391e 2004-05-15 devnull % 1: Create a simple troff test file for the new character. Something
23 13f7391e 2004-05-15 devnull % like,
24 13f7391e 2004-05-15 devnull %
25 13f7391e 2004-05-15 devnull % .sp 1i
26 13f7391e 2004-05-15 devnull % .ps 10
27 13f7391e 2004-05-15 devnull % size 10: \(LH
28 13f7391e 2004-05-15 devnull % .sp 1i
29 13f7391e 2004-05-15 devnull % .ps 18
30 13f7391e 2004-05-15 devnull % size 18: \(LH
31 13f7391e 2004-05-15 devnull % .sp 1i
32 13f7391e 2004-05-15 devnull % .ps 36
33 13f7391e 2004-05-15 devnull % size 36: \(LH
34 13f7391e 2004-05-15 devnull % .sp 1i
35 13f7391e 2004-05-15 devnull % .ps 10
36 13f7391e 2004-05-15 devnull % four logo characters: \(LH\(LH\(LH\(LH
37 13f7391e 2004-05-15 devnull %
38 13f7391e 2004-05-15 devnull % is sufficient. The test file can go anywhere.
39 13f7391e 2004-05-15 devnull %
40 13f7391e 2004-05-15 devnull % 2: Change into directory /usr/lib/font/devpost/charlib. All file
41 13f7391e 2004-05-15 devnull % pathnames will be relative to that directory.
42 13f7391e 2004-05-15 devnull %
43 13f7391e 2004-05-15 devnull % 3: Save a copy of the working LH logo file. Then replace LH with
44 13f7391e 2004-05-15 devnull % this file (i.e. LH.example). Changes described below should be
45 13f7391e 2004-05-15 devnull % be made in the new LH file (not in LH.example).
46 13f7391e 2004-05-15 devnull %
47 13f7391e 2004-05-15 devnull % 4: Your PostScript logo program will eventually replace whatever
48 13f7391e 2004-05-15 devnull % you find between the <<StartLogo>> and <<EndLogo>> comment lines
49 13f7391e 2004-05-15 devnull % in the PostScript build_LH procedure (below). What's there now
50 13f7391e 2004-05-15 devnull % prints an example logo that you can use until you understand the
51 13f7391e 2004-05-15 devnull % remaining steps.
52 13f7391e 2004-05-15 devnull %
53 13f7391e 2004-05-15 devnull % 5: Print your troff test file using (assuming your making changes
54 13f7391e 2004-05-15 devnull % in the devpost charlib directory),
55 13f7391e 2004-05-15 devnull %
56 13f7391e 2004-05-15 devnull % troff -Tpost testfile | dpost | lp ...
57 13f7391e 2004-05-15 devnull %
58 13f7391e 2004-05-15 devnull % 6: Adjust the logo positioning by changing the numbers assigned to
59 13f7391e 2004-05-15 devnull % Xoffset and Yoffset (below). Both are in units of 72 per inch.
60 13f7391e 2004-05-15 devnull % Positive offsets should move the logo to the right and up the
61 13f7391e 2004-05-15 devnull % page.
62 13f7391e 2004-05-15 devnull %
63 13f7391e 2004-05-15 devnull % 7: Adjust the logo size by changing the the number assigned to
64 13f7391e 2004-05-15 devnull % Scaling. Unitsize also controls scaling, but there's no good
65 13f7391e 2004-05-15 devnull % reason to change both Scaling and Unitsize.
66 13f7391e 2004-05-15 devnull %
67 13f7391e 2004-05-15 devnull % 8: Control the horizontal distance troff moves after printing the
68 13f7391e 2004-05-15 devnull % new LH character by changing the width (i.e. the number in the
69 13f7391e 2004-05-15 devnull % second column) assigned to LH in file ../S1. Character width
70 13f7391e 2004-05-15 devnull % adjustments should probably wait until you're satisfied with
71 13f7391e 2004-05-15 devnull % the Scaling set in step 7.
72 13f7391e 2004-05-15 devnull %
73 13f7391e 2004-05-15 devnull % 9: Back to step 5 until your satisfied with the output.
74 13f7391e 2004-05-15 devnull %
75 13f7391e 2004-05-15 devnull % The remaining steps are suggested but not required:
76 13f7391e 2004-05-15 devnull %
77 13f7391e 2004-05-15 devnull % 10: Delete PostScript comments in your new LH charlib file - comments
78 13f7391e 2004-05-15 devnull % start with % and go to the end of the line.
79 13f7391e 2004-05-15 devnull %
80 13f7391e 2004-05-15 devnull % 11: Update the width field assigned to LH in file ../shell.lib. The
81 13f7391e 2004-05-15 devnull % new width should reflect what's currently in your S1 font file.
82 13f7391e 2004-05-15 devnull %
83 13f7391e 2004-05-15 devnull % 12: Make a similiar set of changes in /usr/lib/font/devLatin1/charlib.
84 13f7391e 2004-05-15 devnull % You can use the devpost version of LH to devLatin1/charlib/LH,
85 13f7391e 2004-05-15 devnull % but changes to files devLatin1/S1 and devLatin1/shell.lib must be
86 13f7391e 2004-05-15 devnull % entered by hand.
87 13f7391e 2004-05-15 devnull %
88 13f7391e 2004-05-15 devnull
89 13f7391e 2004-05-15 devnull /Logo_Dict 100 dict dup begin
90 13f7391e 2004-05-15 devnull /Xoffset 0 def % 72 dpi with positive to the right
91 13f7391e 2004-05-15 devnull /Yoffset 0 def % 72 dpi with positive up the page
92 13f7391e 2004-05-15 devnull /Scaling 1.0 def % adjust this number to change the size
93 13f7391e 2004-05-15 devnull /Unitsize 36 def % for point size scaling - leave it be
94 13f7391e 2004-05-15 devnull /showpage {} def
95 13f7391e 2004-05-15 devnull end def
96 13f7391e 2004-05-15 devnull
97 13f7391e 2004-05-15 devnull /build_LH { % don't bind this procedure
98 13f7391e 2004-05-15 devnull Logo_Dict begin
99 13f7391e 2004-05-15 devnull gsave
100 13f7391e 2004-05-15 devnull /charwidth exch def
101 13f7391e 2004-05-15 devnull currentpoint translate
102 13f7391e 2004-05-15 devnull resolution 72 div dup scale
103 13f7391e 2004-05-15 devnull Xoffset Yoffset translate
104 13f7391e 2004-05-15 devnull Scaling Scaling scale
105 13f7391e 2004-05-15 devnull ptsize Unitsize div dup scale
106 13f7391e 2004-05-15 devnull
107 13f7391e 2004-05-15 devnull %% Replace everything between the <<StartLogo>> and <<EndLogo>>
108 13f7391e 2004-05-15 devnull %% comment lines by the PostScript program that prints your
109 13f7391e 2004-05-15 devnull %% logo.
110 13f7391e 2004-05-15 devnull
111 13f7391e 2004-05-15 devnull %% <<StartLogo>>
112 13f7391e 2004-05-15 devnull newpath
113 13f7391e 2004-05-15 devnull .5 .5 scale
114 13f7391e 2004-05-15 devnull 0 0 moveto
115 13f7391e 2004-05-15 devnull 100 0 lineto
116 13f7391e 2004-05-15 devnull 100 100 lineto
117 13f7391e 2004-05-15 devnull closepath
118 13f7391e 2004-05-15 devnull .5 setgray
119 13f7391e 2004-05-15 devnull fill
120 13f7391e 2004-05-15 devnull 0 setgray
121 13f7391e 2004-05-15 devnull 10 10 translate
122 13f7391e 2004-05-15 devnull 45 rotate
123 13f7391e 2004-05-15 devnull 0 5 moveto
124 13f7391e 2004-05-15 devnull /Helvetica findfont 18 scalefont setfont
125 13f7391e 2004-05-15 devnull (Example Logo) show
126 13f7391e 2004-05-15 devnull %% <<EndLogo>>
127 13f7391e 2004-05-15 devnull
128 13f7391e 2004-05-15 devnull grestore
129 13f7391e 2004-05-15 devnull end
130 13f7391e 2004-05-15 devnull } def
131 13f7391e 2004-05-15 devnull