/*-------------------------------------------------------------------------- ----- File: subset.c ----- Author: Rainer Menzner (Rainer.Menzner@web.de) ----- Date: 2007-12-22 ----- Description: This file is part of t1lib. The program subset reads a font file name and a string from the commandline and creates a subset of the font which is sufficient to display the string. It is an example of how to use font subsetting. ----- Copyright: t1lib is copyrighted (c) Rainer Menzner, 1996-2007. As of version 0.5, t1lib is distributed under the GNU General Public Library Lincense. The conditions can be found in the files LICENSE and LGPL, which should reside in the toplevel directory of the distribution. Please note that there are parts of t1lib that are subject to other licenses: The parseAFM-package is copyrighted by Adobe Systems Inc. The type1 rasterizer is copyrighted by IBM and the X11-consortium. ----- Warranties: Of course, there's NO WARRANTY OF ANY KIND :-) ----- Credits: I want to thank IBM and the X11-consortium for making their rasterizer freely available. Also thanks to Piet Tutelaers for his ps2pk, from which I took the rasterizer sources in a format independent from X11. Thanks to all people who make free software living! --------------------------------------------------------------------------*/ #include #include #include /* Note: We include t1lib.h from lib/t1lib. That way the objectfile does only need to be rebuild when the header itself changes and not each time the library has been recompiled */ #include "../lib/t1lib/t1lib.h" void printusage( void); int main(int argc, char *argv[]) { int i, j, result; int realargs=0; int logfile=0; char mask[256]; int flags=T1_SUBSET_DEFAULT; char *subset=NULL; unsigned long ofsize=0; FILE *ofp=stdout; char** encoding = 0; char* encodingfile = 0; int doreencode = 0; int reresult = 0; if (argc==1){ printusage(); return(0); } /* If we want to log anything, then log all */ T1_SetLogLevel(T1LOG_DEBUG); realargs=argc-1; for (j=1; j] [ ...] string\n"); fprintf(stdout, "\n"); fprintf(stdout, "Subset source fontfile(s) according to `string' and write result\nto stdout (T1Lib-%s)!\n\n", T1_GetLibIdent()); fprintf(stdout, "Options: -l Write a log-file t1lib.log.\n"); fprintf(stdout, " -a Create ASCII-encrypted file (default).\n"); fprintf(stdout, " -b Create Binary-enrypted file.\n"); fprintf(stdout, " -f Force reencoding of the font subset, even if\n"); fprintf(stdout, " the source font uses internal StandardEncoding.\n"); fprintf(stdout, " -s Skip reencoding of the font subset, even if the\n"); fprintf(stdout, " source font defines a font-specific encoding.\n"); fprintf(stdout, " -e Load an encoding from specified file and reencode\n"); fprintf(stdout, " source font before starting to create the subset.\n"); fprintf(stdout, " This option also implies [-f].\n"); return; }