Sei sulla pagina 1di 3

% % % % % % % % % % % % % % % % % %

Copyright (C) 1994, 1995, 1996 Aladdin Enterprises. All rights reserved. This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of the license contained in the file LICENSE in this distribution. For more information about licensing, please refer to http://www.ghostscript.com/licensing/. For information on commercial licensing, go to http://www.artifex.com/licensing/ or contact Artifex Software, Inc., 101 Lucas Valley Road #110, San Rafael, CA 94903, U.S.A., +1(415)492-9861. $Id$ Scaffolding for Kanji fonts. This is based on the Wadalab free font from the University of Tokyo; it may not be appropriate for other Kanji fonts.

/currentglobal where { pop currentglobal { setglobal } true setglobal } { { } } ifelse % Define the encoding for the root font. /KanjiEncoding % \x00 0 0 0 0 % \x20 0 8 9 17 % \x40 25 33 41 49 % \x60 57 65 73 0 % \x80 0 0 0 0 % \xA0 0 8 9 17 % \xC0 25

0 0 0 0 1 0 10 18 26 34 42 50 58 66 74 0 0 0 0 0 1 0 10 18 26

0 0 0 0 2 0 11 19 27 35 43 51 59 67 75 0 0 0 0 0 2 0 11 19 27

0 0 0 0 3 0 12 20 28 36 44 52 60 68 76 0 0 0 0 0 3 0 12 20 28

0 0 0 0 4 0 13 21 29 37 45 53 61 69 77 0 0 0 0 0 4 0 13 21 29

0 0 0 0 5 0 14 22 30 38 46 54 62 70 0 0 0 0 0 0 5 0 14 22 30

0 0 0 0 6 0 15 23 31 39 47 55 63 71 0 0 0 0 0 0 6 0 15 23 31

0 0 0 0 7 0 16 24 32 40 48 56 64 72 0 0 0 0 0 0 7 0 16 24 32

33 41 49 % \xE0 57 65 73 0 256 packedarray

34 42 50 58 66 74 0 def

35 43 51 59 67 75 0

36 44 52 60 68 76 0

37 45 53 61 69 77 0

38 46 54 62 70 0 0

39 47 55 63 71 0 0

40 48 56 64 72 0 0

% Define a stub for the base font encoding. /KanjiSubEncoding { /KanjiSubEncoding .findencoding } bind def %% Replace 3 (gs_ksb_e.ps) EncodingDirectory /KanjiSubEncoding { (gs_ksb_e.ps) //systemdict begin runlibfile KanjiSubEncoding end } bind put % Support procedures and data. /T1FontInfo 8 dict begin /version (001.001) readonly def /FullName (KanjiBase) readonly def /FamilyName (KanjiBase) readonly def /Weight (Medium) readonly def /ItalicAngle 0 def /isFixedPitch false def /UnderlinePosition 0 def /UnderlineThickness 0 def currentdict end readonly def /T1NF % <fontname> T1NF <font> { 20 dict begin /FontName exch def /FontType 1 def /FontInfo T1FontInfo def /FontMatrix [.001 0 0 .001 0 0] def /FontBBox [0 0 1000 1000] def /Encoding KanjiSubEncoding def /CharStrings 150 dict def /PaintType 0 def /Private 2 dict def Private begin /BlueValues [] def /password 5839 def end FontName currentdict end definefont } def /T0NF % <fontname> T0NF <font> { 20 dict begin /FontName exch def /FDepVector exch def /FontType 0 def /FontMatrix [1 0 0 1 0 0] def /FMapType 2 def /Encoding KanjiEncoding def FontName currentdict end definefont

} def % Define the composite font and all the base fonts. /CompNF % <fontname> CompNF <font> { /newname1 exch def newname1 dup length string cvs /str exch def str length /len exch def /fdepvector 78 array def /j 1 def 16#21 1 16#74 { /i exch def KanjiEncoding i get 0 gt { len 4 add string /newstr exch def newstr 0 str putinterval newstr len (.r) putinterval newstr len 2 add i 16 2 string cvrs putinterval newstr cvn /newlit exch def newlit T1NF /newfont exch def fdepvector j newfont put /j j 1 add def } if } for fdepvector 0 fdepvector 1 get put /j 0 def fdepvector newname1 T0NF } def % Define an individual character in a composite font. /CompD % <charstring> <(HL)> CompD { currentfont /Encoding get 1 index 0 get get % FDepVector index currentfont /FDepVector get exch get % base font dup /Encoding get 3 -1 roll 1 get get % base font character name exch /CharStrings get exch 3 -1 roll put } bind def exec

Potrebbero piacerti anche