| 1 |
% This file defines the Metafont macros for producing fonts copto and copti: |
| 2 |
%copto ir "ordinary Coptic" and copti is "inclined Coptic". |
| 3 |
% |
| 4 |
% {limn output Sep 24 17:59:49 1995 from imageto output Sep 24 16:54:15 1995} |
| 5 |
% Generated Tue Dec 31 14:44:16 1996. |
| 6 |
% The original files were prepared by S. Rosmorduc in 1995; the necessity of |
| 7 |
% making postscrip outlines (with mftrace and pfaedit) and of extending the set of glyphs |
| 8 |
% with new signs required some modifications and a reorganization of the orignial material. |
| 9 |
% |
| 10 |
% The modifications were made by Claudio Beccari on Aug 3, 2004; the font and file names |
| 11 |
% were changed according to the prescriptions of the GNU GPL; see below. |
| 12 |
% |
| 13 |
% The bundle contains the files copto.mf, copti.mf and coptbase.mf and |
| 14 |
% the derived files which are: copto.tfm, copto.pk, copti.tfm, copti.pk (or whatelse |
| 15 |
% the local METAFONT generating process calls the pk files, for example copto.600pk), |
| 16 |
% and copto.pfb, copti.pfb; there is also a LaTeXe font definition file lcopcoptic.fd where |
| 17 |
% the COP LaTeX encoding is defined and a coptic.sty extension package where some macros |
| 18 |
% are defined for using inline Coptic script as well as displayed Coptic text with |
| 19 |
% the facilities needed for some philological markup; such information was given by |
| 20 |
% Cristiano Pulone. |
| 21 |
% |
| 22 |
% There is no encoding file and the pfb fonts are usable only under (La)TeX and |
| 23 |
% pdf(la)tex and their drivers for producing postscript output or pdf output. |
| 24 |
% |
| 25 |
% |
| 26 |
% There is no maintainer |
| 27 |
% |
| 28 |
% This font is in the public domain under the conditions of the GNU General Public Licence. |
| 29 |
% |
| 30 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 31 |
% Copyright (C) 1992 Free Software Foundation, Inc. |
| 32 |
% |
| 33 |
% This program is free software; you can redistribute it and/or modify |
| 34 |
% it under the terms of the GNU General Public License as published by |
| 35 |
% the Free Software Foundation; either version 2, or (at your option) |
| 36 |
% any later version. |
| 37 |
% |
| 38 |
% This program is distributed in the hope that it will be useful, |
| 39 |
% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 40 |
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 41 |
% GNU General Public License for more details. |
| 42 |
% |
| 43 |
% You should have received a copy of the GNU General Public License |
| 44 |
% along with this program; if not, write to the Free Software |
| 45 |
% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 46 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 47 |
% |
| 48 |
% |true_design_size| is supposed to be the design size of the original font. |
| 49 |
% If the user does not set |designsize| on the command line, we default to the following. |
| 50 |
|
| 51 |
true_design_size# := 10.000pt#; |
| 52 |
default_design_size# := 10pt#; |
| 53 |
if designsize = 0: designsize := default_design_size#; fi; |
| 54 |
|
| 55 |
% Actually the font might be declared to be 12pt, but the inner workings set up |
| 56 |
% by S. Rosmorduc make it difficult to simply change the true_ and the default_ |
| 57 |
% design sizes so as to produce a real 12pt font. I (CB) let it stand this way |
| 58 |
% because the blacker design and the larger x-heigh make the Coptic script stand |
| 59 |
% out in evidence both along the lines maily written in Latin characters |
| 60 |
% and as displayed material. |
| 61 |
|
| 62 |
% It's pointless to actually produce different TFM files for different |
| 63 |
% design sizes: we have only one set of outlines, after all. So we |
| 64 |
% adjust the resolution to account for different sizes, by setting |
| 65 |
% |mag|. Then we reset |designsize| to the default. |
| 66 |
|
| 67 |
if unknown mag: mag := 1; fi; mag := mag * designsize / default_design_size#; |
| 68 |
|
| 69 |
% So we can produce output at varying sizes, all our dimensions are |
| 70 |
% output in terms of the ad hoc parameter |u|. |
| 71 |
% |
| 72 |
u# := default_design_size# / true_design_size#; |
| 73 |
|
| 74 |
designsize := default_design_size#; |
| 75 |
|
| 76 |
% Macros from page 289 of {\sl The Metafontbook} for short-circuit evaluation. |
| 77 |
% |
| 78 |
def cand (text q) = startif true q else: false fi enddef; |
| 79 |
def cor (text q) = startif true true else: q fi enddef; |
| 80 |
tertiarydef p startif true = if p: enddef; |
| 81 |
|
| 82 |
% The proof resolution of 2601.72 pixels per inch established by plain |
| 83 |
% \MF\ does not always work, because the characters might be too large |
| 84 |
% (or small, for that matter) for the paper size. So, here we change |
| 85 |
% the proof resolution to fit the design size of the font into |
| 86 |
% |proof_size| inches. To do this, we must know the resolution of the |
| 87 |
% device the proof output will be printed on; we make |proof_resolution| |
| 88 |
% default to 300. |
| 89 |
% |
| 90 |
if unknown mode cor ((mode = proof) or (mode = smoke)): |
| 91 |
% Given in inches: |
| 92 |
if unknown proof_size: proof_size := 4.982; fi;% era 7, ma veniva una dimensione strana e diversa da 2602 che e' il valore di default. |
| 93 |
|
| 94 |
% Given in pixels per inch: |
| 95 |
if unknown proof_resolution: proof_resolution := 300; fi; |
| 96 |
|
| 97 |
% Set up the new mode to be the same as the old one, except for the |
| 98 |
% resolution. |
| 99 |
original_mode := if known mode: mode else: proof fi; |
| 100 |
mode_def bzr_proof_mode = |
| 101 |
if original_mode = proof: |
| 102 |
proof_; |
| 103 |
else: |
| 104 |
smoke_; |
| 105 |
fi; |
| 106 |
pixels_per_inch |
| 107 |
:= (proof_size * proof_resolution) |
| 108 |
* (72.27 / proof_resolution) |
| 109 |
* (72.27 / designsize); |
| 110 |
proofing:=3; |
| 111 |
let makebox=maketicks; |
| 112 |
enddef; |
| 113 |
mode := bzr_proof_mode; |
| 114 |
fi; |
| 115 |
|
| 116 |
% Set up the device values for this run. Since we allow a nonstandard |
| 117 |
% value of |proofing| (see below), we must save its value, if it has |
| 118 |
% already been assigned. |
| 119 |
% |
| 120 |
if (known proofing) cand (proofing > 2): |
| 121 |
save_proofing := proofing; |
| 122 |
fi |
| 123 |
|
| 124 |
|
| 125 |
mode_setup; |
| 126 |
|
| 127 |
if known save_proofing: |
| 128 |
proofing := save_proofing; |
| 129 |
fi; |
| 130 |
|
| 131 |
|
| 132 |
% We can't define the pixel-oriented version of |u| until after |
| 133 |
% |mode_setup| has been called. |
| 134 |
|
| 135 |
define_pixels (u); |
| 136 |
|
| 137 |
ascender_height:=9.45u; ascender_height#:=9.45u#; |
| 138 |
x_height:=5.6u; x_height#:=5.6u#; |
| 139 |
descender_depth:=2u; descender_depth#:=2u#; |
| 140 |
|
| 141 |
% Use a font that blends better with the \MF\ logo for the title line. |
| 142 |
% |
| 143 |
special "titlefont cmss8"; |
| 144 |
|
| 145 |
% If we are doing smoke proofs, put the character at its actual size on |
| 146 |
% the output; if we're doing gray proofs, use a smaller font for the |
| 147 |
% labels. |
| 148 |
% |
| 149 |
|
| 150 |
% Produce a |makelabel| command for each |z| point in |point_list| and |
| 151 |
% each suffix in |suffixes|. |
| 152 |
% |
| 153 |
def general_label (text point_list, suffixes) = |
| 154 |
forsuffixes point_suffix = ,suffixes: |
| 155 |
forsuffixes point = point_list: |
| 156 |
% Unfortunately, the way in which the |str| operator formats its |
| 157 |
% argument (which is an arbitrary suffix) cannot be changed, so |
| 158 |
% the proofsheets end up showing "0 0" for the variable |z[0][0]|. |
| 159 |
makelabel (str point.point_suffix, z.point.point_suffix); |
| 160 |
endfor |
| 161 |
endfor |
| 162 |
enddef; |
| 163 |
|
| 164 |
% Define our labels for the proofsheets. The person running Metafont |
| 165 |
% can also see the control points on each spline, by setting |
| 166 |
% |proofing>2| at the beginning. (The {\tt plain.mf} macros only |
| 167 |
% distinguish between |proofing=0|, |proofing>0| and |proofing>1|, so we |
| 168 |
% are not disturbing them.) |
| 169 |
% |
| 170 |
def proof_labels (text t) = |
| 171 |
% We need to delimit the arguments here, so \MF\ knows where the |
| 172 |
% second |text| argument begins. Our output uses the suffix |"s"| for |
| 173 |
% startpoints of segments, and the suffixes |"c1"| and |"c2"| for |
| 174 |
% control points. |
| 175 |
if proofing > 1: general_label (t) (s); fi; |
| 176 |
if proofing > 2: general_label (t) (c1,c2); fi; |
| 177 |
enddef; |
| 178 |
|
| 179 |
|
| 180 |
% We define our characters as filled outlines; page 206 of {\sl The |
| 181 |
% Metafontbook} suggests disabling \MF's |autorounding| and |
| 182 |
% |smoothing| features in that case. |
| 183 |
% |
| 184 |
autorounding := 0; % 0 avant pour les deux! |
| 185 |
smoothing := 0; |
| 186 |
|
| 187 |
% Sometimes we want to fill our paths, other times unfill them, |
| 188 |
% depending on whether the winding number is positive or negative. We |
| 189 |
% could be absolutely safe here, and declare |temp_path| inside a group, |
| 190 |
% at every invocation of |fill_or_unfill|; but this would waste time and |
| 191 |
% space to no advantage, since we know exactly what kind of \MF\ |
| 192 |
% programs we output, and the variable |temp_path| is not used in them. |
| 193 |
% |
| 194 |
% Incidentally, we need a variable in the first place only because it is more |
| 195 |
% efficient to avoid evaluating long paths more than once. |
| 196 |
% |
| 197 |
path temp_path; |
| 198 |
|
| 199 |
def fill_or_unfill expr p = |
| 200 |
temp_path := p; |
| 201 |
if turningnumber temp_path > 0: fill else: unfill fi temp_path; |
| 202 |
enddef; |
| 203 |
|
| 204 |
% Since we can assume the font fills all cycles counterclockwise |
| 205 |
% (because PostScript requires this), we want to disable the |
| 206 |
% |turningnumber| checking which generates the `Strange path' errors. |
| 207 |
% See p.112 and p.119 of the Metafontbook. |
| 208 |
% |
| 209 |
% (By the way, setting |turningcheck := 0| makes Metafont always use the |
| 210 |
% filling rule for positive turning number, i.e., always |fill| and |
| 211 |
% never |unfill|. When would this be useful?) |
| 212 |
% |
| 213 |
turningcheck := 1; |
| 214 |
|
| 215 |
% When we don't know the dimensions of the character we're defining |
| 216 |
% before we define it, we have to use these to begin it: |
| 217 |
def begin_no_dimen_char (expr c) = |
| 218 |
begingroup |
| 219 |
transform save_currenttransform; |
| 220 |
save_currenttransform := currenttransform; |
| 221 |
charcode:=if known c: byte c else: 0 fi; |
| 222 |
charic:=0; clearxy; clearit; clearpen; scantokens extra_beginchar; |
| 223 |
enddef; |
| 224 |
|
| 225 |
def end_no_dimen_char = |
| 226 |
currenttransform := save_currenttransform; |
| 227 |
endchar; |
| 228 |
enddef; |
| 229 |
|
| 230 |
% When use the above to start a character, must call this before `endchar'. |
| 231 |
% |
| 232 |
def set_char_dimens (expr w_sharp,h_sharp,d_sharp) = |
| 233 |
charwd:=w_sharp; charht:=h_sharp; chardp:=d_sharp; |
| 234 |
w:=hround(charwd*hppp); h:=vround(charht*hppp); d:=vround(chardp*hppp); |
| 235 |
enddef; |
| 236 |
|
| 237 |
% Move by shifting the current transform matrix. |
| 238 |
% |
| 239 |
def move (expr h_amount, v_amount) = |
| 240 |
currenttransform := currenttransform shifted (h_amount, v_amount); |
| 241 |
enddef; |
| 242 |
|
| 243 |
def hmove (expr amount) = move (amount, 0); enddef; |
| 244 |
def vmove (expr amount) = move (0, amount); enddef; |
| 245 |
def depart= 0; enddef; |
| 246 |
|
| 247 |
|
| 248 |
transform modif; modif := identity; |
| 249 |
|
| 250 |
% Definizione della currenttransform in cmbase.mf |
| 251 |
% currenttransform:=identity slanted slant |
| 252 |
% yscaled aspect_ratio scaled granularity; |
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
%% Patch to get a better letter spacing. |
| 257 |
extra_space_after:=0.9u#; |
| 258 |
|
| 259 |
def beginchar(expr c,w_sharp,h_sharp,d_sharp) = |
| 260 |
begingroup |
| 261 |
charcode:=c + depart; |
| 262 |
charwd:=w_sharp + extra_space_after; |
| 263 |
charht:=h_sharp; chardp:=d_sharp; |
| 264 |
italcorr h_sharp-.5u#; |
| 265 |
w:=hround(charwd*hppp); h:=vround(charht*hppp); d:=vround(chardp*hppp); |
| 266 |
charic:=0; clearxy; clearit; clearpen; scantokens extra_beginchar; |
| 267 |
transform save_currenttransform; |
| 268 |
save_currenttransform= currenttransform; |
| 269 |
currenttransform:= currenttransform transformed modif; |
| 270 |
enddef; |
| 271 |
|
| 272 |
def endchar = |
| 273 |
scantokens extra_endchar; |
| 274 |
if proofing>0: makebox(proofrule); fi |
| 275 |
chardx:=w; % desired width of the character in pixels |
| 276 |
shipit; |
| 277 |
if displaying>0: makebox(screenrule); showit; fi |
| 278 |
currenttransform:= save_currenttransform; |
| 279 |
endgroup enddef; |
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 284 |
font_coding_scheme := "# encoding for coptic font "; |
| 285 |
font_identifier := "copto"; |