Software: Apache/2.2.3 (CentOS). PHP/5.1.6 uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/share/doc/ghostscript-8.15/ drwxr-xr-x |
Viewing file: Fonts.htm (44.13 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | Fonts and font facilities supplied with GhostscriptTable of contentsFor other information, see the Ghostscript overview. About Ghostscript fontsGhostscript is distributed with two kinds of files related to fonts:
Most of the font files supplied with Ghostscript have the extension .pfb, and a few have .pfa or .gsf. Each file defines one ordinary PostScript Type 1 outline font which any PostScript language interpreter can use. Files with .pfa or .pfb extensions are also compatible with Adobe Type Manager (ATM) and with tools that don't include a full PostScript language interpreter; files with .gsf extension are incompatible with ATM and other tools. Ghostscript compiled with the "ttfont" option can also use TrueType fonts with the extension .ttf. When Ghostscript needs a font, it must have some way to know where to look for it: that's the purpose of the Fontmap file, which associates the names of fonts such as /Times-Roman with the names of font files, such as n021003l.pfb. Fontmap can also create aliases for font names, so that for instance, /NimbusNo9L-Regu means the same font as /Times-Roman. Ghostscript's free fontsTwo sets of free fonts are supplied for Ghostscript:
"#.##" and "###" are the version number with and without punctuation. Fonts can be found at ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/gs###/ (for a particular version) Other free fontsComputer Modern FontmapDon Knuth's Computer Modern fonts are popular, free, and widely available. A Fontmap appropriate for these fonts is available from: ftp://tug.ctan.org/tex-archive/fonts/cm/ps-type1/contrib/Fontmap.cmr or from other CTAN sites. Free Chinese (Hanzi) fontsA free Chinese font, originally provided by courtesy of Jackson Technology, Ltd., Taiwan under the GPL and now distributed by the Taiwan NeXT User Group, is available from: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/3rdparty/fonts/hanzi/ Prof. Wu of the Department of Economics of National Taiwan University has created several free Type 1 Chinese fonts designed to be used with TeX. His e-mail is ntut019@ccms.ntu.edu.tw. The fonts are available from ftp://cle.linux.org.tw/pub/fonts/cwfont/ Arphic Technology Co., Ltd., has made several free TrueType Chinese fonts available under the Arphic Public License, a license very similar to the GPL. (Ghostscript can use TrueType fonts if Ghostscript is compiled with the ttfont feature included: see here for more information.) The fonts and license are available from ftp://cle.linux.org.tw/pub/fonts/arphic/ Free Japanese (Kanji) fontsMr. Tetsurou Tanaka of the Department of Engineering, University of Tokyo, has created a set of free Kanji fonts available from ftp://ftp.ipl.t.u-tokyo.ac.jp/Font/ along with documentation in Japanese and English describing their conditions of use and how to use them. An older copy of these fonts, under somewhat different names, is available at the Ghostscript site: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/3rdparty/fonts/kanji/ Mr. Norio Katayama has done some work to make Ghostscript work well with Kanji fonts. An easy-to-install Kanji font for Ghostscript, with installation instructions, is at http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-ttf.html The same site has patches to make Ghostscript work with Japanese VF fonts, with documentation in both English and Japanese: http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-vflib.html Here are some other resources in Japanese relating to VFlib and using Ghostscript with Japanese fonts: Unicode CMapsSome Unicode CMaps that can be used with Ghostscript are freely downloadable from ftp://ftp.oreilly.com/pub/examples/nutshell/ujip/adobe/ Free Cyrillic fontsN. Glonty and A. Samarin created in 1989 a Cyrillic extension of TeX's "Computer Modern" fonts, now freely available through the Comprehensive TeX Archive Network (CTAN), for instance at ftp://ctan.tug.org/tex-archive/fonts/cyrillic/cmcyr/ CTAN's entire collection of Cyrillic fonts is, for instance, at ftp://ctan.tug.org/tex-archive/fonts/cyrillic/
Basil K. Malyshev created the "Paradissa Fonts Collection" in 1993. It
contained 165 fonts, including the Glonty and Samarin font above plus other
Computer Modern, Euler, and LaTeX fonts, all in PostScript Type 1 format
with http://www.ctan.org/tex-archive/fonts/ but the collection no longer seems to be available. However, the ctan fonts directory remains an excellent source of free fonts, many of which are offered in postscript as well we as TeX Metafont format. (Partial) Unicode fontsGeorge W. Wilson is distributing some free partial Unicode fonts he created. These fonts currently lack Arabic and CJK characters, but they include a very large subset of the remaining Unicode set. They are available in both Type 1 and TrueType formats. See http://bibliofile.mc.duke.edu/gww/fonts/Unicode.html How Ghostscript gets fonts when it runsFonts occupy about 50KB each, so Ghostscript doesn't load them all automatically when it runs. Instead, as part of normal initialization Ghostscript runs a file gs_fonts.ps, which arranges to load fonts on demand using information from the font map. To preload all of the known fonts, invoke the procedure loadallfonts The file prfont.ps contains code to print a sample page of a font. Load this program by including it in the gs command line or by invoking (prfont.ps) run Then to produce a sampler of a particular font XYZ, invoke /XYZ DoFont For example, /Times-Roman DoFont For more information about how Ghostscript loads fonts during execution, see here. Platform fontsGhostscript displays text on screen using whatever font technology is provided by the system on which it runs, by calling the system's API to display text. On platforms with X Windows, this is X Windows; on MS Windows it may be TrueType or ATM; Ghostscript neither knows nor cares. The PostScript language specifies that fonts are data structures with particular contents (for instance, they include a bounding box for the font, an Encoding vector to specify the character set, etc.), and it is common for PostScript files to use this fact; also, characters can be used as clipping regions, and can be arbitrarily algorithmically rotated, skewed, expanded or condensed, etc. Most of this information is available in some form from the underlying graphics system, but one crucial piece is not: the actual scalable outlines of the characters, which Ghostscript needs in order to implement both clipping with character shapes and arbitrarily transformed characters. Consequently Ghostscript needs the scalable outlines of any font mentioned in a document, and loads them from the disk (.pfa, .pfb, or .gsf file) in the usual way, even if it uses the platform's font machinery to display the characters. In other words, Ghostscript must still be able to find its font files. To make matters worse, platforms use different names for their standard fonts. For example, the Times Roman font, for which PostScript files use the name "Times-Roman", may be known as "Times-Roman", "Times Roman", "Tms Rmn", "Times New Roman", or "TimesNewRoman". The name may even be completely different: the usual Helvetica-equivalent TrueType font is called "Arial". It is possible to deal with this situation by introducing aliases in Fontmap, but there are two reasons why Ghostscript does not currently do this:
If you don't seem to be getting nice characters on the screen under MS Windows, you can try adding aliases to Fontmap, according to the documentation you'll find in there. Adding your own fontsGhostscript can use any Type 0, 1, 3, 4, or 42 font acceptable to other PostScript language interpreters or to ATM, including MultiMaster fonts. Beginning with release 4.0, Ghostscript can also use TrueType fonts if it was compiled with the "ttfont" option. To add fonts of your own, you must edit Fontmap to include at the end an entry for your new font; the format for entries is documented in Fontmap itself. Since later entries in Fontmap override earlier entries, a font you add at the end supersedes any corresponding fonts supplied with Ghostscript and defined earlier in the file. In the PC world, Type 1 fonts are customarily given names ending in .PFA or .PFB. Ghostscript can use these directly: you just need to make the entry in Fontmap. If you want to use with Ghostscript a commercial Type 1 font (such as fonts obtained in conjunction with Adobe Type Manager), please read carefully the license that accompanies the font to satisfy yourself that you may do so legally; we take no responsibility for any possible violations of such licenses. The same applies to TrueType fonts. Converting BDF fontsGhostscript provides a way to construct a (low-quality) Type 1 font from a bitmap font in the BDF format popular in the Unix world. The shell script bdftops (Unix) or the command file bdftops.bat (DOS) converts a BDF file to a scalable outline using bdftops.ps . Run the shell command bdftops BDF_filename [AFM_file1_name ...] gsf_filename fontname The arguments have these meanings:
For instance bdftops pzdr.bdf ZapfDingbats.afm pzdr.gsf ZapfDingbats 4100000 1000000.1.41 Then make an entry in Fontmap for the .gsf file (pzdr.gsf in the example) as described above. For developers onlyThe rest of this document is very unlikely to be of value to ordinary users. Contents of fontsAs noted above, Ghostscript accepts fonts in the same formats as PostScript interpreters. Type 0, 1, and 3 fonts are documented in the PostScript Language Reference Manual (Second Edition); detailed documentation for Type 1 fonts appears in a separate Adobe book. Type 2 (compressed format) fonts are documented in separate Adobe publications. Type 4 fonts are not documented anywhere; they are essentially Type 1 fonts with a BuildChar or BuildGlyph procedure. Types 9, 10, and 11 (CIDFontType 0, 1, and 2) and Type 32 (downloaded bitmap) fonts are documented in Adobe supplements. Type 42 (encapsulated TrueType) fonts are documented in an Adobe supplement; the TrueType format is documented in publications available from Apple and Microsoft. Ghostscript does not support Type 14 (Chameleon) fonts, which use a proprietary Adobe format. Precompiling fontsYou can precompile -- convert -- any Type 1 font into C, then compile and build it into the Ghostscript executable. (Type 1 fonts include any font whose name ends with .pfa or .pfb, and it also includes all the Ghostscript .gsf fonts except the Hershey fonts.) This has no effect on rendering speed, but it eliminates the time to load the font dynamically, which may make a big improvement in total rendering time, especially for multi-page documents. It also reduces the number of auxiliary files required at run time. Fonts precompiled and built into Ghostscript this way need not appear in Fontmap, although if they do appear there, no harm is done. The utility for precompiling fonts is named font2c. Note that since font2c uses the PostScript language program font2c.ps, Ghostscript must already be available to run it, and Fontmap must contain entries for the fonts you want to compile. For example, to precompile the Times-Italic font, font2c Times-Italic ptmri.c The first argument ("Times-Italic" above) is the font's name and the second ("ptmri.c") is the name of the resulting C file. You can use any file name you want, as long as it ends in ".c". It needn't be limited to eight characters unless your operating system requires this. If "XYZ.gsf" or "XYZ.pfa" is the font file's name in Fontmap, "XYZ.c" is a good choice for the C file. Under VMS, or other systems whose the C compilers limit the length of identifiers, you must do something slightly more complicated; for that see the section on short identifiers in C. On VMS also, you must quote the font name ("{font name}") to preserve the name's mixed upper and lower case. For VMS environments in general see the VMS directions in the documentation on building Ghostscript, and ignore the rest of this section. Note that fonts are not supplied with Ghostscript in precompiled form, since those files are quite large and can easily be recreated using font2c. There is a makefile target to run font2c on all the fonts supplied with Ghostscript. Invoke it with make fonts_standard_c Besides running font2c, you must compile the fonts and link them into the executable. To do this, add the compiled fonts feature to your platform-specific makefile. See the overview of makefiles in the documentation on building Ghostscript for the list of makefiles for each platform. Find the definition of the FEATURE_DEVS macro in the makefile, which looks something like this: FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)pipe.dev and add "ccfonts.dev": FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)pipe.dev $(PSD)ccfonts.dev Next you must add the specific fonts to int.mak, the platform-independent makefile for the interpreter. This makefile already has rules for the standard fonts supplied with Ghostscript, so if you just want to compile the standard fonts, you needn't do anything else. Now we describe how to compile other fonts into the executable, such as the Utopia or Kana fonts, or your own fonts. Suppose you want to compile the Kana fonts into the executable. First pick one of ccfonts10 through ccfonts15 as the place you will do this, say ccfonts10. Add your compiled font file names, for instance ccfonts10_=$(CFOBJ)fhirw.$(OBJ) (Note the underscore "_".) If this makes the line too long, use another line of the same form, for instance, ccfonts11_=$(CFOBJ)fkarw.$(OBJ) Just below the ccfonts10_= line is a line ccfonts10= (Note no underscore.) Add your own fonts to the end of this line, replacing dashes ("-") with underscores ("_") in the font names. For instance: ccfonts10=Calligraphic_Hiragana Again, if a line becomes too long, add another line of the same form, for instance, ccfonts10=Calligraphic_Hiragana After all the lines of this form, add a pair of lines to compile each font, separating these entries from the "ccfonts*" lines and from each other with a blank line. In our example this becomes $(CFOBJ)fhirw.$(OBJ): $(CFGEN)fhirw.c $(CCFONT) $(CFCC) $(CFO_)fhirw.$(OBJ) $(C_) $(CFGEN)fhirw.c $(CFOBJ)fkarw.$(OBJ): $(CFGEN)fkarw.c $(CCFONT) $(CFCC) $(CFO_)fkarw.$(OBJ) $(C_) $(CFGEN)fkarw.c Finally, run make to build an executable that includes the fonts you added. They are present in FontDirectory when Ghostscript starts up. Precompiling fonts on platforms with identifier length limitsOn some platforms the C compiler or linker limits the number of significant characters usable in an identifier. On such platforms, you must do a little extra work. Let N be the maximum number of significant characters in an identifier (typically 31). For each font whose name is longer than N-5 characters, pick an arbitrary identifier that we will call the "short name". This can be any string you want, as long as it contains only letters, digits, and underscores; is no longer than N-5 characters; and is different from all other font names and short names. A good choice for this is the name of the C file. There is no harm in doing this for fonts with names shorter than N-5 characters, but it's unnecessary. You must do two different things for fonts that require a short name.
Everything else is as described above. This procedure doesn't change the name of the font in Fontmap or as seen from within Ghostscript; it just works around a limitation of some older compilers. Font names and unique IDsIf you create your own fonts and will use them only within your own organization, you should use UniqueID values between 4000000 and 4999999, coded like this (see the tables of codes for font file names below):
This scheme will not work forever: as soon there are more than 99 typefaces, or more than 9 weights or variants, we will have to do something else. But it suffices for the near future. If you plan to distribute fonts, ask Adobe to assign you some UniqueIDs and also an XUID for your organization. Contact Unique ID Coordinator The XUID is a Level 2 PostScript feature that serves the same function as the UniqueID, but is not limited to a single 24-bit integer. The bdftops program creates XUIDs of the form "[-X- 0 -U-]" where "-X-" is the organization XUID and "-U-" is the UniqueID. (Aladdin Enterprises' organization XUID, which appears in a few places in various font-related files distributed with Ghostscript, is 107; do not use this for your own fonts that you distribute.) Because Ghostscript runs on many different systems, including DOS, the names of font files can be no longer than 8 characters. We therefore construct a font's filename FTTWVVVE.gsf similarly to the construction for temporary UniqueIDs.
Since a font can have multiple variants (for example, Lucida Regular Sans Typewriter Italic) we allocate three letters to that; if a font has four variants, you're on your own. If a font does have multiple variants, it's best to add the expansion letter "r" to make clear which letters are variants and which the expansion. This scheme is very close to the one proposed in "Filenames for fonts", published in the first 1990 issue of TUGboat (the journal of the TeX Users Group). Codes used to make font file namesIn the following tables we make no attempt to be exhaustive: instead we have simply allocated entries for those things that we needed for the fonts that we are actually distributing.
Using Ghostscript fonts on X Windows displaysThe standard X11 distribution can display various kinds of fonts, including the Adobe Type 1 format, so font files distributed with Ghostscript can be used on X Windows displays. Beginning with Ghostscript version 6.0, the font archive contains the directory files needed to map Ghostscript's font files to XLFDs. Those files are named "fonts.dir" and "fonts.scale". There are two main methods to configure your display to use these files.
Using xsetUsers without root access can add the Ghostscript font directories to the font search path using xset. Such a setting is transient and must be repeated each time the display server is reset or restarted, typically at login, so the call to xset should be added to the user's ".xsession" or ".xinitrc" startup script to make the fonts available at each login. To add a new font directory, invoke xset like this: xset fp+ {directory} where {directory} is the full pathname to the directory containing the fonts on the host running the X display server. For common Ghostscript installations the path is /usr/local/Ghostscript/share/fonts Permanent installationA system administrator, or anyone with the necessary root privilege, can make Ghostscript's fonts permanently available to the managed X display servers. This setup depends on the servers and the methods used to make the fonts available. Configuring the xfs font serverAn X display server can obtain its font resources from a dedicated X font server. xfs is a prototype font server included in the X Consortium X11 distribution. It is configured with a file located in a directory whose exact location is installation-dependent and could be any of /usr/lib/X11/fs/config or some similar name. You can also use xfs's "-config" command-line option to specify the location of the configuration file. The configuration file designates a list ("catalog") of directories, each of which contains fonts and a font mapping database (the file "fonts.dir"). This list is specified with the "catalogue=" keyword followed by a list of absolute directory paths separated by commas. To add the Ghostscript directory, include its full name in the catalog list, for example: catalogue = /usr/local/share/Ghostscript/fonts/, The fonts are searched in the order the directories are specified, so an XLFD mapped by the Ghostscript directory could shadow a previous similar description specified in the following directories. Once the file is modified, instruct the font server to reload the configuration file by sending it the USR1 signal: kill -HUP {pid} where {pid} is the font server process's numeric process ID, as obtained with the "ps" command. Be sure to check that the server is still alive after signaling it: it is very picky and could decide to shut itself down if something is wrong in the new configuration. If this happens, restart the server by hand and try to figure out from its output what's happening. If the font server dies, display servers using it will experience problems, so be sure to send the signal from the console or from a display not using that font server! Xfree86 display serversWith the family of Xfree86 display servers, adding a new font directory permanently requires editing the "/etc/XF86Config" setup file to add a new "FontPath" to the "Files" section: Section "Files" The fonts are searched in the order the directories are specified, so an XLFD mapped by the Ghostscript directory could shadow a previous similar description specified in the following directories. Once this global configuration is edited, the new fonts become available to all Xfree86 servers in use on that host. If a server is running, it must be restarted to take effect: just quit the current session in the usual way. If the server is under the control of xdm, you may have to kill it, because it is usually reset only between successive sessions. This section by Bertrand Petit <eegs@phoe.frmug.org> Copyright © 1996, 1997, 1998, 1999, 2000 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. Ghostscript version 8.15, 22 September 2004 |
:: Command execute :: | |
:: Shadow's tricks :D :: | |
Useful Commands
|
:: Preddy's tricks :D :: | |
Php Safe-Mode Bypass (Read Files)
|
--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0128 ]-- |