|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T p
Length: 5005 (0x138d) Types: TextFile Names: »pixel-fonts.psr«
└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12 └─⟦af5ba6c8e⟧ »unix3.0/DVIWARE.tar.Z« └─⟦ca79c7339⟧ └─⟦this⟧ »DVIware/laser-setters/dvi-to-ps/TeXPS/dvitps/psr/pixel-fonts.psr«
% Copyright (c) 1988 Stephan v. Bechtolsheim % This file is part of the TeXPS Software Package. % The TeXPS Software Package is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY. No author or distributor % accepts responsibility to anyone for the consequences of using it % or for whether it serves any particular purpose or works at all, % unless he says so in writing. Refer to the TeXPS Software Package % General Public License for full details. % Everyone is granted permission to copy, modify and redistribute % the TeXPS Software Package, but only under the conditions described in the % TeXPS Software Package General Public License. A copy of this license is % supposed to have been given to you along with TeXPS Software Package so you % can know your rights and responsibilities. It should be in a % file named CopyrightLong. Among other things, the copyright notice % and this notice must be preserved on all copies. % Pixel based fonts % ================= % Find here all the code associated with pixel fonts. % @newfont % ======== % Initialize a new font dictionary. The variable NumCharsInPixelFonts must % be initialized by the driver's output. % id @newfont - /@newfont { /newname exch def newname 7 dict def % allocate new font dictionary newname load begin /FontType 3 def /FontMatrix [1 0 0 -1 0 0] def /FontBBox [0 0 1 1] def /BitMaps NumCharsInPixelFonts array def /BuildChar {CharBuilder} def /Encoding NumCharsInPixelFonts array def 0 1 NumCharsInPixelFonts 1 sub {Encoding exch /.undef put} for end newname newname load definefont pop } def % Procedures to setup the character bitmaps of pixel fonts. % ch-image, ch-width, ch-height, ch-xoff, ch-yoff, ch-tfmw % ======================================================== % The following is the only character builder we need. it looks up the % char data in the BitMaps array, and paints the character if possible. % char data -- a bitmap descriptor -- is an array of length 6, of % which the various slots are: /ch-image {ch-data 0 get} def % the hex string image /ch-width {ch-data 1 get} def % the number of pixels across in the pixel box /ch-height {ch-data 2 get} def % the number of rows in the pixel box /ch-xoff {ch-data 3 get} def % x_offset: as defined in emitc.c /ch-yoff {ch-data 4 get} def % y_offset: as defined in emitc.c /ch-tfmw {ch-data 5 get} def % spacing to next character % CharBuilder % =========== % fontdict ch Charbuilder - % fontdict: dictionary of the current font, for which a character % has to be added. % ch: the character code % % Image one character. The current font must be selected. % The font matrix is defined as [1 0 0 -1 0 0], so positive y is up, % in reverse of the direction of the TeX coordinate system. % The imagemask matrix is defined as [1 0 0 1 . . ], so we scan % in the standard PS order, meaning starting at the bottom going % to the top, and within each row we proceed left to right. /CharBuilder { /ch-code exch def % Save the char code /font-dict exch def % Snd the font dict. /ch-data font-dict /BitMaps get ch-code get def % Get the bitmap % descriptor for char ch-data null eq not { % Prepare arguments for call to setcachedevice ch-tfmw 0 % w_x w_y ch-xoff neg % ll_x ch-height ch-yoff sub neg % ll_y ch-width ch-xoff neg add % ur_x ch-yoff % ur_y setcachedevice % Ken's proposal 0 0 transform round exch round exch itransform translate ch-width ch-height true [1 0 0 1 ch-xoff ch-height ch-yoff sub] {ch-image} imagemask } if } def % @dc % === % Define a new character bitmap in the current font. That current % font must be selected. % % char-data ch @dc - % % char-data looks as follows: % [ <Hex Bitmap> % width-in-pixels height-in-pixels % number-pixels-below-origin number-pixels-left-origin % spacing (= number of pixels to go right after character has been % printed) % ] % and % ch: the character code % % Observe that the code of this procedure would not work for % SliTeX characters (characters with no pixel information) if it % were not for the driver generating an almost empty bitmap etc % for this procedure. See "shipc.c" of the driver sources. /@dc { % (start @dc\n) print flush /ch-code exch def % Save arguments /ch-data exch def currentfont /BitMaps get % get the BitMaps from the font ch-code ch-data put % load the bitmap of this character currentfont /Encoding get % get the encoding vector ch-code ( ) cvs % convert the character code to a string cvn % generate unique name simply from the string of the char number ch-code exch put % (done @dc\n) print flush } def % @sf % === % newfont @sf - % Abbreviation for the setfont operator. Can be used by pixel % based and PS based fonts. /@sf /setfont load def