You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(92) |
Dec
(141) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(126) |
Feb
(72) |
Mar
(31) |
Apr
(200) |
May
(81) |
Jun
(130) |
Jul
(112) |
Aug
(134) |
Sep
(76) |
Oct
(89) |
Nov
(153) |
Dec
(9) |
2007 |
Jan
(59) |
Feb
(82) |
Mar
(50) |
Apr
(20) |
May
(9) |
Jun
(81) |
Jul
(41) |
Aug
(109) |
Sep
(91) |
Oct
(87) |
Nov
(33) |
Dec
(60) |
2008 |
Jan
(21) |
Feb
(15) |
Mar
(38) |
Apr
(75) |
May
(59) |
Jun
(46) |
Jul
(30) |
Aug
(20) |
Sep
(35) |
Oct
(32) |
Nov
(34) |
Dec
(19) |
2009 |
Jan
(29) |
Feb
(71) |
Mar
(54) |
Apr
(17) |
May
(4) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(58) |
Sep
(7) |
Oct
(7) |
Nov
(12) |
Dec
(18) |
2011 |
Jan
(17) |
Feb
(29) |
Mar
(11) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
(11) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(87) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(44) |
Jun
(79) |
Jul
(16) |
Aug
(31) |
Sep
|
Oct
(51) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Ehud S. <esh...@us...> - 2006-04-22 09:47:48
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/agg23 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5974/agg23 Log Message: Directory /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/agg23 added to the repository |
From: Pascal F M. <pas...@us...> - 2006-04-21 19:09:34
|
Update of /cvsroot/roadmap/roadmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21892 Modified Files: README Log Message: Make it possible to compile without expat (i.e. no trip feature) Index: README =================================================================== RCS file: /cvsroot/roadmap/roadmap/README,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** README 19 Feb 2006 06:30:17 -0000 1.88 --- README 21 Apr 2006 19:09:27 -0000 1.89 *************** *** 124,127 **** --- 124,130 ---- build RoadMap with the make option: SHAPEFILES=NO. + By default, RoadMap uses the expat library to load GPX trip and landmark + files. RoadMap can be built without expat using the make option: EXPAT=NO. + * WINDOWS SPECIFIC DEPENDENCIES AND LIMITATIONS *************** *** 578,585 **** is a PDA variant of GTK2 and the QPE environment is a PDA variant of QT. ! [SHAPEFILES=NO] Do not link build with the shapelib. The side effect ! of this option is that the Digital Charts of the World cannot be ! converted to RoadMap files. This option is to be used only when ! the shapelib library is not available. [HOST=Darwin] Assume the compiler tools accept the Mac OS X (Darwin) --- 581,591 ---- is a PDA variant of GTK2 and the QPE environment is a PDA variant of QT. ! [SHAPEFILES=NO] Do not link buildmap with the shapelib. The side ! effect of this option is that the Digital Charts of the World cannot ! be converted to RoadMap files anymore. This option is to be used only ! when the shapelib library is not available. ! ! [EXPAT=NO] Do not link roadmap with the expat library. The side effect ! is that you cannot load or save trips or landmarks anymore. [HOST=Darwin] Assume the compiler tools accept the Mac OS X (Darwin) |
From: Pascal F M. <pas...@us...> - 2006-04-21 18:56:24
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14564 Modified Files: roadmap_start.c Log Message: Make it possible to compile without expat (i.e. no trip feature) Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_start.c,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** roadmap_start.c 3 Jan 2006 19:37:14 -0000 1.92 --- roadmap_start.c 21 Apr 2006 18:56:19 -0000 1.93 *************** *** 178,197 **** static void roadmap_start_open_trip (void) { roadmap_trip_load_ask (0); } static void roadmap_start_merge_trip (void) { roadmap_trip_load_ask (1); } static void roadmap_start_save_trip (void) { ! roadmap_trip_save (1); } static void roadmap_start_save_trip_as (void) { ! roadmap_trip_save_as (1); } --- 178,235 ---- static void roadmap_start_open_trip (void) { + #ifdef NO_EXPAT + roadmap_log (ROADMAP_ERROR, + "This feature is not available (no expat library)"); + #else roadmap_trip_load_ask (0); + #endif } static void roadmap_start_merge_trip (void) { + #ifdef NO_EXPAT + roadmap_log (ROADMAP_ERROR, + "This feature is not available (no expat library)"); + #else roadmap_trip_load_ask (1); + #endif } static void roadmap_start_save_trip (void) { ! ! #ifdef NO_EXPAT ! roadmap_log (ROADMAP_ERROR, ! "This feature is not available (no expat library)"); ! #else roadmap_trip_save (1); + #endif } static void roadmap_start_save_trip_as (void) { ! ! #ifdef NO_EXPAT ! roadmap_log (ROADMAP_ERROR, ! "This feature is not available (no expat library)"); ! #else roadmap_trip_save_as (1); + #endif + } + + static void roadmap_start_save_track (void) { + #ifdef NO_EXPAT + roadmap_log (ROADMAP_ERROR, + "This feature is not available (no expat library)"); + #else + roadmap_track_save(); + #endif + } + + static void roadmap_start_merge_landmark (void) { + #ifdef NO_EXPAT + roadmap_log (ROADMAP_ERROR, + "This feature is not available (no expat library)"); + #else + roadmap_landmark_merge (); + #endif } *************** *** 414,418 **** {"tracksave", "Save Track", "Save Track", NULL, ! "Save the current GPS breadcrumb track", roadmap_track_save}, {"trackclear", "Clear Track", "Clear Track", NULL, --- 452,456 ---- {"tracksave", "Save Track", "Save Track", NULL, ! "Save the current GPS breadcrumb track", roadmap_start_save_track}, {"trackclear", "Clear Track", "Clear Track", NULL, *************** *** 465,469 **** {"mergepersonalwaypoints", "Load More Personal Landmarks...", NULL, NULL, ! "Merge personal landmarks from file", roadmap_landmark_merge }, {"full", "Full Screen", "Full", "F", --- 503,507 ---- {"mergepersonalwaypoints", "Load More Personal Landmarks...", NULL, NULL, ! "Merge personal landmarks from file", roadmap_start_merge_landmark }, {"full", "Full Screen", "Full", "F", *************** *** 973,978 **** --- 1011,1018 ---- roadmap_history_load (); + #ifndef NO_EXPAT roadmap_track_autoload (); roadmap_landmark_load (); + #endif roadmap_driver_activate (); *************** *** 987,993 **** --- 1027,1037 ---- roadmap_trip_restore_focus (); + #ifdef NO_EXPAT + roadmap_start_create_trip (); + #else if ( ! roadmap_trip_load (1, 0)) { roadmap_start_create_trip (); } + #endif roadmap_locator_declare (&roadmap_start_no_download); *************** *** 1005,1011 **** --- 1049,1057 ---- roadmap_driver_shutdown (); roadmap_history_save(); + #ifndef NO_EXPAT roadmap_track_autosave (); roadmap_landmark_save (); roadmap_trip_save (0); + #endif roadmap_config_save (0); } |
From: Pascal F M. <pas...@us...> - 2006-04-21 18:38:28
|
Update of /cvsroot/roadmap/roadmap/src/gpx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4474 Modified Files: gpx.c Log Message: Make it possible to compile without expat (i.e. no trip feature) Index: gpx.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gpx/gpx.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gpx.c 18 Feb 2006 16:04:01 -0000 1.2 --- gpx.c 21 Apr 2006 18:38:25 -0000 1.3 *************** *** 22,26 **** --- 22,29 ---- */ + #ifndef NO_EXPAT + #include "defs.h" + #include <expat.h> *************** *** 1605,1606 **** --- 1608,1611 ---- #endif + #endif // ifndef NO_EXPAT + |
From: Pascal F M. <pas...@us...> - 2006-04-21 18:38:08
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4096 Modified Files: roadmap_gpx.c Log Message: Make it possible to compile without expat (i.e. no trip feature) Index: roadmap_gpx.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_gpx.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_gpx.c 8 Dec 2005 21:02:13 -0000 1.2 --- roadmap_gpx.c 21 Apr 2006 18:37:59 -0000 1.3 *************** *** 24,28 **** --- 24,30 ---- + #ifndef NO_EXPAT #include <expat.h> + #endif #include "roadmap.h" #include "roadmap_trip.h" *************** *** 32,35 **** --- 34,50 ---- + #ifdef NO_EXPAT + static void roadmap_gpx_tell_no_expat (void) { + + static int roadmap_gpx_told_no_expat = 0; + + if (! roadmap_gpx_told_no_expat) { + roadmap_log (ROADMAP_ERROR, "No GPX file import (no expat library)"); + roadmap_gpx_told_no_expat = 1; + } + } + #endif + + void fatal (const char *fmt, ...) { char buf[256]; *************** *** 59,62 **** --- 74,82 ---- const char *name, queue *w, queue *r, queue *t) { + #ifdef NO_EXPAT + roadmap_gpx_tell_no_expat (); + return 0; + #else + queue *elem, *tmp; FILE *ifile; *************** *** 78,81 **** --- 98,102 ---- return ret; + #endif // NO_EXPAT } *************** *** 156,159 **** --- 177,184 ---- queue *w, queue *r, queue *t) { + #ifdef NO_EXPAT + roadmap_gpx_tell_no_expat (); + return 0; + #else FILE *fp; int ret; *************** *** 168,171 **** --- 193,197 ---- return ret; + #endif // NO_EXPAT } *************** *** 173,176 **** --- 199,206 ---- queue *waypoints) { + #ifdef NO_EXPAT + roadmap_gpx_tell_no_expat (); + return 0; + #else FILE *fp; int ret; *************** *** 185,188 **** --- 215,219 ---- return ret; + #endif // NO_EXPAT } *************** *** 190,193 **** --- 221,228 ---- route_head *route) { + #ifdef NO_EXPAT + roadmap_gpx_tell_no_expat (); + return 0; + #else FILE *fp; int ret; *************** *** 206,209 **** --- 241,245 ---- return ret; + #endif // NO_EXPAT } *************** *** 211,214 **** --- 247,254 ---- route_head *track) { + #ifdef NO_EXPAT + roadmap_gpx_tell_no_expat (); + return 0; + #else FILE *fp; int ret; *************** *** 227,229 **** --- 267,270 ---- return ret; + #endif // NO_EXPAT } |
From: Pascal F M. <pas...@us...> - 2006-04-21 18:38:06
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4040 Modified Files: Makefile Log Message: Make it possible to compile without expat (i.e. no trip feature) Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** Makefile 19 Feb 2006 06:28:36 -0000 1.77 --- Makefile 21 Apr 2006 18:37:50 -0000 1.78 *************** *** 25,28 **** --- 25,36 ---- + ifeq ($(EXPAT),NO) + EXPATCFLAGS=-DNO_EXPAT + EXPATLDFLAGS= + else + EXPATCFLAGS= + EXPATLDFLAGS=-lexpat + endif + ifeq ($(MODE),DEBUG) # Memory leak detection using mtrace: *************** *** 95,103 **** ! CFLAGS=$(MODECFLAGS) $(DTCFLAGS) $(SQLCFLAGS) $(ROADMAP_USE_SHAPEFILES) -I/usr/local/include -I$(PWD) LDFLAGS=$(MODELDFLAGS) $(SQLLDFLAGS) $(SHAPELDFLAGS) RDMLIBS=libroadmap.a unix/libosroadmap.a gpx/libgpx.a ! LIBS=$(RDMLIBS) -lpopt -lexpat -lm # --- RoadMap sources & targets -------------------------------------------- --- 103,111 ---- ! CFLAGS=$(MODECFLAGS) $(EXPATCFLAGS) $(DTCFLAGS) $(SQLCFLAGS) $(ROADMAP_USE_SHAPEFILES) -I/usr/local/include -I$(PWD) LDFLAGS=$(MODELDFLAGS) $(SQLLDFLAGS) $(SHAPELDFLAGS) RDMLIBS=libroadmap.a unix/libosroadmap.a gpx/libgpx.a ! LIBS=$(RDMLIBS) -lpopt $(EXPATLDFLAGS) -lm # --- RoadMap sources & targets -------------------------------------------- |
From: Ehud S. <esh...@us...> - 2006-04-21 17:29:31
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30519 Modified Files: roadmap_main.cpp Log Message: Profiling support. Index: roadmap_main.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_main.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_main.cpp 22 Mar 2006 08:54:10 -0000 1.7 --- roadmap_main.cpp 21 Apr 2006 17:29:25 -0000 1.8 *************** *** 30,34 **** #include <aygshell.h> #include "resource.h" ! #include <Winsock.h> extern "C" { --- 30,38 ---- #include <aygshell.h> #include "resource.h" ! #include <Winsock.h> ! ! #ifdef WIN32_PROFILE ! #include <C:\Program Files\Windows CE Tools\Common\Platman\sdk\wce500\include\cecap.h> ! #endif extern "C" { *************** *** 108,111 **** --- 112,119 ---- } + #ifdef WIN32_PROFILE + SuspendCAPAll(); + #endif + /* DWORD disp; |
From: Ehud S. <esh...@us...> - 2006-04-21 17:26:29
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28788 Modified Files: roadmap_path.c Log Message: Add installation directory to the config set. Index: roadmap_path.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_path.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_path.c 31 Dec 2005 09:58:00 -0000 1.3 --- roadmap_path.c 21 Apr 2006 17:26:24 -0000 1.4 *************** *** 50,53 **** --- 50,54 ---- */ static const char *RoadMapPathConfig[] = { + "&", "\\Program Files\\roadmap", "\\Storage Card\\roadmap", |
From: Ehud S. <esh...@us...> - 2006-04-21 17:19:00
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24202 Added Files: roadmap_label.c roadmap_label.h Log Message: Add label support. --- NEW FILE: roadmap_label.c --- /* roadmap_label.c - Manage map labels. * * LICENSE: * * Copyright 2006 Ehud Shabtai * * This code was mostly taken from UMN Mapserver * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * SYNOPSYS: * * See roadmap_label.h. */ #include "roadmap_config.h" #include "roadmap_math.h" #include "roadmap_plugin.h" #include "roadmap_label.h" #define MIN(a, b) (a) < (b) ? (a) : (b) #define MAX(a, b) (a) > (b) ? (a) : (b) static RoadMapConfigDescriptor RoadMapConfigMinFeatureSize = ROADMAP_CONFIG_ITEM("Labels", "MinFeatureSize"); static labelCacheObj RoadMapLabelCache; static int RoadMapLabelCacheFull = 0; static int rect_overlap (RoadMapGuiRect *a, RoadMapGuiRect *b) { if(a->minx > b->maxx) return 0; if(a->maxx < b->minx) return 0; if(a->miny > b->maxy) return 0; if(a->maxy < b->miny) return 0; return 1; } static void compute_bbox(RoadMapGuiPoint *poly, RoadMapGuiRect *bbox) { int i; bbox->minx = bbox->maxx = poly[0].x; bbox->miny = bbox->maxy = poly[0].y; for(i=1; i<4; i++) { bbox->minx = MIN(bbox->minx, poly[i].x); bbox->maxx = MAX(bbox->maxx, poly[i].x); bbox->miny = MIN(bbox->miny, poly[i].y); bbox->maxy = MAX(bbox->maxy, poly[i].y); } } static RoadMapGuiPoint get_metrics(RoadMapGuiPoint *p, RoadMapGuiRect *rect, int ox, int oy, int angle, RoadMapGuiRect *bbox) { RoadMapGuiPoint q; int x1=0, y1=0; RoadMapGuiPoint poly[4]; int w, h; int buffer = 0; int lines = 2; w = rect->maxx - rect->minx; h = rect->maxy - rect->miny; /* position CC */ x1 = -(int)(w/2.0) + ox; y1 = (int)(h/2.0) + oy; q.x = x1 - rect->minx; q.y = rect->maxy - y1; roadmap_math_rotate_point (&q, p, angle); poly[0].x = x1 - buffer; /* ll */ poly[0].y = -(y1 + buffer); roadmap_math_rotate_point (&poly[0], p, angle); poly[1].x = x1 - buffer; /* ul */ poly[1].y = -(y1 -h - buffer); roadmap_math_rotate_point (&poly[1], p, angle); poly[2].x = x1 + w + buffer; /* ur */ poly[2].y = -(y1 -h - buffer); roadmap_math_rotate_point (&poly[2], p, angle); poly[3].x = x1 + w + buffer; /* lr */ poly[3].y = -(y1 + buffer); roadmap_math_rotate_point (&poly[3], p, angle); lines = 4; //roadmap_canvas_draw_multiple_lines(1, &lines, poly); compute_bbox(poly, bbox); return q; } int roadmap_label_add (const RoadMapGuiPoint *point, int angle, int featuresize, const PluginLine *line) { labelCacheMemberObj *cachePtr; if (RoadMapLabelCacheFull) return -1; if (featuresize < roadmap_config_get_integer (&RoadMapConfigMinFeatureSize)) { return -1; } if(RoadMapLabelCache.numlabels == MAX_LABELS) { roadmap_log (ROADMAP_ERROR, "Too many lables on screen."); RoadMapLabelCacheFull = 1; return -1; } cachePtr = &(RoadMapLabelCache.labels[RoadMapLabelCache.numlabels]); cachePtr->featuresize = featuresize; cachePtr->line = *line; cachePtr->angle = angle; cachePtr->point = *point; cachePtr->status = 0; RoadMapLabelCache.numlabels++; return 0; } int roadmap_label_draw_cache (void) { int l; int i; int width; int ascent; int descent; RoadMapGuiPoint p; RoadMapGuiRect r; int label_offsetx = 0; int label_offsety = 0; const char *text; labelCacheMemberObj *cachePtr=NULL; for(l=0; l<RoadMapLabelCache.numlabels; l++) { PluginStreetProperties properties; cachePtr = &(RoadMapLabelCache.labels[l]); roadmap_plugin_get_street_properties (&cachePtr->line, &properties); if (!properties.street || !*properties.street) { continue; } text = properties.street; cachePtr->street = properties.plugin_street; roadmap_canvas_get_text_extents(text, &width, &ascent, &descent); r.minx = 0; r.maxx=width; r.miny = -ascent; r.maxy = descent; //FIXME width *= 1.5; /* label_offsety += MS_NINT(((bbox[5] + bbox[1]) + size) / 2); label_offsetx += MS_NINT(bbox[0] / 2); */ /* text is too long for this feature */ if ((width >> 2)> cachePtr->featuresize) { continue; } cachePtr->status = 1; /* assume label *can* be drawn */ /* The stored point is not screen orieneted, rotate is needed */ roadmap_math_rotate_coordinates (1, &cachePtr->point); cachePtr->angle += roadmap_math_get_orientation (); while (cachePtr->angle > 360) cachePtr->angle -= 360; while (cachePtr->angle < 0) cachePtr->angle += 360; if (cachePtr->angle >= 180) cachePtr->angle -= 180; cachePtr->angle -= 90; //cachePtr->angle = (int)(cachePtr->angle / 18) * 18; p = get_metrics (&(cachePtr->point), &r, label_offsetx, label_offsety, cachePtr->angle, &cachePtr->bbox); /* if(!labelPtr->partials) { if(labelInImage(img->sx, img->sy, cachePtr->poly, labelPtr->buffer+map_edge_buffer) == 0) cachePtr->status = 0; } */ if(!cachePtr->status) continue; /* next label */ for(i=0; i<l; i++) { /* compare against rendered label */ if(RoadMapLabelCache.labels[i].status == 1) { /* compare bounding polygons and check for duplicates */ /* MIN_DISTANCE */ if(roadmap_plugin_same_street(&cachePtr->street, &RoadMapLabelCache.labels[i].street)) { /* label is a duplicate */ cachePtr->status = 0; break; } if(rect_overlap (&RoadMapLabelCache.labels[i].bbox, &cachePtr->bbox)) { cachePtr->status = 0; break; } } } /* imagePolyline(img, cachePtr->poly, 1, 0, 0); */ if(!cachePtr->status) continue; /* next label */ roadmap_canvas_draw_string_angle (&p, &cachePtr->point, cachePtr->angle, text); } /* next label */ RoadMapLabelCache.numlabels = 0; RoadMapLabelCacheFull = 0; return 0; } int roadmap_label_initialize (void) { roadmap_config_declare ("preferences", &RoadMapConfigMinFeatureSize, "25"); return 0; } --- NEW FILE: roadmap_label.h --- /* roadmap_label.h - Manage map labels. * * LICENSE: * * Copyright 2006 Ehud Shabtai * * This code was mostly taken from UMN Mapserver * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __ROADMAP_LABEL__H #define __ROADMAP_LABEL__H #include "roadmap.h" #include "roadmap_gui.h" #define MAX_LABELS 50 typedef struct { int featuresize; PluginLine line; PluginStreet street; int angle; /* degrees */ RoadMapGuiPoint point; /* label point */ RoadMapGuiRect bbox; /* label bounding box */ int status; /* has this label been drawn or not */ } labelCacheMemberObj; typedef struct { labelCacheMemberObj labels[MAX_LABELS]; int numlabels; } labelCacheObj; int roadmap_label_add (const RoadMapGuiPoint *point, int angle, int featuresize, const PluginLine *line); int roadmap_label_initialize (void); int roadmap_label_draw_cache (void); #endif // __ROADMAP_LABEL__H |
Update of /cvsroot/roadmap/roadmap_editor/src/fribidi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30647 Added Files: fribidi-config.in fribidi.c fribidi.h fribidi.pc.in fribidi.spec fribidi.spec.in fribidi_benchmark.c fribidi_bidi_types.c fribidi_char_sets.c fribidi_char_sets.h fribidi_char_sets.i fribidi_char_sets_cap_rtl.c fribidi_char_sets_cap_rtl.h fribidi_char_sets_cp1255.c fribidi_char_sets_cp1255.h fribidi_char_sets_cp1256.c fribidi_char_sets_cp1256.h fribidi_char_sets_isiri_3342.c fribidi_char_sets_isiri_3342.h fribidi_char_sets_iso8859_6.c fribidi_char_sets_iso8859_6.h fribidi_char_sets_iso8859_8.c fribidi_char_sets_iso8859_8.h fribidi_char_sets_utf8.c fribidi_char_sets_utf8.h fribidi_char_type.c fribidi_config.h fribidi_config.h.in fribidi_create_char_types.c fribidi_create_mirroring.c fribidi_main.c fribidi_mem.c fribidi_mem.h fribidi_mirroring.c fribidi_tab_char_type_2.i fribidi_tab_char_type_9.i fribidi_tab_mirroring.i fribidi_types.c fribidi_types.h fribidi_types.i fribidi_unicode.h fribidi_utils.c getopt.c getopt.h getopt1.c getopt_int.h gettext.h packtab.c packtab.h wcwidth.c wcwidth.i Log Message: Import fribidi sources. --- NEW FILE: fribidi_config.h --- #define FRIBIDI_PACKAGE "fribidi" #define FRIBIDI_VERSION "0.10.7" #define FRIBIDI_MAJOR_VERSION 0 #define FRIBIDI_MINOR_VERSION 10 #define FRIBIDI_MICRO_VERSION 7 #define FRIBIDI_INTERFACE_VERSION 2 #if 1 /* FRIBIDI_NO_CHARSETS */ #define FRIBIDI_NO_CHARSETS 1 #else /* NOT FRIBIDI_NO_CHARSETS */ #undef FRIBIDI_NO_CHARSETS #endif /* FRIBIDI_NO_CHARSETS */ #define TOSTR(x) #x #ifdef WIN32 #define MEM_OPTIMIZED #define HAS_FRIBIDI_TAB_CHAR_TYPE_9_I 1 #define FRIBIDI_API #define snprintf _snprintf #else /* NOT WIN32 */ #define FRIBIDI_API #endif /* WIN32 */ #define FRIBIDI_TRUE 1 #define FRIBIDI_FALSE 0 #ifndef TRUE #define TRUE FRIBIDI_TRUE #endif /* TRUE */ #ifndef FALSE #define FALSE FRIBIDI_FALSE #endif /* FALSE */ #define FRIBIDI_SIZEOF_SHORT 2 #define FRIBIDI_SIZEOF_INT 4 #define FRIBIDI_SIZEOF_LONG 4 --- NEW FILE: fribidi_create_char_types.c --- /* FriBidi - Library of BiDi algorithm * Copyright (C) 2001,2002 Behdad Esfahbod. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library, in a file named COPYING; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA * * For licensing issues, contact <fw...@sh...>. */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include "packtab.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fribidi_unicode.h" static void err (const char *msg) { fprintf (stderr, "fribidi_create_char_types: %s\n", msg); exit (1); } static void err2 (const char *fmt, const char *p) { fprintf (stderr, "fribidi_create_char_types: "); fprintf (stderr, fmt, p); fprintf (stderr, "\n"); exit (1); } /* *INDENT-OFF* */ struct { const char *name; int key; } type_names[] = { {"LTR", 0}, {"L", 0}, {"RTL", 1}, {"R", 1}, {"AL", 2}, {"ON", 3}, {"BN", 4}, {"AN", 5}, {"BS", 6}, {"B", 6}, {"CS", 7}, {"EN", 8}, {"ES", 9}, {"ET", 10}, {"LRE", 11}, {"LRO", 12}, {"NSM", 13}, {"PDF", 14}, {"RLE", 15}, {"RLO", 16}, {"SS", 17}, {"S", 17}, {"WS", 18}, }; /* *INDENT-ON* */ #define type_names_count (sizeof (type_names) / sizeof (type_names[0])) static char *names[type_names_count]; static char *unidata_file; static char get_type (const char *s) { int i; for (i = 0; i < type_names_count; i++) if (!strcmp (s, type_names[i].name)) return type_names[i].key; err2 ("type name `%s' not found", s); return 0; } #define table_name "FriBidiPropertyBlock" #define key_type_name "FriBidiPropCharType" #define macro_name "FRIBIDI_GET_TYPE" #define function_name "fribidi_get_type_internal" #define char_type_name "FriBidiCharType" #define char_name "FriBidiChar" #define prop_to_type_name "fribidi_prop_to_type" #define default_type "LTR" #define export_api "FRIBIDI_API" static int table[FRIBIDI_UNICODE_CHARS]; static void init_table (void) { int i; register FriBidiChar c; int deftype = get_type (default_type), RTL = get_type ("RTL"), AL = get_type ("AL"), BN = get_type ("BN"); for (i = 0; i < type_names_count; i++) names[i] = 0; for (i = type_names_count - 1; i >= 0; i--) names[type_names[i].key] = type_names[i].name; /* initialize table */ for (c = 0; c < FRIBIDI_UNICODE_CHARS; c++) table[c] = deftype; for (c = 0x0590; c < 0x0600; c++) table[c] = RTL; for (c = 0x07C0; c < 0x0900; c++) table[c] = RTL; for (c = 0xFB1D; c < 0xFB50; c++) table[c] = RTL; for (c = 0x0600; c < 0x07C0; c++) table[c] = AL; for (c = 0xFB50; c < 0xFDD0; c++) table[c] = AL; for (c = 0xFDF0; c < 0xFE00; c++) table[c] = AL; for (c = 0xFE70; c < 0xFF00; c++) table[c] = AL; for (c = 0x2060; c < 0x2070; c++) table[c] = BN; for (c = 0xFDD0; c < 0xFDF0; c++) table[c] = BN; for (c = 0xFFF0; c < 0xFFF9; c++) table[c] = BN; for (c = 0xFFFF; c < FRIBIDI_UNICODE_CHARS; c += 0x10000) table[c - 1] = table[c] = BN; if (FRIBIDI_UNICODE_CHARS > 0x10000) { for (c = 0x10800; c < 0x11000; c++) table[c] = RTL; for (c = 0xE0000; c < 0xE1000; c++) table[c] = BN; } } static void read_unicode_data (void) { char s[500], tp[10]; unsigned int i; FILE *f; printf ("Reading `UnicodeData.txt'\n"); if (!(f = fopen (unidata_file, "rt"))) err2 ("error: cannot open `%s' for reading", unidata_file); while (fgets (s, sizeof s, f)) { sscanf (s, "%x;%*[^;];%*[^;];%*[^;];%[^;]", &i, tp); table[i] = get_type (tp); } fclose (f); } static char * headermacro (const char *file) { char *t = strdup (file); char *p = t; while (*p) { if (*p >= 'a' && *p <= 'z') *p += 'A' - 'a'; else if ((*p < 'A' || *p > 'Z') && (*p < '0' || *p > '9')) *p = '_'; p++; } return t; } static void write_char_type (const char *file, int max_depth) { int i; FILE *f; char *FILENAME = headermacro (file); printf ("Writing `%s', it may take a few minutes\n", file); if (!(f = fopen (file, "wt"))) err2 ("error: cannot open `%s' for writing", file); fprintf (f, "/*\n" " This file was automatically created from UnicodeData.txt version %s\n" " by fribidi_create_char_types\n*/\n\n", FRIBIDI_UNICODE_VERSION); fprintf (f, "#ifndef %s\n#define %s\n\n#include \"fribidi.h\"\n\n", FILENAME, FILENAME); for (i = 0; i < type_names_count; i++) if (names[i]) fprintf (f, "#define %s FRIBIDI_PROP_TYPE_%s\n", names[i], names[i]); fprintf (f, "\n"); fprintf (f, "#define PACKTAB_UINT8 fribidi_uint8\n"); fprintf (f, "#define PACKTAB_UINT16 fribidi_uint16\n"); fprintf (f, "#define PACKTAB_UINT32 fribidi_uint32\n"); if (!pack_table (table, FRIBIDI_UNICODE_CHARS, sizeof (char), max_depth, 3, names, key_type_name, table_name, macro_name, f)) err ("error: insufficient memory, decrease max_depth"); for (i = type_names_count - 1; i >= 0; i--) if (names[i]) fprintf (f, "#undef %s\n", names[i]); fprintf (f, "/*======================================================================\n" " * %s() returns the bidi type of a character.\n" " *----------------------------------------------------------------------*/\n" "%s %s\n" "%s (%s uch)\n" "{\n" " if (uch < 0x%x)\n" " return %s[(unsigned char)%s (uch)];\n" " else\n" " return FRIBIDI_TYPE_%s;\n" " /* Non-Unicode chars */\n" "}\n" "\n", function_name, export_api, char_type_name, function_name, char_name, FRIBIDI_UNICODE_CHARS, prop_to_type_name, macro_name, default_type); fprintf (f, "\n#endif /* %s */\n", FILENAME); fclose (f); } int main (int argc, char **argv) { int max_depth; char file[50], *p; if (argc < 2) err ("usage: fribidi_create_char_types max_depth [UnicodeData.txt path]"); p = (argc >= 3) ? argv[2] : "unidata"; unidata_file = malloc (50 + strlen (p)); sprintf (unidata_file, "%s/UnicodeData.txt", p); max_depth = atoi (argv[1]); if (!max_depth) err ("invalid depth"); if (max_depth < 2 || max_depth > 9) err2 ("invalid max_depth `%s', max_depth should be between 2 and 9", argv[1]); sprintf (file, "fribidi_tab_char_type_%d.i", max_depth); init_table (); read_unicode_data (); write_char_type (file, max_depth); return 0; } --- NEW FILE: fribidi_tab_char_type_2.i --- /* This file was automatically created from UnicodeData.txt version 4.1.0 by fribidi_create_char_types */ #ifndef FRIBIDI_TAB_CHAR_TYPE_2_I #define FRIBIDI_TAB_CHAR_TYPE_2_I #include "fribidi.h" #define LTR FRIBIDI_PROP_TYPE_LTR #define RTL FRIBIDI_PROP_TYPE_RTL #define AL FRIBIDI_PROP_TYPE_AL #define ON FRIBIDI_PROP_TYPE_ON #define BN FRIBIDI_PROP_TYPE_BN #define AN FRIBIDI_PROP_TYPE_AN #define BS FRIBIDI_PROP_TYPE_BS #define CS FRIBIDI_PROP_TYPE_CS #define EN FRIBIDI_PROP_TYPE_EN [...5549 lines suppressed...] #undef BN #undef ON #undef AL #undef RTL #undef LTR /*====================================================================== * fribidi_get_type_internal() returns the bidi type of a character. *----------------------------------------------------------------------*/ FRIBIDI_API FriBidiCharType fribidi_get_type_internal (FriBidiChar uch) { if (uch < 0x110000) return fribidi_prop_to_type[(unsigned char)FRIBIDI_GET_TYPE (uch)]; else return FRIBIDI_TYPE_LTR; /* Non-Unicode chars */ } #endif /* FRIBIDI_TAB_CHAR_TYPE_2_I */ --- NEW FILE: fribidi_bidi_types.c --- #include <stdio.h> #include <fribidi.h> int main (void) { FriBidiChar c; for (c = 0; c < FRIBIDI_UNICODE_CHARS; c++) printf ("0x%04lx %s\n", (long) c, fribidi_type_name (fribidi_get_type (c))); return 0; } --- NEW FILE: fribidi_main.c --- /* FriBidi - Library of BiDi algorithm * Copyright (C) 1999,2000 Dov Grobgeld, and * Copyright (C) 2001,2002 Behdad Esfahbod. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library, in a file named COPYING; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA * * For licensing issues, contact <do...@im...> and * <fw...@sh...>. */ /*====================================================================== * A main program for fribidi. *----------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H #include <config.h> #endif /* HAVE_CONFIG_H */ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <string.h> #ifdef FRIBIDI_NO_CHARSETS #include <iconv.h> #endif #include "getopt.h" #include "fribidi.h" #define appname "fribidi" #define appversion VERSION extern char *fribidi_version_info; #define MAX_STR_LEN 65000 #define ALLOCATE(tp,ln) ((tp *) malloc (sizeof (tp) * (ln))) static void die (char *fmt, ...) { va_list ap; va_start (ap, fmt); if (fmt) { fprintf (stderr, "%s: ", appname); vfprintf (stderr, fmt, ap); } fprintf (stderr, "Try `%s --help' for more information.\n", appname); exit (-1); } fribidi_boolean do_break, do_pad, do_mirror, do_reorder_nsm, do_clean, show_input, show_changes; fribidi_boolean show_visual, show_basedir, show_ltov, show_vtol, show_levels; int text_width; char *char_set; char *bol_text, *eol_text; FriBidiCharType input_base_direction; #ifdef FRIBIDI_NO_CHARSETS iconv_t to_ucs4, from_ucs4; #else int char_set_num; #endif static void help (void) { /* Break help string into little ones, to assure ISO C89 conformance */ printf ("Usage: " appname " [OPTION]... [FILE]...\n" "A command line interface for the " FRIBIDI_PACKAGE " library,\n" "Converts a logical string to visual.\n" "\n" " -h, --help Display this information and exit\n" " -V, --version Display version information and exit\n" " -v, --verbose Verbose mode, same as --basedir --ltov --vtol \\\n" " --levels --changes\n"); printf (" -d, --debug Output debug information\n" " -t, --test Test " FRIBIDI_PACKAGE ", same as --clean --nobreak --showinput \\\n" " --reordernsm\n"); #ifdef FRIBIDI_NO_CHARSETS printf (" -c, --charset CS Specify character set, default is %s \\\n" " CS should be a valid iconv character set name\n", char_set); #else printf (" -c, --charset CS Specify character set, default is %s\n" " --charsetdesc CS Show descriptions for character set CS and exit\n" " --caprtl Old style: set character set to CapRTL\n", char_set); #endif printf (" --showinput Output the input string too\n" " --nopad Do not right justify RTL lines\n" " --nobreak Do not break long lines\n" " -w, --width W Screen width for padding, default is %d, but if \\\n" " enviroment variable COLUMNS is defined, its value \\\n" " will be used, --width overrides both of them.\\\n", text_width); printf (" -B, --bol BOL Output string BOL before the visual string\n" " -E, --eol EOL Output string EOL after the visual string\n" " --rtl Force base direction to RTL\n" " --ltr Force base direction to LTR\n" " --wrtl Set base direction to RTL if no strong character found\n"); printf (" --wltr Set base direction to LTR if no strong character found \\\n" " (default)\n" " --nomirror Turn mirroring off, to do it later\n" " --reordernsm Reorder NSM sequences to follow their base character\n" " --clean Remove explicit format codes in visual string \\\n" " output, currently does not affect other outputs\n" " --basedir Output Base Direction\n"); printf (" --ltov Output Logical to Visual position map\n" " --vtol Output Visual to Logical position map\n" " --levels Output Embedding Levels\n" " --changes Output information about changes between \\\n" " logical and visual string (start, length)\n" " --novisual Do not output the visual string, to be used with \\\n" " --basedir, --ltov, --vtol, --levels, --changes\n"); printf (" All string indexes are zero based\n" "\n" "Output:\n" " For each line of input, output something like this:\n" " [input-str` => '][BOL][[padding space]visual-str][EOL]\n" " [\\n base-dir][\\n ltov-map][\\n vtol-map][\\n levels][\\n changes]\n"); #ifndef FRIBIDI_NO_CHARSETS { int i; printf ("\n" "Available character sets:\n"); for (i = 1; i <= FRIBIDI_CHAR_SETS_NUM; i++) printf (" * %-10s: %-25s%1s\n", fribidi_char_set_name (i), fribidi_char_set_title (i), (fribidi_char_set_desc (i) ? "X" : "")); printf (" X: Character set has descriptions, use --charsetdesc to see\n"); } #endif printf ("\nReport bugs online at <http://fribidi.org/bug>.\n"); exit (0); } static void version (void) { printf ("%s", fribidi_version_info); exit (0); } int main (int argc, char *argv[]) { int exit_val; fribidi_boolean file_found; char *s; FILE *IN; text_width = 80; do_break = FRIBIDI_TRUE; do_pad = FRIBIDI_TRUE; do_mirror = FRIBIDI_TRUE; do_clean = FRIBIDI_FALSE; do_reorder_nsm = FRIBIDI_FALSE; show_input = FRIBIDI_FALSE; show_visual = FRIBIDI_TRUE; show_basedir = FRIBIDI_FALSE; show_ltov = FRIBIDI_FALSE; show_vtol = FRIBIDI_FALSE; show_levels = FRIBIDI_FALSE; show_changes = FRIBIDI_FALSE; char_set = "UTF-8"; bol_text = NULL; eol_text = NULL; input_base_direction = FRIBIDI_TYPE_ON; if ((s = getenv ("COLUMNS"))) { int i; i = atoi (s); if (i > 0) text_width = i; } #define CHARSETDESC 257 #define CAPRTL 258 /* Parse the command line with getopt library */ /* Must set argv[0], getopt uses it to generate error messages */ argv[0] = appname; while (1) { int option_index = 0, c; static struct option long_options[] = { {"help", 0, 0, 'h'}, {"version", 0, 0, 'V'}, {"verbose", 0, 0, 'v'}, {"debug", 0, 0, 'd'}, {"test", 0, 0, 't'}, {"charset", 1, 0, 'c'}, #ifndef FRIBIDI_NO_CHARSETS {"charsetdesc", 1, 0, CHARSETDESC}, {"caprtl", 0, 0, CAPRTL}, #endif {"showinput", 0, &show_input, FRIBIDI_TRUE}, {"nopad", 0, &do_pad, FRIBIDI_FALSE}, {"nobreak", 0, &do_break, FRIBIDI_FALSE}, {"width", 1, 0, 'w'}, {"bol", 1, 0, 'B'}, {"eol", 1, 0, 'E'}, {"nomirror", 0, &do_mirror, FRIBIDI_FALSE}, {"reordernsm", 0, &do_reorder_nsm, FRIBIDI_TRUE}, {"clean", 0, &do_clean, FRIBIDI_TRUE}, {"ltr", 0, (int *) &input_base_direction, FRIBIDI_TYPE_L}, {"rtl", 0, (int *) &input_base_direction, FRIBIDI_TYPE_R}, {"wltr", 0, (int *) &input_base_direction, FRIBIDI_TYPE_WL}, {"wrtl", 0, (int *) &input_base_direction, FRIBIDI_TYPE_WR}, {"basedir", 0, &show_basedir, FRIBIDI_TRUE}, {"ltov", 0, &show_ltov, FRIBIDI_TRUE}, {"vtol", 0, &show_vtol, FRIBIDI_TRUE}, {"levels", 0, &show_levels, FRIBIDI_TRUE}, {"changes", 0, &show_changes, FRIBIDI_TRUE}, {"novisual", 0, &show_visual, FRIBIDI_FALSE}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "hVvdtc:w:B:E:", long_options, &option_index); if (c == -1) break; switch (c) { case 0: break; case 'h': help (); break; case 'V': version (); break; case 'v': show_basedir = FRIBIDI_TRUE; show_ltov = FRIBIDI_TRUE; show_vtol = FRIBIDI_TRUE; show_levels = FRIBIDI_TRUE; show_changes = FRIBIDI_TRUE; break; case 'w': text_width = atoi (optarg); if (text_width <= 0) die ("invalid screen width `%s'\n", optarg); break; case 'B': bol_text = optarg; break; case 'E': eol_text = optarg; break; case 'd': if (!fribidi_set_debug (FRIBIDI_TRUE)) die ("%s lib must be compiled with DEBUG option to enable\nturn debug info on.\n", FRIBIDI_PACKAGE); break; case 't': do_clean = FRIBIDI_TRUE; show_input = FRIBIDI_TRUE; do_break = FRIBIDI_FALSE; do_reorder_nsm = FRIBIDI_TRUE; break; case 'c': char_set = strdup (optarg); break; #ifndef FRIBIDI_NO_CHARSETS case CAPRTL: char_set = "CapRTL"; break; case CHARSETDESC: char_set = strdup (optarg); char_set_num = fribidi_parse_charset (char_set); if (!char_set_num) die ("unrecognized character set `%s'\n", char_set); if (!fribidi_char_set_desc (char_set_num)) die ("no description available for character set `%s'\n", fribidi_char_set_name (char_set_num)); else printf ("Descriptions for character set %s:\n" "\n" "%s", fribidi_char_set_title (char_set_num), fribidi_char_set_desc (char_set_num)); exit (0); break; #endif case ':': case '?': die (NULL); break; default: break; } } #ifdef FRIBIDI_NO_CHARSETS to_ucs4 = iconv_open ("WCHAR_T", char_set); from_ucs4 = iconv_open (char_set, "WCHAR_T"); #else char_set_num = fribidi_parse_charset (char_set); #endif #ifdef FRIBIDI_NO_CHARSETS if (to_ucs4 == (iconv_t) (-1) || from_ucs4 == (iconv_t) (-1)) #else if (!char_set_num) #endif die ("unrecognized character set `%s'\n", char_set); fribidi_set_mirroring (do_mirror); fribidi_set_reorder_nsm (do_reorder_nsm); exit_val = 0; file_found = FRIBIDI_FALSE; while (optind < argc || !file_found) { char *S_; S_ = optind < argc ? argv[optind++] : "-"; file_found = FRIBIDI_TRUE; /* Open the infile for reading */ if (S_[0] == '-' && !S_[1]) { IN = stdin; } else { IN = fopen (S_, "r"); if (!IN) { fprintf (stderr, "%s: %s: no such file or directory\n", appname, S_); exit_val = 1; continue; } } /* Read and process input one line at a time */ { char S_[MAX_STR_LEN]; int padding_width, break_width; padding_width = show_input ? (text_width - 10) / 2 : text_width; break_width = do_break ? padding_width : 3 * MAX_STR_LEN; while (fgets (S_, sizeof (S_) - 1, IN)) { char *new_line, *nl_found; FriBidiChar logical[MAX_STR_LEN]; char outstring[MAX_STR_LEN]; FriBidiCharType base; FriBidiStrIndex len; nl_found = ""; S_[sizeof (S_) - 1] = 0; len = strlen (S_); /* chop */ if (S_[len - 1] == '\n') { len--; S_[len] = '\0'; new_line = "\n"; } else new_line = ""; #ifdef FRIBIDI_NO_CHARSETS { char *st = S_, *ust = (char *) logical; int in_len = (int) len; len = sizeof logical; iconv (to_ucs4, &st, &in_len, &ust, (int *) &len); len = (FriBidiChar *) ust - logical; } #else len = fribidi_charset_to_unicode (char_set_num, S_, len, logical); #endif { FriBidiChar *visual; FriBidiStrIndex *ltov, *vtol; FriBidiLevel *levels; FriBidiStrIndex new_len; fribidi_boolean log2vis; visual = show_visual ? ALLOCATE (FriBidiChar, len + 1) : NULL; ltov = show_ltov ? ALLOCATE (FriBidiStrIndex, len + 1) : NULL; vtol = show_vtol ? ALLOCATE (FriBidiStrIndex, len + 1) : NULL; levels = show_levels ? ALLOCATE (FriBidiLevel, len + 1) : NULL; /* Create a bidi string. */ base = input_base_direction; log2vis = fribidi_log2vis (logical, len, &base, /* output */ visual, ltov, vtol, levels); if (log2vis) { if (show_input) printf ("%-*s => ", padding_width, S_); new_len = len; /* Remove explicit marks, if asked for. */ if (do_clean) len = fribidi_remove_bidi_marks (visual, len, ltov, vtol, levels); if (show_visual) { printf (nl_found); if (bol_text) printf ("%s", bol_text); /* Convert it to input charset and print. */ { FriBidiStrIndex idx, st; for (idx = 0; idx < len;) { FriBidiStrIndex wid, inlen; wid = break_width; st = idx; #ifndef FRIBIDI_NO_CHARSETS if (char_set_num != FRIBIDI_CHAR_SET_CAP_RTL) #endif while (wid > 0 && idx < len) wid -= fribidi_wcwidth (visual[idx++]); #ifndef FRIBIDI_NO_CHARSETS else while (wid > 0 && idx < len) { wid--; idx++; } #endif if (wid < 0 && idx > st + 1) idx--; inlen = idx - st; #ifdef FRIBIDI_NO_CHARSETS { char *str = outstring, *ust = (char *) (visual + st); int in_len = inlen * sizeof visual[0]; new_len = sizeof outstring; iconv (from_ucs4, &ust, &in_len, &str, (int *) &new_len); *str = '\0'; new_len = str - outstring; } #else new_len = fribidi_unicode_to_charset (char_set_num, visual + st, inlen, outstring); #endif if (FRIBIDI_IS_RTL (base)) printf ("%*s", (int) (do_pad ? (padding_width + strlen (outstring) - (break_width - wid)) : 0), outstring); else printf ("%s", outstring); if (idx < len) printf ("\n"); } } if (eol_text) printf ("%s", eol_text); nl_found = "\n"; } if (show_basedir) { printf (nl_found); printf ("Base direction: %s", (FRIBIDI_DIR_TO_LEVEL (base) ? "R" : "L")); nl_found = "\n"; } if (show_ltov) { FriBidiStrIndex i; printf (nl_found); for (i = 0; i < len; i++) printf ("%ld ", (long) ltov[i]); nl_found = "\n"; } if (show_vtol) { FriBidiStrIndex i; printf (nl_found); for (i = 0; i < len; i++) printf ("%ld ", (long) vtol[i]); nl_found = "\n"; } if (show_levels) { FriBidiStrIndex i; printf (nl_found); for (i = 0; i < len; i++) printf ("%d ", (int) levels[i]); nl_found = "\n"; } if (show_changes) { FriBidiStrIndex change_start, change_len; fribidi_find_string_changes (logical, len, visual, new_len, &change_start, &change_len); printf ("%sChange start[length] = %d[%d]", nl_found, change_start, change_len); nl_found = "\n"; } } else { exit_val = 2; } if (show_visual) free (visual); if (show_ltov) free (ltov); if (show_vtol) free (vtol); if (show_levels) free (levels); } if (*nl_found) printf (new_line); } } } return exit_val; } --- NEW FILE: fribidi.c --- /* FriBidi - Library of BiDi algorithm * Copyright (C) 1999,2000 Dov Grobgeld, and * Copyright (C) 2001,2002 Behdad Esfahbod. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library, in a file named COPYING; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA * [...1414 lines suppressed...] "Copyright (C) 2001,2002,2005 Behdad Esfahbod <fr...@be...>.\n" "Copyright (C) 1999,2000 Dov Grobgeld\n" FRIBIDI_PACKAGE " comes with NO WARRANTY, to the extent permitted by law.\n" "You may redistribute copies of " FRIBIDI_PACKAGE " under the terms of\n" "the GNU Lesser General Public License.\n" "For more information about these matters, see the files named COPYING.\n" "\n" "Configured with following options:\n" #ifdef DEBUG "--enable-debug\n" #endif #ifdef MEM_OPTIMIZED "--enable-memopt\n" #endif #ifdef USE_SIMPLE_MALLOC "--enable-malloc\n" #endif #ifdef FRIBIDI_NO_CHARSETS "--without-charsts\n" #endif ; --- NEW FILE: fribidi_unicode.h --- /* FriBidi - Library of BiDi algorithm * Copyright (C) 2001,2002,2005 Behdad Esfahbod. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library, in a file named COPYING; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA * * For licensing issues, contact <fw...@sh...>. */ #ifndef FRIBIDI_UNICODE_H #define FRIBIDI_UNICODE_H #include "fribidi_config.h" #include "fribidi_types.h" #ifdef __cplusplus extern "C" { #endif /* Unicode version */ #define FRIBIDI_UNICODE_CHARS (sizeof(FriBidiChar) >= 4 ? 0x110000 : 0x10000) #define FRIBIDI_UNICODE_VERSION "4.1.0" /* UAX#9 Unicode BiDirectional Algorithm */ #define UNI_MAX_BIDI_LEVEL 61 /* BiDirectional marks */ #define UNI_LRM 0x200E #define UNI_RLM 0x200F #define UNI_LRE 0x202A #define UNI_RLE 0x202B #define UNI_PDF 0x202C #define UNI_LRO 0x202D #define UNI_RLO 0x202E /* Line and Paragraph separators */ #define UNI_LS 0x2028 #define UNI_PS 0x2029 /* Joining marks */ #define UNI_ZWNJ 0x200C #define UNI_ZWJ 0x200D /* Hebrew and Arabic */ #define UNI_HEBREW_ALEF 0x05D0 #define UNI_ARABIC_ALEF 0x0627 #define UNI_ARABIC_ZERO 0x0660 #define UNI_FARSI_ZERO 0x06F0 /* wcwidth functions */ FRIBIDI_API int fribidi_wcwidth (FriBidiChar ch); FRIBIDI_API int fribidi_wcswidth (const FriBidiChar *str, FriBidiStrIndex len); FRIBIDI_API int fribidi_wcswidth_cjk (const FriBidiChar *str, FriBidiStrIndex len); #ifdef __cplusplus } #endif #endif /* FRIBIDI_UNICODE_H */ --- NEW FILE: getopt.h --- /* Declarations for getopt. Copyright (C) 1989-1994,1996-1999,2001,2003,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include <features.h>, but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include <ctype.h>, which will pull in <features.h> for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include <ctype.h> #endif #ifndef __THROW # ifndef __GNUC_PREREQ # define __GNUC_PREREQ(maj, min) (0) # endif # if defined __cplusplus && __GNUC_PREREQ (2,8) # define __THROW throw () # else # define __THROW # endif #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt ( int ___argc, char *const *___argv, const char *__shortopts ) __THROW; #else /* not __GNU_LIBRARY__ */ extern int getopt ( ); #endif /* __GNU_LIBRARY__ */ #ifndef __need_getopt extern int getopt_long ( int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind ) __THROW; extern int getopt_long_only ( int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind ) __THROW; #endif #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ --- NEW FILE: fribidi_char_type.c --- /* FriBidi - Library of BiDi algorithm * Copyright (C) 2001,2002 Behdad Esfahbod. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library, in a file named COPYING; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA * * For licensing issues, contact <fw...@sh...>. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include "fribidi.h" /*====================================================================== * fribidi_get_type() returns the bidi type of a character. *----------------------------------------------------------------------*/ FRIBIDI_API FriBidiCharType fribidi_get_type_internal (FriBidiChar uch); FRIBIDI_API FriBidiCharType fribidi_get_type (FriBidiChar uch) { return fribidi_get_type_internal (uch); } FRIBIDI_API void fribidi_get_types ( /* input */ FriBidiChar *str, FriBidiStrIndex len, /* output */ FriBidiCharType *type) { FriBidiStrIndex i; for (i = 0; i < len; i++) type[i] = fribidi_get_type (str[i]); } #ifdef MEM_OPTIMIZED #if HAS_FRIBIDI_TAB_CHAR_TYPE_9_I #include "fribidi_tab_char_type_9.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_8_I #include "fribidi_tab_char_type_8.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_7_I #include "fribidi_tab_char_type_7.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_6_I #include "fribidi_tab_char_type_6.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_5_I #include "fribidi_tab_char_type_5.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_4_I #include "fribidi_tab_char_type_4.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_3_I #include "fribidi_tab_char_type_3.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_2_I #include "fribidi_tab_char_type_2.i" #else #error You have no fribidi_tab_char_type_*.i file, please first make one by \ make fribidi_tab_char_type_n.i which n is the compress level, a digit \ between 2 and 9, or simply run make fribidi_tab_char_type_small, \ retry to make. #endif #else #if HAS_FRIBIDI_TAB_CHAR_TYPE_2_I #include "fribidi_tab_char_type_2.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_3_I #include "fribidi_tab_char_type_3.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_4_I #include "fribidi_tab_char_type_4.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_5_I #include "fribidi_tab_char_type_5.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_6_I #include "fribidi_tab_char_type_6.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_7_I #include "fribidi_tab_char_type_7.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_8_I #include "fribidi_tab_char_type_8.i" #elif HAS_FRIBIDI_TAB_CHAR_TYPE_9_I #include "fribidi_tab_char_type_9.i" #else #error You have no fribidi_tab_char_type_*.i file, please first make one by \ make fribidi_tab_char_type_n.i which n is the compress level, a digit \ between 2 and 9, or simply run make fribidi_tab_char_type_large, \ retry to make. #endif #endif --- NEW FILE: gettext.h --- #undef gettext #define gettext --- NEW FILE: fribidi_char_sets_iso8859_6.c --- /* FriBidi - Library of BiDi algorithm * Copyright (C) 1999,2000 Dov Grobgeld, and * Copyright (C) 2001,2002 Behdad Esfahbod. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library, in a file named COPYING; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA * * For licensing issues, contact <do...@im...> and * <fw...@sh...>. */ #include "fribidi_config.h" #ifndef FRIBIDI_NO_CHARSETS #include <string.h> #include "fribidi.h" #define ISO_HAMZA 0xc1 #define ISO_SUKUN 0xf2 #define UNI_HAMZA 0x0621 #define UNI_SUKUN 0x0652 FriBidiChar fribidi_iso8859_6_to_unicode_c (char sch) { unsigned char ch = (unsigned char) sch; if (ch >= ISO_HAMZA && ch <= ISO_SUKUN) return ch - ISO_HAMZA + UNI_HAMZA; else return ch; } int fribidi_iso8859_6_to_unicode (char *s, int len, FriBidiChar *us) { int i; for (i = 0; i < len + 1; i++) us[i] = fribidi_iso8859_6_to_unicode_c (s[i]); return len; } char fribidi_unicode_to_iso8859_6_c (FriBidiChar uch) { if (uch >= UNI_HAMZA && uch <= UNI_SUKUN) return (char) (uch - UNI_HAMZA + ISO_HAMZA); /* TODO: handle pre-composed and presentation chars */ else if (uch < 256) return (char) uch; else if (uch == 0x060c) return (char) 0xac; else if (uch == 0x061b) return (char) 0xbb; else if (uch == 0x061f) return (char) 0xbf; else return '¿'; } int fribidi_unicode_to_iso8859_6 (FriBidiChar *us, int length, char *s) { int i; for (i = 0; i < length; i++) s[i] = fribidi_unicode_to_iso8859_6_c (us[i]); s[i] = 0; return length; } #endif --- NEW FILE: fribidi_char_sets_iso8859_8.h --- /* FriBidi - Library of BiDi algorithm * Copyright (C) 1999,2000 Dov Grobgeld, and * Copyright (C) 2001,2002 Behdad Esfahbod. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library, in a file named COPYING; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA * * For licensing issues, contact <do...@im...> and * <fw...@sh...>. */ #include "fribidi_config.h" #ifndef FRIBIDI_NO_CHARSETS #ifndef FRIBIDI_CHAR_SETS_ISO8859_8_H #define FRIBIDI_CHAR_SETS_ISO8859_8_H #include "fribidi_types.h" #ifdef __cplusplus extern "C" { #endif #define fribidi_char_set_name_iso8859_8 "ISO8859-8" #define fribidi_char_set_title_iso8859_8 "ISO 8859-8 (Hebrew)" #define fribidi_char_set_desc_iso8859_8 NULL #define fribidi_char_set_enter_iso8859_8 NULL #define fribidi_char_set_leave_iso8859_8 NULL FriBidiChar fribidi_iso8859_8_to_unicode_c (char ch); int fribidi_iso8859_8_to_unicode (char *s, int length, /* Output */ FriBidiChar *us); char fribidi_unicode_to_iso8859_8_c (FriBidiChar uch); int fribidi_unicode_to_iso8859_8 (FriBidiChar *us, int length, /* Output */ char *s); #ifdef __cplusplus } #endif #endif /* FRIBIDI_CHAR_SETS_ISO8859_8_H */ #endif --- NEW FILE: fribidi_char_sets_utf8.h --- /* FriBidi - Library of BiDi algorithm * Copyright (C) 1999,2000 Dov Grobgeld, and * Copyright (C) 2001,2002 Behdad Esfahbod. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library, in a file named COPYING; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA * * For licensing issues, contact <do...@im...> and * <fw...@sh...>. */ #include "fribidi_config.h" #ifndef FRIBIDI_NO_CHARSETS #ifndef FRIBIDI_CHAR_SETS_UTF8_H #define FRIBIDI_CHAR_SETS_UTF8_H #include "fribidi_types.h" #ifdef __cplusplus extern "C" { #endif #define fribidi_char_set_name_utf8 "UTF-8" #define fribidi_char_set_title_utf8 "UTF-8 (Unicode)" #define fribidi_char_set_desc_utf8 NULL #define fribidi_char_set_enter_utf8 NULL #define fribidi_char_set_leave_utf8 NULL int fribidi_unicode_to_utf8 (FriBidiChar *us, int length, /* Output */ char *s); /* warning: the length of output string may exceed the length of the input */ /* the length of the string is returned */ int fribidi_utf8_to_unicode (char *s, int length, /* Output */ FriBidiChar *us); #ifdef __cplusplus } #endif #endif /* FRIBIDI_CHAR_SETS_UTF8_H */ #endif --- NEW FILE: fribidi_char_sets_cp1256.c --- /* FriBidi - Library of BiDi algorithm * Copyright (C) 1999,2000 Dov Grobgeld, and * Copyright (C) 2001,2002 Behdad Esfahbod. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library, in a file named COPYING; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA * * For licensing issues, contact <do...@im...> and * <fw...@sh...>. */ #include "fribidi_config.h" #ifndef FRIBIDI_NO_CHARSETS #include <string.h> #include "fribidi.h" #define ISO_ALEF 224 #define ISO_TAV 250 #define ISO_HAMZA 0xc1 #define CP1256_DAD 0xD6 #define UNI_HAMZA 0x0621 #define UNI_DAD 0x0636 FriBidiChar fribidi_cp1256_to_unicode_tab[] = { /* 0x80-0xFF */ 0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688, 0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA, 0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x06BE, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F, 0x06C1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F, 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00D7, 0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0641, 0x0642, 0x0643, 0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF, 0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7, 0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x00ff }; FriBidiChar fribidi_cp1256_to_unicode_c (char sch) { unsigned char ch = (unsigned char) sch; if (ch >= 0x80) return fribidi_cp1256_to_unicode_tab[ch - 0x80]; else return ch; } int fribidi_cp1256_to_unicode (char *s, int len, FriBidiChar *us) { int i; for (i = 0; i < len + 1; i++) us[i] = fribidi_cp1256_to_unicode_c (s[i]); return len; } char fribidi_unicode_to_cp1256_c (FriBidiChar uch) { if (uch < 256) return (char) uch; if (uch >= UNI_HAMZA && uch <= UNI_DAD) return (char) (uch - UNI_HAMZA + ISO_HAMZA); else switch (uch) { case 0x0152: return (char) 0x8c; case 0x0153: return (char) 0x9c; case 0x0192: return (char) 0x83; case 0x02C6: return (char) 0x88; case 0x060C: return (char) 0xA1; case 0x061B: return (char) 0xBA; case 0x061F: return (char) 0xBF; case 0x0637: return (char) 0xD8; case 0x0638: return (char) 0xD9; case 0x0639: return (char) 0xDA; case 0x063A: return (char) 0xDB; case 0x0640: return (char) 0xDC; case 0x0641: return (char) 0xDD; case 0x0642: return (char) 0xDE; case 0x0643: return (char) 0xDF; case 0x0644: return (char) 0xE1; case 0x0645: return (char) 0xE3; case 0x0646: return (char) 0xE4; case 0x0647: return (char) 0xE5; case 0x0648: return (char) 0xE6; case 0x0649: return (char) 0xEC; case 0x064A: return (char) 0xED; case 0x064B: return (char) 0xF0; case 0x064C: return (char) 0xF1; case 0x064D: return (char) 0xF2; case 0x064E: return (char) 0xF3; case 0x064F: return (char) 0xF5; case 0x0650: return (char) 0xF6; case 0x0651: return (char) 0xF8; case 0x0652: return (char) 0xFA; case 0x0679: return (char) 0x8A; case 0x067E: return (char) 0x81; case 0x0686: return (char) 0x8D; case 0x0688: return (char) 0x8F; case 0x0691: return (char) 0x9A; case 0x0698: return (char) 0x8E; case 0x06A9: return (char) 0x98; case 0x06AF: return (char) 0x90; case 0x06BA: return (char) 0x9F; case 0x06BE: return (char) 0xAA; case 0x06C1: return (char) 0xC0; case 0x200C: return (char) 0x9D; case 0x200D: return (char) 0x9E; case 0x200E: return (char) 0xFD; case 0x200F: return (char) 0xFE; case 0x2013: return (char) 0x96; case 0x2014: return (char) 0x97; case 0x2018: return (char) 0x91; case 0x2019: return (char) 0x92; case 0x201A: return (char) 0x82; case 0x201C: return (char) 0x93; case 0x201D: return (char) 0x94; case 0x201E: return (char) 0x84; case 0x2020: return (char) 0x86; case 0x2021: return (char) 0x87; case 0x2022: return (char) 0x95; case 0x2026: return (char) 0x85; case 0x2030: return (char) 0x89; case 0x2039: return (char) 0x8B; case 0x203A: return (char) 0x9B; case 0x20AC: return (char) 0x80; case 0x2122: return (char) 0x99; default: return '¿'; } } int fribidi_unicode_to_cp1256 (FriBidiChar *us, int length, char *s) { int i; for (i = 0; i < length; i++) s[i] = fribidi_unicode_to_cp1256_c (us[i]); s[i] = 0; return length; } #endif --- NEW FILE: fribidi-config.in --- #!/bin/sh prefix=@prefix@ exec_prefix=@exec_prefix@ exec_prefix_set=no usage() { cat <<EOF Usage: fribidi-config [OPTIONS] [LIBRARIES] Options: [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags] EOF exit $1 } if test $# -eq 0; then usage 1 1>&2 fi while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --prefix=*) prefix=$optarg if test $exec_prefix_set = no ; then exec_prefix=$optarg fi ;; --prefix) echo_prefix=yes ;; --exec-prefix=*) exec_prefix=$optarg exec_prefix_set=yes ;; --exec-prefix) echo_exec_prefix=yes ;; --version) echo @VERSION@ ;; --cflags) echo_cflags=yes ;; --libs) echo_libs=yes ;; *) usage 1 1>&2 ;; esac shift done if test "$echo_prefix" = "yes"; then echo $prefix fi if test "$echo_exec_prefix" = "yes"; then echo $exec_prefix fi if test "$echo_cflags" = "yes"; then includes=-I@includedir@ echo $includes fi if test "$echo_libs" = "yes"; then libdirs=-L@libdir@ echo $libdirs -lfribidi fi --- NEW FILE: fribidi_char_sets_cp1256.h --- /* FriBidi - Library of BiDi algorithm * Copyright (C) 1999,2000 Dov Grobgeld, and * Copyright (C) 2001,2002 Behdad Esfahbod. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library, in a file named COPYING; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA * * For licensing issues, contact <do...@im...> and * <fw...@sh...>. */ #include "fribidi_config.h" #ifndef FRIBIDI_NO_CHARSETS #ifndef FRIBIDI_CHAR_SETS_CP1256_H #define FRIBIDI_CHAR_SETS_CP1256_H #include "fribidi_types.h" #ifdef __cplusplus extern "C" { #endif #define fribidi_char_set_name_cp1256 "CP1256" #define fribidi_char_set_title_cp1256 "CP1256 (MS-Arabic)" #define fribidi_char_set_desc_cp1256 NULL #define fribidi_char_set_enter_cp1256 NULL #define fribidi_char_set_leave_cp1256 NULL FriBidiChar fribidi_cp1256_to_unicode_c (char ch); int fribidi_cp1256_to_unicode (char *s, int length, /* Output */ FriBidiChar *us); char fribidi_unicode_to_cp1256_c (FriBidiChar uch); int fribidi_unicode_to_cp1256 (FriBidiChar *us, int length, /* Output */ char *s); #ifdef __cplusplus } #endif #endif /* FRIBIDI_CHAR_SETS_CP1256_H */ #endif --- NEW FILE: fribidi_char_sets_utf8.c --- /* FriBidi - Library of BiDi algorithm * Copyright (C) 1999,2000 Dov Grobgeld, and * Copyright (C) 2001,2002 Behdad Esfahbod. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library, in a file named COPYING; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA * * For licensing issues, contact <do...@im...> and * <fw...@sh...>. */ #include "fribidi_config.h" #ifndef FRIBIDI_NO_CHARSETS #include "fribidi.h" /* the following added by Raphael Finkel <ra...@cs...> 12/1999 */ int fribidi_utf8_to_unicode (char *s, int len, FriBidiChar *us) /* warning: the length of input string may exceed the length of the output */ { int length; char *t = s; length = 0; while (s - t < len) { if (*(unsigned char *) s <= 0x7f) /* one byte */ { *us++ = *s++; /* expand with 0s */ } else if (*(unsigned char *) s <= 0xdf) /* 2 byte */ { *us++ = ((*(unsigned char *) s & 0x1f) << 6) + ((*(unsigned char *) (s + 1)) & 0x3f); s += 2; } else /* 3 byte */ { *us++ = ((int) (*(unsigned char *) s & 0x0f) << 12) + ((*(unsigned char *) (s + 1) & 0x3f) << 6) + (*(unsigned char *) (s + 2) & 0x3f); s += 3; } length++; } *us = 0; return (length); } int fribidi_unicode_to_utf8 (FriBidiChar *us, int length, char *s) /* warning: the length of output string may exceed the length of the input */ { int i; char *t; t = s; for (i = 0; i < length; i++) { FriBidiChar mychar = us[i]; if (mychar <= 0x7F) { /* 7 sig bits */ *t++ = mychar; } else if (mychar <= 0x7FF) { /* 11 sig bits */ *t++ = 0xC0 | (unsigned char) (mychar >> 6); /* upper 5 bits */ *t++ = 0x80 | (unsigned char) (mychar & 0x3F); /* lower 6 bits */ } else if (mychar <= 0xFFFF) { /* 16 sig bits */ *t++ = 0xE0 | (unsigned char) (mychar >> 12); /* upper 4 bits */ *t++ = 0x80 | (unsigned char) ((mychar >> 6) & 0x3F); /* next 6 bits */ *t++ = 0x80 | (unsigned char) (mychar & 0x3F); /* lowest 6 bits */ } else if (mychar < FRIBIDI_UNICODE_CHARS) { /* 21 sig bits */ *t++ = 0xF0 | (unsigned char) ((mychar >> 18) & 0x07); /* upper 3 bits */ *t++ = 0x80 | (unsigned char) ((mychar >> 12) & 0x3F); /* next 6 bits */ *t++ = 0x80 | (unsigned char) ((mychar >> 6) & 0x3F); /* next 6 bits */ *t++ = 0x80 | (unsigned char) (mychar & 0x3F); /* lowest 6 bits */ } } *t = 0; return (t - s); } #endif --- NEW FILE: fribidi_char_sets_iso8859_8.c --- /* FriBidi - Library of BiDi algorithm * Copyright (C) 1999,2000 Dov Grobgeld, and * Copyright (C) 2001,2002 Behdad Esfahbod. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library, in a file named COPYING; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA * * For licensing issues, contact <do...@im...> and * <fw...@sh...>. */ #include "fribidi_config.h" #ifndef FRIBIDI_NO_CHARSETS #include <string.h> #include "fribidi.h" /* The following are proposed extensions to iso-8859-8. */ #define ISO_8859_8_LRM 253 #define ISO_8859_8_RLM 254 #define ISO_8859_8_LRE 251 #define ISO_8859_8_RLE 252 #define ISO_8859_8_PDF 221 #define ISO_8859_8_LRO 219 #define ISO_8859_8_RLO 220 #define ISO_ALEF 224 #define ISO_TAV 250 #define UNI_ALEF 0x05D0 #define UNI_TAV 0x05EA FriBidiChar fribidi_iso8859_8_to_unicode_c (char sch) { unsigned char ch = (unsigned char) sch; /* optimization */ if (ch < ISO_8859_8_LRO) return ch; else if (ch >= ISO_ALEF && ch <= ISO_TAV) return ch - ISO_ALEF + UNI_ALEF; switch (ch) { case ISO_8859_8_RLM: return UNI_RLM; case ISO_8859_8_LRM: return UNI_LRM; case ISO_8859_8_RLO: return UNI_RLO; case ISO_8859_8_LRO: return UNI_LRO; case ISO_8859_8_RLE: return UNI_RLE; case ISO_8859_8_LRE: return UNI_LRE; case ISO_8859_8_PDF: return UNI_PDF; default: return '?'; /* This shouldn't happen! */ } } int fribidi_iso8859_8_to_unicode (char *s, int len, FriBidiChar *us) { int i; for (i = 0; i < len + 1; i++) us[i] = fribidi_iso8859_8_to_unicode_c (s[i]); return len; } char fribidi_unicode_to_iso8859_8_c (FriBidiChar uch) { if (uch < 128) return (char) uch; if (uch >= UNI_ALEF && uch <= UNI_TAV) return (char) (uch - UNI_ALEF + ISO_ALEF); switch (uch) { case UNI_RLM: return (char) ISO_8859_8_RLM; case UNI_LRM: return (char) ISO_8859_8_LRM; case UNI_RLO: return (char) ISO_8859_8_RLO; case UNI_LRO: return (char) ISO_8859_8_LRO; case UNI_RLE: return (char) ISO_8859_8_RLE; case UNI_LRE: return (char) ISO_8859_8_LRE; case UNI_PDF: return (char) ISO_8859_8_PDF; } return '¿'; } int fribidi_unicode_to_iso8859_8 (FriBidiChar *us, int length, char *s) { int i; for (i = 0; i < length; i++) s[i] = fribidi_unicode_to_iso8859_8_c (us[i]); s[i] = 0; return length; } #endif --- NEW FILE: getopt_int.h --- /* Interna... [truncated message content] |
From: Ehud S. <esh...@us...> - 2006-04-21 16:34:16
|
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/bdf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30043/src/bdf Added Files: README Log Message: Import freetype sources. --- NEW FILE: README --- FreeType font driver for BDF fonts Francesco Zappa Nardelli <fra...@en...> Introduction ************ BDF (Bitmap Distribution Format) is a bitmap font format defined by Adobe, which is intended to be easily understood by both humans and computers. This code implements a BDF driver for the FreeType library, following the Adobe Specification V 2.2. The specification of the BDF font format is available from Adobe's web site: http://partners.adobe.com/asn/developer/PDFS/TN/5005.BDF_Spec.pdf Many good bitmap fonts in bdf format come with XFree86 (www.XFree86.org). They do not define vertical metrics, because the X Consortium BDF specification has removed them. Encodings ********* The variety of encodings that accompanies bdf fonts appears to encompass the small set defined in freetype.h. On the other hand, two properties that specify encoding and registry are usually defined in bdf fonts. I decided to make these two properties directly accessible, leaving to the client application the work of interpreting them. For instance: #include FT_INTERNAL_BDF_TYPES_H FT_Face face; BDF_Public_Face bdfface; FT_New_Face( library, ..., &face ); bdfface = (BDF_Public_Face)face; if ( ( bdfface->charset_registry == "ISO10646" ) && ( bdfface->charset_encoding == "1" ) ) [..] Thus the driver always exports `ft_encoding_none' as face->charmap.encoding. FT_Get_Char_Index's behavior is unmodified, that is, it converts the ULong value given as argument into the corresponding glyph number. If the two properties are not available, Adobe Standard Encoding should be assumed. Anti-Aliased Bitmaps ******************** The driver supports an extension to the BDF format as used in Mark Leisher's xmbdfed bitmap font editor. Microsoft's SBIT tool expects bitmap fonts in that format for adding anti-aliased them to TrueType fonts. It introduces a fourth field to the `SIZE' keyword which gives the bpp value (bits per pixel) of the glyph data in the font. Possible values are 1 (the default), 2 (four gray levels), 4 (16 gray levels), and 8 (256 gray levels). The driver returns either a bitmap with 1 bit per pixel or a pixmap with 8bits per pixel (using 4, 16, and 256 gray levels, respectively). Known problems ************** - A font is entirely loaded into memory. Obviously, this is not the Right Thing(TM). If you have big fonts I suggest you convert them into PCF format (using the bdftopcf utility): the PCF font drive of FreeType can perform incremental glyph loading. When I have some time, I will implement on-demand glyph parsing. - Except for encodings properties, client applications have no visibility of the PCF_Face object. This means that applications cannot directly access font tables and must trust FreeType. - Currently, glyph names are ignored. I plan to give full visibility of the BDF_Face object in an upcoming revision of the driver, thus implementing also glyph names. - As I have never seen a BDF font that defines vertical metrics, vertical metrics are (parsed and) discarded. If you own a BDF font that defines vertical metrics, please let me know (I will implement them in 5-10 minutes). License ******* Copyright (C) 2001-2002 by Francesco Zappa Nardelli Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *** Portions of the driver (that is, bdflib.c and bdf.h): Copyright 2000 Computing Research Labs, New Mexico State University Copyright 2001-2002 Francesco Zappa Nardelli Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Credits ******* This driver is based on excellent Mark Leisher's bdf library. If you find something good in this driver you should probably thank him, not me. |
From: Ehud S. <esh...@us...> - 2006-04-21 16:34:09
|
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30043/src/tools Added Files: cordic.py glnames.py Log Message: Import freetype sources. --- NEW FILE: cordic.py --- # compute arctangent table for CORDIC computations in fttrigon.c import sys, math #units = 64*65536.0 # don't change !! units = 256 scale = units/math.pi shrink = 1.0 comma = "" def calc_val( x ): global units, shrink angle = math.atan(x) shrink = shrink * math.cos(angle) return angle/math.pi * units def print_val( n, x ): global comma lo = int(x) hi = lo + 1 alo = math.atan(lo) ahi = math.atan(hi) ax = math.atan(2.0**n) errlo = abs( alo - ax ) errhi = abs( ahi - ax ) if ( errlo < errhi ): hi = lo sys.stdout.write( comma + repr( int(hi) ) ) comma = ", " print "" print "table of arctan( 1/2^n ) for PI = " + repr(units/65536.0) + " units" # compute range of "i" r = [-1] r = r + range(32) for n in r: if n >= 0: x = 1.0/(2.0**n) # tangent value else: x = 2.0**(-n) angle = math.atan(x) # arctangent angle2 = angle*scale # arctangent in FT_Angle units # determine which integer value for angle gives the best tangent lo = int(angle2) hi = lo + 1 tlo = math.tan(lo/scale) thi = math.tan(hi/scale) errlo = abs( tlo - x ) errhi = abs( thi - x ) angle2 = hi if errlo < errhi: angle2 = lo if angle2 <= 0: break sys.stdout.write( comma + repr( int(angle2) ) ) comma = ", " shrink = shrink * math.cos( angle2/scale) print print "shrink factor = " + repr( shrink ) print "shrink factor 2 = " + repr( shrink * (2.0**32) ) print "expansion factor = " + repr(1/shrink) print "" --- NEW FILE: glnames.py --- #!/usr/bin/env python # # # FreeType 2 glyph name builder # # Copyright 1996-2000, 2003, 2005 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. """\ [...5243 lines suppressed...] fprintf( stderr, "name '%s' => %04x instead of %04x\\n", name, value, reference ); } } return result; } """ ) write( "#endif /* TEST */\n" ) write("\n/* END */\n") # Now run the main routine # main() # END |
From: Ehud S. <esh...@us...> - 2006-04-21 16:34:07
|
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/pcf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30043/src/pcf Added Files: README Log Message: Import freetype sources. --- NEW FILE: README --- FreeType font driver for PCF fonts Francesco Zappa Nardelli <fra...@en...> Introduction ************ PCF (Portable Compiled Format) is a binary bitmap font format, largely used in X world. This code implements a PCF driver for the FreeType library. Glyph images are loaded into memory only on demand, thus leading to a small memory footprint. Informations on the PCF font format can only be worked out from ``pcfread.c'', and ``pcfwrite.c'', to be found, for instance, in the XFree86 (www.xfree86.org) source tree (xc/lib/font/bitmap/). Many good bitmap fonts in bdf format come with XFree86: they can be compiled into the pcf format using the ``bdftopcf'' utility. Supported hardware ****************** The driver has been tested on linux/x86 and sunos5.5/sparc. In both cases the compiler was gcc. When back in Paris, I will test it also on linux/alpha. Encodings ********* The variety of encodings that accompanies pcf fonts appears to encompass the small set defined in freetype.h. On the other hand, each pcf font defines two properties that specify encoding and registry. I decided to make these two properties directly accessible, leaving to the client application the work of interpreting them. For instance: #include "pcftypes.h" /* include/freetype/internal/pcftypes.h */ FT_Face face; PCF_Public_Face pcfface; FT_New_Face( library,..., &face ); pcfface = (PCF_Public_Face)face; if ((pcfface->charset_registry == "ISO10646") && (pcfface->charset_encoding) == "1")) [..] Thus the driver always export ``ft_encoding_none'' as face->charmap.encoding. FT_Get_Char_Index() behavior is unmodified, that is, it converts the ULong value given as argument into the corresponding glyph number. Known problems ************** - dealing explicitly with encodings breaks the uniformity of freetype2 api. - except for encodings properties, client applications have no visibility of the PCF_Face object. This means that applications cannot directly access font tables and are obliged to trust FreeType. - currently, glyph names and ink_metrics are ignored. I plan to give full visibility of the PCF_Face object in the next release of the driver, thus implementing also glyph names and ink_metrics. - height is defined as (ascent - descent). Is this correct? - if unable to read size informations from the font, PCF_Init_Face sets available_size->width and available_size->height to 12. - too many english grammar errors in the readme file :-( License ******* Copyright (C) 2000 by Francesco Zappa Nardelli Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Credits ******* Keith Packard wrote the pcf driver found in XFree86. His work is at the same time the specification and the sample implementation of the PCF format. Undoubtedly, this driver is inspired from his work. |
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/tools/docmaker In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30043/src/tools/docmaker Added Files: content.py docbeauty.py docmaker.py formatter.py sources.py tohtml.py utils.py Log Message: Import freetype sources. --- NEW FILE: content.py --- # # this file contains routines used to parse the content of documentation # comment block and build a more structured objects out of them # from sources import * from utils import * import string, re # this regular expresion is used to detect code sequences. these # are simply code fragments embedded in '{' and '}' like in: # # { # x = y + z; # if ( zookoo == 2 ) # { # foobar(); # } # } # # note that identation of the starting and ending accolades must be # exactly the same. the code sequence can contain accolades at greater # indentation # re_code_start = re.compile( r"(\s*){\s*$" ) re_code_end = re.compile( r"(\s*)}\s*$" ) # this regular expression is used to isolate identifiers from # other text # re_identifier = re.compile( r'(\w*)' ) ############################################################################# # # The DocCode class is used to store source code lines. # # 'self.lines' contains a set of source code lines that will be dumped as # HTML in a <PRE> tag. # # The object is filled line by line by the parser; it strips the leading # "margin" space from each input line before storing it in 'self.lines'. # class DocCode: def __init__( self, margin, lines ): self.lines = [] self.words = None # remove margin spaces for l in lines: if string.strip( l[:margin] ) == "": l = l[margin:] self.lines.append( l ) def dump( self, prefix = "", width=60 ): lines = self.dump_lines( 0, width ) for l in lines: print prefix + l def dump_lines( self, margin=0, width=60 ): result = [] for l in self.lines: result.append( " "*margin + l ) return result ############################################################################# # # The DocPara class is used to store "normal" text paragraph. # # 'self.words' contains the list of words that make up the paragraph # class DocPara: def __init__( self, lines ): self.lines = None self.words = [] for l in lines: l = string.strip(l) self.words.extend( string.split( l ) ) def dump( self, prefix = "", width = 60 ): lines = self.dump_lines( 0, width ) for l in lines: print prefix + l def dump_lines( self, margin=0, width = 60 ): cur = "" # current line col = 0 # current width result = [] for word in self.words: ln = len(word) if col > 0: ln = ln+1 if col + ln > width: result.append( " "*margin + cur ) cur = word col = len(word) else: if col > 0: cur = cur + " " cur = cur + word col = col + ln if col > 0: result.append( " "*margin + cur ) return result ############################################################################# # # The DocField class is used to store a list containing either DocPara or # DocCode objects. Each DocField also has an optional "name" which is used # when the object corresponds to a field of value definition # class DocField: def __init__( self, name, lines ): self.name = name # can be None for normal paragraphs/sources self.items = [] # list of items mode_none = 0 # start parsing mode mode_code = 1 # parsing code sequences mode_para = 3 # parsing normal paragraph margin = -1 # current code sequence indentation cur_lines = [] # now analyze the markup lines to see if they contain paragraphs, # code sequences or fields definitions # start = 0 mode = mode_none for l in lines: # are we parsing a code sequence ? if mode == mode_code: m = re_code_end.match( l ) if m and len(m.group(1)) <= margin: # that's it, we finised the code sequence code = DocCode( 0, cur_lines ) self.items.append( code ) margin = -1 cur_lines = [] mode = mode_none else: # nope, continue the code sequence cur_lines.append( l[margin:] ) else: # start of code sequence ? m = re_code_start.match( l ) if m: # save current lines if cur_lines: para = DocPara( cur_lines ) self.items.append( para ) cur_lines = [] # switch to code extraction mode margin = len(m.group(1)) mode = mode_code else: if not string.split( l ) and cur_lines: # if the line is empty, we end the current paragraph, # if any para = DocPara( cur_lines ) self.items.append( para ) cur_lines = [] else: # otherwise, simply add the line to the current # paragraph cur_lines.append( l ) if mode == mode_code: # unexpected end of code sequence code = DocCode( margin, cur_lines ) self.items.append( code ) elif cur_lines: para = DocPara( cur_lines ) self.items.append( para ) def dump( self, prefix = "" ): if self.field: print prefix + self.field + " ::" prefix = prefix + "----" first = 1 for p in self.items: if not first: print "" p.dump( prefix ) first = 0 def dump_lines( self, margin=0, width=60 ): result = [] nl = None for p in self.items: if nl: result.append( "" ) result.extend( p.dump_lines( margin, width ) ) nl = 1 return result # this regular expression is used to detect field definitions # re_field = re.compile( r"\s*(\w*)\s*::" ) class DocMarkup: def __init__( self, tag, lines ): self.tag = string.lower(tag) self.fields = [] cur_lines = [] field = None mode = 0 for l in lines: m = re_field.match( l ) if m: # we detected the start of a new field definition # first, save the current one if cur_lines: f = DocField( field, cur_lines ) self.fields.append( f ) cur_lines = [] field = None field = m.group(1) # record field name ln = len(m.group(0)) l = " "*ln + l[ln:] cur_lines = [ l ] else: cur_lines.append( l ) if field or cur_lines: f = DocField( field, cur_lines ) self.fields.append( f ) def get_name( self ): try: return self.fields[0].items[0].words[0] except: return None def get_start( self ): try: result = "" for word in self.fields[0].items[0].words: result = result + " " + word return result[1:] except: return "ERROR" def dump( self, margin ): print " "*margin + "<" + self.tag + ">" for f in self.fields: f.dump( " " ) print " "*margin + "</" + self.tag + ">" class DocChapter: def __init__( self, block ): self.block = block self.sections = [] if block: self.name = block.name self.title = block.get_markup_words( "title" ) self.order = block.get_markup_words( "sections" ) else: self.name = "Other" self.title = string.split( "Miscellaneous" ) self.order = [] class DocSection: def __init__( self, name = "Other" ): self.name = name self.blocks = {} self.block_names = [] # ordered block names in section self.defs = [] self.abstract = "" self.description = "" self.order = [] self.title = "ERROR" self.chapter = None def add_def( self, block ): self.defs.append( block ) def add_block( self, block ): self.block_names.append( block.name ) self.blocks[ block.name ] = block def process( self ): # lookup one block that contains a valid section description for block in self.defs: title = block.get_markup_text( "Title" ) if title: self.title = title self.abstract = block.get_markup_words( "abstract" ) self.description = block.get_markup_items( "description" ) self.order = block.get_markup_words( "order" ) return def reorder( self ): self.block_names = sort_order_list( self.block_names, self.order ) class ContentProcessor: def __init__( self ): """initialize a block content processor""" self.reset() self.sections = {} # dictionary of documentation sections self.section = None # current documentation section self.chapters = [] # list of chapters def set_section( self, section_name ): """set current section during parsing""" if not self.sections.has_key( section_name ): section = DocSection( section_name ) self.sections[ section_name ] = section self.section = section else: self.section = self.sections[ section_name ] def add_chapter( self, block ): chapter = DocChapter( block ) self.chapters.append( chapter ) def reset( self ): """reset the content processor for a new block""" self.markups = [] self.markup = None self.markup_lines = [] def add_markup( self ): """add a new markup section""" if self.markup and self.markup_lines: # get rid of last line of markup if it's empty marks = self.markup_lines if len(marks) > 0 and not string.strip(marks[-1]): self.markup_lines = marks[:-1] m = DocMarkup( self.markup, self.markup_lines ) self.markups.append( m ) self.markup = None self.markup_lines = [] def process_content( self, content ): """process a block content and return a list of DocMarkup objects corresponding to it""" markup = None markup_lines = [] first = 1 for line in content: found = None for t in re_markup_tags: m = t.match( line ) if m: found = string.lower(m.group(1)) prefix = len(m.group(0)) line = " "*prefix + line[prefix:] # remove markup from line break # is it the start of a new markup section ? if found: first = 0 self.add_markup() # add current markup content self.markup = found if len(string.strip( line )) > 0: self.markup_lines.append( line ) elif first == 0: self.markup_lines.append( line ) self.add_markup() return self.markups def parse_sources( self, source_processor ): blocks = source_processor.blocks count = len(blocks) for n in range(count): source = blocks[n] if source.content: # this is a documentation comment, we need to catch # all following normal blocks in the "follow" list # follow = [] m = n+1 while m < count and not blocks[m].content: follow.append( blocks[m] ) m = m+1 doc_block = DocBlock( source, follow, self ) def finish( self ): # process all sections to extract their abstract, description # and ordered list of items # for sec in self.sections.values(): sec.process() # process chapters to check that all sections are correctly # listed there for chap in self.chapters: for sec in chap.order: if self.sections.has_key(sec): section = self.sections[ sec ] section.chapter = chap section.reorder() chap.sections.append( section ) else: sys.stderr.write( "WARNING: chapter '" + chap.name + "' in " + chap.block.location() + \ " lists unknown section '" + sec + "'\n" ) # check that all sections are in a chapter # others = [] for sec in self.sections.values(): if not sec.chapter: others.append(sec) # create a new special chapter for all remaining sections # when necessary # if others: chap = DocChapter( None ) chap.sections = others self.chapters.append( chap ) class DocBlock: def __init__( self, source, follow, processor ): processor.reset() self.source = source self.code = [] self.type = "ERRTYPE" self.name = "ERRNAME" self.section = processor.section self.markups = processor.process_content( source.content ) # compute block type from first markup tag try: self.type = self.markups[0].tag except: pass # compute block name from first markup paragraph try: markup = self.markups[0] para = markup.fields[0].items[0] name = para.words[0] m = re_identifier.match( name ) if m: name = m.group(1) self.name = name except: pass # detect new section starts if self.type == "section": processor.set_section( self.name ) processor.section.add_def( self ) # detect new chapter elif self.type == "chapter": processor.add_chapter( self ) else: processor.section.add_block( self ) # now, compute the source lines relevant to this documentation # block. We keep normal comments in for obvious reasons (??) source = [] for b in follow: if b.format: break for l in b.lines: # we use "/* */" as a separator if re_source_sep.match( l ): break source.append( l ) # now strip the leading and trailing empty lines from the sources start = 0 end = len( source )-1 while start < end and not string.strip( source[start] ): start = start + 1 while start < end and not string.strip( source[end] ): end = end - 1 source = source[start:end+1] self.code = source def location( self ): return self.source.location() def get_markup( self, tag_name ): """return the DocMarkup corresponding to a given tag in a block""" for m in self.markups: if m.tag == string.lower(tag_name): return m return None def get_markup_name( self, tag_name ): """return the name of a given primary markup in a block""" try: m = self.get_markup( tag_name ) return m.get_name() except: return None def get_markup_words( self, tag_name ): try: m = self.get_markup( tag_name ) return m.fields[0].items[0].words except: return [] def get_markup_text( self, tag_name ): result = self.get_markup_words( tag_name ) return string.join( result ) def get_markup_items( self, tag_name ): try: m = self.get_markup( tag_name ) return m.fields[0].items except: return None --- NEW FILE: docbeauty.py --- #!/usr/bin/env python # # DocBeauty (c) 2003, 2004 David Turner <da...@fr...> # # This program is used to beautify the documentation comments used # in the FreeType 2 public headers. # from sources import * from content import * from utils import * import utils import sys, os, time, string, getopt content_processor = ContentProcessor() def beautify_block( block ): if block.content: content_processor.reset() markups = content_processor.process_content( block.content ) text = [] first = 1 for markup in markups: text.extend( markup.beautify( first ) ) first = 0 # now beautify the documentation "borders" themselves lines = [ " /*************************************************************************" ] for l in text: lines.append( " *" + l ) lines.append( " */" ) block.lines = lines def usage(): print "\nDocBeauty 0.1 Usage information\n" print " docbeauty [options] file1 [ file2 ... ]\n" print "using the following options:\n" print " -h : print this page" print " -b : backup original files with the 'orig' extension" print "" print " --backup : same as -b" def main( argv ): """main program loop""" global output_dir try: opts, args = getopt.getopt( sys.argv[1:], "hb", [ "help", "backup" ] ) except getopt.GetoptError: usage() sys.exit( 2 ) if args == []: usage() sys.exit( 1 ) # process options # output_dir = None do_backup = None for opt in opts: if opt[0] in ( "-h", "--help" ): usage() sys.exit( 0 ) if opt[0] in ( "-b", "--backup" ): do_backup = 1 # create context and processor source_processor = SourceProcessor() # retrieve the list of files to process file_list = make_file_list( args ) for filename in file_list: source_processor.parse_file( filename ) for block in source_processor.blocks: beautify_block( block ) new_name = filename + ".new" ok = None try: file = open( new_name, "wt" ) for block in source_processor.blocks: for line in block.lines: file.write( line ) file.write( "\n" ) file.close() except: ok = 0 # if called from the command line # if __name__ == '__main__': main( sys.argv ) # eof --- NEW FILE: docmaker.py --- #!/usr/bin/env python # # DocMaker (c) 2002, 2004 David Turner <da...@fr...> # # This program is a re-write of the original DocMaker took used # to generate the API Reference of the FreeType font engine # by converting in-source comments into structured HTML. # # This new version is capable of outputting XML data, as well # as accepts more liberal formatting options. # # It also uses regular expression matching and substitution # to speed things significantly. # from sources import * from content import * from utils import * from formatter import * from tohtml import * import utils import sys, os, time, string, glob, getopt def usage(): print "\nDocMaker Usage information\n" print " docmaker [options] file1 [ file2 ... ]\n" print "using the following options:\n" print " -h : print this page" print " -t : set project title, as in '-t \"My Project\"'" print " -o : set output directory, as in '-o mydir'" print " -p : set documentation prefix, as in '-p ft2'" print "" print " --title : same as -t, as in '--title=\"My Project\"'" print " --output : same as -o, as in '--output=mydir'" print " --prefix : same as -p, as in '--prefix=ft2'" def main( argv ): """main program loop""" global output_dir try: opts, args = getopt.getopt( sys.argv[1:], "ht:o:p:", [ "help", "title=", "output=", "prefix=" ] ) except getopt.GetoptError: usage() sys.exit( 2 ) if args == []: usage() sys.exit( 1 ) # process options # project_title = "Project" project_prefix = None output_dir = None for opt in opts: if opt[0] in ( "-h", "--help" ): usage() sys.exit( 0 ) if opt[0] in ( "-t", "--title" ): project_title = opt[1] if opt[0] in ( "-o", "--output" ): utils.output_dir = opt[1] if opt[0] in ( "-p", "--prefix" ): project_prefix = opt[1] check_output( ) # create context and processor source_processor = SourceProcessor() content_processor = ContentProcessor() # retrieve the list of files to process file_list = make_file_list( args ) for filename in file_list: source_processor.parse_file( filename ) content_processor.parse_sources( source_processor ) # process sections content_processor.finish() formatter = HtmlFormatter( content_processor, project_title, project_prefix ) formatter.toc_dump() formatter.index_dump() formatter.section_dump_all() # if called from the command line # if __name__ == '__main__': main( sys.argv ) # eof --- NEW FILE: sources.py --- # # this file contains definitions of classes needed to decompose # C sources files into a series of multi-line "blocks". There are # two kinds of blocks: # # - normal blocks, which contain source code or ordinary comments # # - documentation blocks, which have restricted formatting, and # whose text always start with a documentation markup tag like # "<Function>", "<Type>", etc.. # # the routines used to process the content of documentation blocks # are not contained here, but in "content.py" # # the classes and methods found here only deal with text parsing # and basic documentation block extraction # import fileinput, re, sys, os, string ################################################################ ## ## BLOCK FORMAT PATTERN ## ## A simple class containing compiled regular expressions used ## to detect potential documentation format block comments within ## C source code ## ## note that the 'column' pattern must contain a group that will ## be used to "unbox" the content of documentation comment blocks ## class SourceBlockFormat: def __init__( self, id, start, column, end ): """create a block pattern, used to recognize special documentation blocks""" self.id = id self.start = re.compile( start, re.VERBOSE ) self.column = re.compile( column, re.VERBOSE ) self.end = re.compile( end, re.VERBOSE ) # # format 1 documentation comment blocks look like the following: # # /************************************/ # /* */ # /* */ # /* */ # /************************************/ # # we define a few regular expressions here to detect them # start = r''' \s* # any number of whitespace /\*{2,}/ # followed by '/' and at least two asterisks then '/' \s*$ # eventually followed by whitespace ''' column = r''' \s* # any number of whitespace /\*{1} # followed by '/' and precisely one asterisk ([^*].*) # followed by anything (group 1) \*{1}/ # followed by one asterisk and a '/' \s*$ # enventually followed by whitespace ''' re_source_block_format1 = SourceBlockFormat( 1, start, column, start ) # # format 2 documentation comment blocks look like the following: # # /************************************ (at least 2 asterisks) # * # * # * # * # **/ (1 or more asterisks at the end) # # we define a few regular expressions here to detect them # start = r''' \s* # any number of whitespace /\*{2,} # followed by '/' and at least two asterisks \s*$ # eventually followed by whitespace ''' column = r''' \s* # any number of whitespace \*{1}(?!/) # followed by precisely one asterisk not followed by `/' (.*) # then anything (group1) ''' end = r''' \s* # any number of whitespace \*+/ # followed by at least one asterisk, then '/' ''' re_source_block_format2 = SourceBlockFormat( 2, start, column, end ) # # the list of supported documentation block formats, we could add new ones # relatively easily # re_source_block_formats = [ re_source_block_format1, re_source_block_format2 ] # # the following regular expressions corresponds to markup tags # within the documentation comment blocks. they're equivalent # despite their different syntax # # notice how each markup tag _must_ begin a new line # re_markup_tag1 = re.compile( r'''\s*<(\w*)>''' ) # <xxxx> format re_markup_tag2 = re.compile( r'''\s*@(\w*):''' ) # @xxxx: format # # the list of supported markup tags, we could add new ones relatively # easily # re_markup_tags = [ re_markup_tag1, re_markup_tag2 ] # # used to detect a cross-reference, after markup tags have been stripped # re_crossref = re.compile( r'@(\w*)(.*)' ) # # used to detect italic and bold styles in paragraph text # re_italic = re.compile( r'_(\w+)_' ) re_bold = re.compile( r'\*(\w+)\*' ) # # used to detect the end of commented source lines # re_source_sep = re.compile( r'\s*/\*\s*\*/' ) # # used to perform cross-reference within source output # re_source_crossref = re.compile( r'(\W*)(\w*)' ) # # a list of reserved source keywords # re_source_keywords = re.compile( '''( typedef | struct | enum | union | const | char | int | short | long | void | signed | unsigned | \#include | \#define | \#undef | \#if | \#ifdef | \#ifndef | \#else | \#endif )''', re.VERBOSE ) ################################################################ ## ## SOURCE BLOCK CLASS ## ## A SourceProcessor is in charge or reading a C source file ## and decomposing it into a series of different "SourceBlocks". ## each one of these blocks can be made of the following data: ## ## - A documentation comment block that starts with "/**" and ## whose exact format will be discussed later ## ## - normal sources lines, include comments ## ## the important fields in a text block are the following ones: ## ## self.lines : a list of text lines for the corresponding block ## ## self.content : for documentation comment blocks only, this is the ## block content that has been "unboxed" from its ## decoration. This is None for all other blocks ## (i.e. sources or ordinary comments with no starting ## markup tag) ## class SourceBlock: def __init__( self, processor, filename, lineno, lines ): self.processor = processor self.filename = filename self.lineno = lineno self.lines = lines[:] self.format = processor.format self.content = [] if self.format == None: return words = [] # extract comment lines lines = [] for line0 in self.lines: m = self.format.column.match( line0 ) if m: lines.append( m.group(1) ) # now, look for a markup tag for l in lines: l = string.strip(l) if len(l) > 0: for tag in re_markup_tags: if tag.match( l ): self.content = lines return def location( self ): return "(" + self.filename + ":" + repr(self.lineno) + ")" # debugging only - not used in normal operations def dump( self ): if self.content: print "{{{content start---" for l in self.content: print l print "---content end}}}" return fmt = "" if self.format: fmt = repr(self.format.id) + " " for line in self.lines: print line ################################################################ ## ## SOURCE PROCESSOR CLASS ## ## The SourceProcessor is in charge or reading a C source file ## and decomposing it into a series of different "SourceBlock" ## objects. ## ## each one of these blocks can be made of the following data: ## ## - A documentation comment block that starts with "/**" and ## whose exact format will be discussed later ## ## - normal sources lines, include comments ## ## class SourceProcessor: def __init__( self ): """initialize a source processor""" self.blocks = [] self.filename = None self.format = None self.lines = [] def reset( self ): """reset a block processor, clean all its blocks""" self.blocks = [] self.format = None def parse_file( self, filename ): """parse a C source file, and adds its blocks to the processor's list""" self.reset() self.filename = filename fileinput.close() self.format = None self.lineno = 0 self.lines = [] for line in fileinput.input( filename ): # strip trailing newlines, important on Windows machines !! if line[-1] == '\012': line = line[0:-1] if self.format == None: self.process_normal_line( line ) else: if self.format.end.match( line ): # that's a normal block end, add it to lines and # create a new block self.lines.append( line ) self.add_block_lines() elif self.format.column.match( line ): # that's a normal column line, add it to 'lines' self.lines.append( line ) else: # humm.. this is an unexcepted block end, # create a new block, but don't process the line self.add_block_lines() # we need to process the line again self.process_normal_line( line ) # record the last lines self.add_block_lines() def process_normal_line( self, line ): """process a normal line and check if it's the start of a new block""" for f in re_source_block_formats: if f.start.match( line ): self.add_block_lines() self.format = f self.lineno = fileinput.filelineno() self.lines.append( line ) def add_block_lines( self ): """add the current accumulated lines, and create a new block""" if self.lines != []: block = SourceBlock( self, self.filename, self.lineno, self.lines ) self.blocks.append( block ) self.format = None self.lines = [] # debugging only, not used in normal operations def dump( self ): """print all blocks in a processor""" for b in self.blocks: b.dump() # eof --- NEW FILE: tohtml.py --- from sources import * from content import * from formatter import * import time # The following defines the HTML header used by all generated pages. # html_header_1 = """\ <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>""" html_header_2= """ API Reference</title> <style type="text/css"> body { font-family: Verdana, Geneva, Arial, Helvetica, serif; color: #000000; background: #FFFFFF; } p { text-align: justify; } h1 { text-align: center; } li { text-align: justify; } a:link { color: #0000EF; } a:visited { color: #51188E; } a:hover { color: #FF0000; } span.keyword { font-family: monospace; text-align: left; white-space: pre; color: darkblue; } pre.colored { color: blue; } ul.empty { list-style-type: none; } </style> </head> <body> <center><h1>""" html_header_3=""" API Reference</h1></center> """ # The HTML footer used by all generated pages. # html_footer = """\ </body> </html>""" # The header and footer used for each section. # section_title_header = "<center><h1>" section_title_footer = "</h1></center>" # The header and footer used for code segments. # code_header = '<pre class="colored">' code_footer = '</pre>' # Paragraph header and footer. # para_header = "<p>" para_footer = "</p>" # Block header and footer. # block_header = '<table align=center width="75%"><tr><td>' block_footer = '</td></tr></table><hr width="75%">' # Description header/footer. # description_header = '<table align=center width="87%"><tr><td>' description_footer = "</td></tr></table><br>" # Marker header/inter/footer combination. # marker_header = '<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>' marker_inter = "</b></em></td></tr><tr><td>" marker_footer = "</td></tr></table>" # Source code extracts header/footer. # source_header = '<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>\n' source_footer = "\n</pre></table><br>" # Chapter header/inter/footer. # chapter_header = '<br><table align=center width="75%"><tr><td><h2>' chapter_inter = '</h2><ul class="empty"><li>' chapter_footer = '</li></ul></td></tr></table>' # source language keyword coloration/styling # keyword_prefix = '<span class="keyword">' keyword_suffix = '</span>' section_synopsis_header = '<h2>Synopsis</h2>' section_synopsis_footer = '' # Translate a single line of source to HTML. This will convert # a "<" into "<.", ">" into ">.", etc. # def html_quote( line ): result = string.replace( line, "&", "&" ) result = string.replace( result, "<", "<" ) result = string.replace( result, ">", ">" ) return result # same as 'html_quote', but ignores left and right brackets # def html_quote0( line ): return string.replace( line, "&", "&" ) def dump_html_code( lines, prefix = "" ): # clean the last empty lines # l = len( self.lines ) while l > 0 and string.strip( self.lines[l - 1] ) == "": l = l - 1 # The code footer should be directly appended to the last code # line to avoid an additional blank line. # print prefix + code_header, for line in self.lines[0 : l+1]: print '\n' + prefix + html_quote(line), print prefix + code_footer, class HtmlFormatter(Formatter): def __init__( self, processor, project_title, file_prefix ): Formatter.__init__( self, processor ) global html_header_1, html_header_2, html_header_3, html_footer if file_prefix: file_prefix = file_prefix + "-" else: file_prefix = "" self.project_title = project_title self.file_prefix = file_prefix self.html_header = html_header_1 + project_title + html_header_2 + \ project_title + html_header_3 self.html_footer = "<center><font size=""-2"">generated on " + \ time.asctime( time.localtime( time.time() ) ) + \ "</font></center>" + html_footer self.columns = 3 def make_section_url( self, section ): return self.file_prefix + section.name + ".html" def make_block_url( self, block ): return self.make_section_url( block.section ) + "#" + block.name def make_html_words( self, words ): """ convert a series of simple words into some HTML text """ line = "" if words: line = html_quote( words[0] ) for w in words[1:]: line = line + " " + html_quote( w ) return line def make_html_word( self, word ): """analyze a simple word to detect cross-references and styling""" # look for cross-references # m = re_crossref.match( word ) if m: try: name = m.group(1) rest = m.group(2) block = self.identifiers[ name ] url = self.make_block_url( block ) return '<a href="' + url + '">' + name + '</a>' + rest except: return '?' + name + '?' + rest # look for italics and bolds m = re_italic.match( word ) if m: name = m.group(1) return '<i>'+name+'</i>' m = re_bold.match( word ) if m: name = m.group(1) return '<b>'+name+'</b>' return html_quote(word) def make_html_para( self, words ): """ convert a paragraph's words into tagged HTML text, handle xrefs """ line = "" if words: line = self.make_html_word( words[0] ) for word in words[1:]: line = line + " " + self.make_html_word( word ) return "<p>" + line + "</p>" def make_html_code( self, lines ): """ convert a code sequence to HTML """ line = code_header + '\n' for l in lines: line = line + html_quote( l ) + '\n' return line + code_footer def make_html_items( self, items ): """ convert a field's content into some valid HTML """ lines = [] for item in items: if item.lines: lines.append( self.make_html_code( item.lines ) ) else: lines.append( self.make_html_para( item.words ) ) return string.join( lines, '\n' ) def print_html_items( self, items ): print self.make_html_items( items ) def print_html_field( self, field ): if field.name: print "<table><tr valign=top><td><b>"+field.name+"</b></td><td>" print self.make_html_items( field.items ) if field.name: print "</td></tr></table>" def html_source_quote( self, line, block_name = None ): result = "" while line: m = re_source_crossref.match( line ) if m: name = m.group(2) prefix = html_quote( m.group(1) ) length = len( m.group(0) ) if name == block_name: # this is the current block name, if any result = result + prefix + '<b>' + name + '</b>' elif re_source_keywords.match(name): # this is a C keyword result = result + prefix + keyword_prefix + name + keyword_suffix elif self.identifiers.has_key(name): # this is a known identifier block = self.identifiers[name] result = result + prefix + '<a href="' + \ self.make_block_url(block) + '">' + name + '</a>' else: result = result + html_quote(line[ : length ]) line = line[ length : ] else: result = result + html_quote(line) line = [] return result def print_html_field_list( self, fields ): print "<table cellpadding=3>" for field in fields: print "<tr valign=top><td><b>" + field.name + "</b></td><td>" self.print_html_items( field.items ) print "</td></tr>" print "</table>" def print_html_markup( self, markup ): table_fields = [] for field in markup.fields: if field.name: # we begin a new series of field or value definitions, we # will record them in the 'table_fields' list before outputting # all of them as a single table # table_fields.append( field ) else: if table_fields: self.print_html_field_list( table_fields ) table_fields = [] self.print_html_items( field.items ) if table_fields: self.print_html_field_list( table_fields ) # # Formatting the index # def index_enter( self ): print self.html_header self.index_items = {} def index_name_enter( self, name ): block = self.identifiers[ name ] url = self.make_block_url( block ) self.index_items[ name ] = url def index_exit( self ): # block_index already contains the sorted list of index names count = len( self.block_index ) rows = (count + self.columns - 1)/self.columns print "<table align=center border=0 cellpadding=0 cellspacing=0>" for r in range(rows): line = "<tr>" for c in range(self.columns): i = r + c*rows if i < count: bname = self.block_index[ r + c*rows ] url = self.index_items[ bname ] line = line + '<td><a href="' + url + '">' + bname + '</a></td>' else: line = line + '<td></td>' line = line + "</tr>" print line print "</table>" print self.html_footer self.index_items = {} def index_dump( self, index_filename = None ): if index_filename == None: index_filename = self.file_prefix + "index.html" Formatter.index_dump( self, index_filename ) # # Formatting the table of content # def toc_enter( self ): print self.html_header print "<center><h1>Table of Contents</h1></center>" def toc_chapter_enter( self, chapter ): print chapter_header + string.join(chapter.title) + chapter_inter print "<table cellpadding=5>" def toc_section_enter( self, section ): print "<tr valign=top><td>" print '<a href="' + self.make_section_url( section ) + '">' + \ section.title + '</a></td><td>' print self.make_html_para( section.abstract ) def toc_section_exit( self, section ): print "</td></tr>" def toc_chapter_exit( self, chapter ): print "</table>" print chapter_footer def toc_index( self, index_filename ): print chapter_header + '<a href="' + index_filename + '">Global Index</a>' + chapter_inter + chapter_footer def toc_exit( self ): print self.html_footer def toc_dump( self, toc_filename = None, index_filename = None ): if toc_filename == None: toc_filename = self.file_prefix + "toc.html" if index_filename == None: index_filename = self.file_prefix + "index.html" Formatter.toc_dump( self, toc_filename, index_filename ) # # Formatting sections # def section_enter( self, section ): print self.html_header print section_title_header print section.title print section_title_footer # print section synopsys print section_synopsis_header print "<table align=center cellspacing=5 cellpadding=0 border=0>" maxwidth = 0 for b in section.blocks.values(): if len(b.name) > maxwidth: maxwidth = len(b.name) width = 70 # XXX magic number columns = width / maxwidth if columns < 1: columns = 1 count = len(section.block_names) rows = (count + columns-1)/columns for r in range(rows): line = "<tr>" for c in range(columns): i = r + c*rows line = line + '<td></td><td>' if i < count: name = section.block_names[i] line = line + '<a href="#' + name + '">' + name + '</a>' line = line + '</td>' line = line + "</tr>" print line print "</table><br><br>" print section_synopsis_footer print description_header print self.make_html_items( section.description ) print description_footer def block_enter( self, block ): print block_header # place html anchor if needed if block.name: print '<h4><a name="' + block.name + '">' + block.name + '</a></h4>' # dump the block C source lines now if block.code: print source_header for l in block.code: print self.html_source_quote( l, block.name ) print source_footer def markup_enter( self, markup, block ): if markup.tag == "description": print description_header else: print marker_header + markup.tag + marker_inter self.print_html_markup( markup ) def markup_exit( self, markup, block ): if markup.tag == "description": print description_footer else: print marker_footer def block_exit( self, block ): print block_footer def section_exit( self, section ): print html_footer def section_dump_all( self ): for section in self.sections: self.section_dump( section, self.file_prefix + section.name + '.html' ) --- NEW FILE: utils.py --- import string, sys, os, glob # current output directory # output_dir = None # This function is used to sort the index. It is a simple lexicographical # sort, except that it places capital letters before lowercase ones. # def index_sort( s1, s2 ): if not s1: return -1 if not s2: return 1 l1 = len( s1 ) l2 = len( s2 ) m1 = string.lower( s1 ) m2 = string.lower( s2 ) for i in range( l1 ): if i >= l2 or m1[i] > m2[i]: return 1 if m1[i] < m2[i]: return -1 if s1[i] < s2[i]: return -1 if s1[i] > s2[i]: return 1 if l2 > l1: return -1 return 0 # Sort input_list, placing the elements of order_list in front. # def sort_order_list( input_list, order_list ): new_list = order_list[:] for id in input_list: if not id in order_list: new_list.append( id ) return new_list # Open the standard output to a given project documentation file. Use # "output_dir" to determine the filename location if necessary and save the # old stdout in a tuple that is returned by this function. # def open_output( filename ): global output_dir if output_dir and output_dir != "": filename = output_dir + os.sep + filename old_stdout = sys.stdout new_file = open( filename, "w" ) sys.stdout = new_file return ( new_file, old_stdout ) # Close the output that was returned by "close_output". # def close_output( output ): output[0].close() sys.stdout = output[1] # Check output directory. # def check_output( ): global output_dir if output_dir: if output_dir != "": if not os.path.isdir( output_dir ): sys.stderr.write( "argument" + " '" + output_dir + "' " + "is not a valid directory" ) sys.exit( 2 ) else: output_dir = None def file_exists( pathname ): """checks that a given file exists""" result = 1 try: file = open( pathname, "r" ) file.close() except: result = None sys.stderr.write( pathname + " couldn't be accessed\n" ) return result def make_file_list( args = None ): """builds a list of input files from command-line arguments""" file_list = [] # sys.stderr.write( repr( sys.argv[1 :] ) + '\n' ) if not args: args = sys.argv[1 :] for pathname in args: if string.find( pathname, '*' ) >= 0: newpath = glob.glob( pathname ) newpath.sort() # sort files -- this is important because # of the order of files else: newpath = [pathname] file_list.extend( newpath ) if len( file_list ) == 0: file_list = None else: # now filter the file list to remove non-existing ones file_list = filter( file_exists, file_list ) return file_list --- NEW FILE: formatter.py --- from sources import * from content import * from utils import * # This is the base Formatter class. its purpose is to convert # a content processor's data into specific documents (i.e. table of # contents, global index, and individual API reference indices). # # You'll need to sub-class it to output anything sensible. For example, # the file tohtml.py contains the definition of the HtmlFormatter sub-class # used to output, you guessed it, HTML. # class Formatter: def __init__( self, processor ): self.processor = processor self.identifiers = {} self.chapters = processor.chapters self.sections = processor.sections.values() self.block_index = [] # store all blocks in a dictionary self.blocks = [] for section in self.sections: for block in section.blocks.values(): self.add_identifier( block.name, block ) # add enumeration values to the index, since this is useful for markup in block.markups: if markup.tag == 'values': for field in markup.fields: self.add_identifier( field.name, block ) self.block_index = self.identifiers.keys() self.block_index.sort( index_sort ) def add_identifier( self, name, block ): if self.identifiers.has_key( name ): # duplicate name !! sys.stderr.write( \ "WARNING: duplicate definition for '" + name + "' in " + \ block.location() + ", previous definition in " + \ self.identifiers[ name ].location() + "\n" ) else: self.identifiers[name] = block # # Formatting the table of contents # def toc_enter( self ): pass def toc_chapter_enter( self, chapter ): pass def toc_section_enter( self, section ): pass def toc_section_exit( self, section ): pass def toc_chapter_exit( self, chapter ): pass def toc_index( self, index_filename ): pass def toc_exit( self ): pass def toc_dump( self, toc_filename = None, index_filename = None ): output = None if toc_filename: output = open_output( toc_filename ) self.toc_enter() for chap in self.processor.chapters: self.toc_chapter_enter( chap ) for section in chap.sections: self.toc_section_enter( section ) self.toc_section_exit( section ) self.toc_chapter_exit ( chap ) self.toc_index( index_filename ) self.toc_exit() if output: close_output( output ) # # Formatting the index # def index_enter( self ): pass def index_name_enter( self, name ): pass def index_name_exit( self, name ): pass def index_exit( self ): pass def index_dump( self, index_filename = None ): output = None if index_filename: output = open_output( index_filename ) self.index_enter() for name in self.block_index: self.index_name_enter( name ) self.index_name_exit ( name ) self.index_exit() if output: close_output( output ) # # Formatting a section # def section_enter( self, section ): pass def block_enter( self, block ): pass def markup_enter( self, markup, block = None ): pass def field_enter( self, field, markup = None, block = None ): pass def field_exit( self, field, markup = None, block = None ): pass def markup_exit( self, markup, block = None ): pass def block_exit( self, block ): pass def section_exit( self, section ): pass def section_dump( self, section, section_filename = None ): output = None if section_filename: output = open_output( section_filename ) self.section_enter( section ) for name in section.block_names: block = self.identifiers[ name ] self.block_enter( block ) for markup in block.markups[1:]: # always ignore first markup !! self.markup_enter( markup, block ) for field in markup.fields: self.field_enter( field, markup, block ) self.field_exit ( field, markup, block ) self.markup_exit( markup, block ) self.block_exit( block ) self.section_exit ( section ) if output: close_output( output ) def section_dump_all( self ): for section in self.sections: self.section_dump( section ) # # Formatting a block # |
From: Ehud S. <esh...@us...> - 2006-04-21 16:33:09
|
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/tools/docmaker In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29540/docmaker Log Message: Directory /cvsroot/roadmap/roadmap_editor/src/freetype/src/tools/docmaker added to the repository |
From: Ehud S. <esh...@us...> - 2006-04-21 16:31:27
|
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/winfonts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28321/src/winfonts Added Files: Jamfile fnterrs.h module.mk rules.mk winfnt.h Log Message: Import freetype sources. --- NEW FILE: rules.mk --- # # FreeType 2 Windows FNT/FON driver configuration rules # # Copyright 1996-2000, 2001, 2003 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. # Windows driver directory # FNT_DIR := $(SRC_DIR)/winfonts FNT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(FNT_DIR)) # Windows driver sources (i.e., C files) # FNT_DRV_SRC := $(FNT_DIR)/winfnt.c # Windows driver headers # FNT_DRV_H := $(FNT_DRV_SRC:%.c=%.h) \ $(FNT_DIR)/fnterrs.h # Windows driver object(s) # # FNT_DRV_OBJ_M is used during `multi' builds # FNT_DRV_OBJ_S is used during `single' builds # FNT_DRV_OBJ_M := $(FNT_DRV_SRC:$(FNT_DIR)/%.c=$(OBJ_DIR)/%.$O) FNT_DRV_OBJ_S := $(OBJ_DIR)/winfnt.$O # Windows driver source file for single build # FNT_DRV_SRC_S := $(FNT_DIR)/winfnt.c # Windows driver - single object # $(FNT_DRV_OBJ_S): $(FNT_DRV_SRC_S) $(FNT_DRV_SRC) $(FREETYPE_H) $(FNT_DRV_H) $(FNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(FNT_DRV_SRC_S)) # Windows driver - multiple objects # $(OBJ_DIR)/%.$O: $(FNT_DIR)/%.c $(FREETYPE_H) $(FNT_DRV_H) $(FNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) # update main driver object lists # DRV_OBJS_S += $(FNT_DRV_OBJ_S) DRV_OBJS_M += $(FNT_DRV_OBJ_M) # EOF --- NEW FILE: fnterrs.h --- /***************************************************************************/ /* */ /* fnterrs.h */ /* */ /* Win FNT/FON error codes (specification only). */ /* */ /* Copyright 2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file is used to define the Windows FNT/FON error enumeration */ /* constants. */ /* */ /*************************************************************************/ #ifndef __FNTERRS_H__ #define __FNTERRS_H__ #include FT_MODULE_ERRORS_H #undef __FTERRORS_H__ #define FT_ERR_PREFIX FNT_Err_ #define FT_ERR_BASE FT_Mod_Err_Winfonts #include FT_ERRORS_H #endif /* __FNTERRS_H__ */ /* END */ --- NEW FILE: winfnt.h --- /***************************************************************************/ /* */ /* winfnt.h */ /* */ /* FreeType font driver for Windows FNT/FON files */ /* */ /* Copyright 1996-2001, 2002, 2003, 2004 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __WINFNT_H__ #define __WINFNT_H__ #include <ft2build.h> #include FT_WINFONTS_H #include FT_INTERNAL_DRIVER_H FT_BEGIN_HEADER typedef struct WinMZ_HeaderRec_ { FT_UShort magic; /* skipped content */ FT_UShort lfanew; } WinMZ_HeaderRec; typedef struct WinNE_HeaderRec_ { FT_UShort magic; /* skipped content */ FT_UShort resource_tab_offset; FT_UShort rname_tab_offset; } WinNE_HeaderRec; typedef struct WinNameInfoRec_ { FT_UShort offset; FT_UShort length; FT_UShort flags; FT_UShort id; FT_UShort handle; FT_UShort usage; } WinNameInfoRec; typedef struct WinResourceInfoRec_ { FT_UShort type_id; FT_UShort count; } WinResourceInfoRec; #define WINFNT_MZ_MAGIC 0x5A4D #define WINFNT_NE_MAGIC 0x454E typedef struct FNT_FontRec_ { FT_ULong offset; FT_Int size_shift; FT_WinFNT_HeaderRec header; FT_Byte* fnt_frame; FT_ULong fnt_size; FT_String* family_name; } FNT_FontRec, *FNT_Font; typedef struct FNT_FaceRec_ { FT_FaceRec root; FNT_Font font; FT_CharMap charmap_handle; FT_CharMapRec charmap; /* a single charmap per face */ } FNT_FaceRec, *FNT_Face; FT_EXPORT_VAR( const FT_Driver_ClassRec ) winfnt_driver_class; FT_END_HEADER #endif /* __WINFNT_H__ */ /* END */ --- NEW FILE: Jamfile --- # FreeType 2 src/winfonts Jamfile # # Copyright 2001 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. SubDir FT2_TOP $(FT2_SRC_DIR) winfonts ; Library $(FT2_LIB) : winfnt.c ; # end of src/winfonts Jamfile --- NEW FILE: module.mk --- # # FreeType 2 Windows FNT/FON module definition # # Copyright 1996-2000 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. make_module_list: add_windows_driver add_windows_driver: $(OPEN_DRIVER)winfnt_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)winfnt $(ECHO_DRIVER_DESC)Windows bitmap fonts with extension *.fnt or *.fon$(ECHO_DRIVER_DONE) |
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/type42 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28321/src/type42 Added Files: Jamfile module.mk rules.mk t42drivr.h t42error.h t42objs.h t42parse.h t42types.h Log Message: Import freetype sources. --- NEW FILE: t42error.h --- /***************************************************************************/ /* */ /* t42error.h */ /* */ /* Type 42 error codes (specification only). */ /* */ /* Copyright 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file is used to define the Type 42 error enumeration constants. */ /* */ /*************************************************************************/ #ifndef __T42ERROR_H__ #define __T42ERROR_H__ #include FT_MODULE_ERRORS_H #undef __FTERRORS_H__ #define FT_ERR_PREFIX T42_Err_ #define FT_ERR_BASE FT_Mod_Err_Type42 #include FT_ERRORS_H #endif /* __T42ERROR_H__ */ /* END */ --- NEW FILE: rules.mk --- # # FreeType 2 Type42 driver configuration rules # # Copyright 2002, 2003 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. # Type42 driver directory # T42_DIR := $(SRC_DIR)/type42 # compilation flags for the driver # T42_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(T42_DIR)) # Type42 driver source # T42_DRV_SRC := $(T42_DIR)/t42objs.c \ $(T42_DIR)/t42parse.c \ $(T42_DIR)/t42drivr.c # Type42 driver headers # T42_DRV_H := $(T42_DRV_SRC:%.c=%.h) \ $(T42_DIR)/t42error.h # Type42 driver object(s) # # T42_DRV_OBJ_M is used during `multi' builds # T42_DRV_OBJ_S is used during `single' builds # T42_DRV_OBJ_M := $(T42_DRV_SRC:$(T42_DIR)/%.c=$(OBJ_DIR)/%.$O) T42_DRV_OBJ_S := $(OBJ_DIR)/type42.$O # Type42 driver source file for single build # T42_DRV_SRC_S := $(T42_DIR)/type42.c # Type42 driver - single object # $(T42_DRV_OBJ_S): $(T42_DRV_SRC_S) $(T42_DRV_SRC) $(FREETYPE_H) $(T42_DRV_H) $(T42_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(T42_DRV_SRC_S)) # Type42 driver - multiple objects # $(OBJ_DIR)/%.$O: $(T42_DIR)/%.c $(FREETYPE_H) $(T42_DRV_H) $(T42_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) # update main driver object lists # DRV_OBJS_S += $(T42_DRV_OBJ_S) DRV_OBJS_M += $(T42_DRV_OBJ_M) # EOF --- NEW FILE: Jamfile --- # FreeType 2 src/type42 Jamfile # # Copyright 2002 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. SubDir FT2_TOP $(FT2_SRC_DIR) type42 ; { local _sources ; if $(FT2_MULTI) { _sources = t42objs t42parse t42drivr ; } else { _sources = type42 ; } Library $(FT2_LIB) : $(_sources).c ; } # end of src/type42 Jamfile --- NEW FILE: module.mk --- # # FreeType 2 Type42 module definition # # Copyright 2002 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. make_module_list: add_type42_driver add_type42_driver: $(OPEN_DRIVER)t42_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)type42 $(ECHO_DRIVER_DESC)Type 42 font files with no known extension$(ECHO_DRIVER_DONE) # EOF --- NEW FILE: t42objs.h --- /***************************************************************************/ /* */ /* t42objs.h */ /* */ /* Type 42 objects manager (specification). */ /* */ /* Copyright 2002, 2003 by Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __T42OBJS_H__ #define __T42OBJS_H__ #include <ft2build.h> #include FT_FREETYPE_H #include FT_TYPE1_TABLES_H #include FT_INTERNAL_TYPE1_TYPES_H #include "t42types.h" #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_DRIVER_H #include FT_SERVICE_POSTSCRIPT_CMAPS_H #include FT_INTERNAL_POSTSCRIPT_HINTS_H FT_BEGIN_HEADER /* Type42 size */ typedef struct T42_SizeRec_ { FT_SizeRec root; FT_Size ttsize; } T42_SizeRec, *T42_Size; /* Type42 slot */ typedef struct T42_GlyphSlotRec_ { FT_GlyphSlotRec root; FT_GlyphSlot ttslot; } T42_GlyphSlotRec, *T42_GlyphSlot; /* Type 42 driver */ typedef struct T42_DriverRec_ { FT_DriverRec root; FT_Driver_Class ttclazz; void* extension_component; } T42_DriverRec, *T42_Driver; /* */ FT_LOCAL( FT_Error ) T42_Face_Init( FT_Stream stream, T42_Face face, FT_Int face_index, FT_Int num_params, FT_Parameter* params ); FT_LOCAL( void ) T42_Face_Done( T42_Face face ); FT_LOCAL( FT_Error ) T42_Size_Init( T42_Size size ); FT_LOCAL( FT_Error ) T42_Size_SetChars( T42_Size size, FT_F26Dot6 char_width, FT_F26Dot6 char_height, FT_UInt horz_resolution, FT_UInt vert_resolution ); FT_LOCAL( FT_Error ) T42_Size_SetPixels( T42_Size size, FT_UInt pixel_width, FT_UInt pixel_height ); FT_LOCAL( void ) T42_Size_Done( T42_Size size ); FT_LOCAL( FT_Error ) T42_GlyphSlot_Init( T42_GlyphSlot slot ); FT_LOCAL( FT_Error ) T42_GlyphSlot_Load( FT_GlyphSlot glyph, FT_Size size, FT_UInt glyph_index, FT_Int32 load_flags ); FT_LOCAL( void ) T42_GlyphSlot_Done( T42_GlyphSlot slot ); FT_LOCAL( FT_Error ) T42_Driver_Init( T42_Driver driver ); FT_LOCAL( void ) T42_Driver_Done( T42_Driver driver ); /* */ FT_END_HEADER #endif /* __T42OBJS_H__ */ /* END */ --- NEW FILE: t42drivr.h --- /***************************************************************************/ /* */ /* t42drivr.h */ /* */ /* High-level Type 42 driver interface (specification). */ /* */ /* Copyright 2002 by Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __T42DRIVR_H__ #define __T42DRIVR_H__ #include <ft2build.h> #include FT_INTERNAL_DRIVER_H FT_BEGIN_HEADER FT_EXPORT_VAR( const FT_Driver_ClassRec ) t42_driver_class; FT_END_HEADER #endif /* __T42DRIVR_H__ */ /* END */ --- NEW FILE: t42types.h --- /***************************************************************************/ /* */ /* t42types.h */ /* */ /* Type 42 font data types (specification only). */ /* */ /* Copyright 2002, 2003 by Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __T42TYPES_H__ #define __T42TYPES_H__ #include <ft2build.h> #include FT_FREETYPE_H #include FT_TYPE1_TABLES_H #include FT_INTERNAL_TYPE1_TYPES_H #include FT_INTERNAL_POSTSCRIPT_HINTS_H FT_BEGIN_HEADER typedef struct T42_FaceRec_ { FT_FaceRec root; T1_FontRec type1; const void* psnames; const void* psaux; const void* afm_data; FT_Byte* ttf_data; FT_ULong ttf_size; FT_Face ttf_face; FT_CharMapRec charmaprecs[2]; FT_CharMap charmaps[2]; PS_Unicodes unicode_map; } T42_FaceRec, *T42_Face; FT_END_HEADER #endif /* __T1TYPES_H__ */ /* END */ --- NEW FILE: t42parse.h --- /***************************************************************************/ /* */ /* t42parse.h */ /* */ /* Type 42 font parser (specification). */ /* */ /* Copyright 2002, 2003 by Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __T42PARSE_H__ #define __T42PARSE_H__ #include "t42objs.h" #include FT_INTERNAL_POSTSCRIPT_AUX_H FT_BEGIN_HEADER typedef struct T42_ParserRec_ { PS_ParserRec root; FT_Stream stream; FT_Byte* base_dict; FT_Long base_len; FT_Bool in_memory; } T42_ParserRec, *T42_Parser; typedef struct T42_Loader_ { T42_ParserRec parser; /* parser used to read the stream */ FT_UInt num_chars; /* number of characters in encoding */ PS_TableRec encoding_table; /* PS_Table used to store the */ /* encoding character names */ FT_UInt num_glyphs; PS_TableRec glyph_names; PS_TableRec charstrings; PS_TableRec swap_table; /* For moving .notdef glyph to index 0. */ } T42_LoaderRec, *T42_Loader; FT_LOCAL( FT_Error ) t42_parser_init( T42_Parser parser, FT_Stream stream, FT_Memory memory, PSAux_Service psaux ); FT_LOCAL( void ) t42_parser_done( T42_Parser parser ); FT_LOCAL( FT_Error ) t42_parse_dict( T42_Face face, T42_Loader loader, FT_Byte* base, FT_Long size ); FT_LOCAL( void ) t42_loader_init( T42_Loader loader, T42_Face face ); FT_LOCAL( void ) t42_loader_done( T42_Loader loader ); /* */ FT_END_HEADER #endif /* __T42PARSE_H__ */ /* END */ |
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/cid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28321/src/cid Added Files: Jamfile ciderrs.h cidgload.h cidload.h cidobjs.h cidparse.h cidriver.h cidtoken.h module.mk rules.mk Log Message: Import freetype sources. --- NEW FILE: rules.mk --- # # FreeType 2 CID driver configuration rules # # Copyright 1996-2000, 2001, 2003 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. # CID driver directory # CID_DIR := $(SRC_DIR)/cid CID_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CID_DIR)) # CID driver sources (i.e., C files) # CID_DRV_SRC := $(CID_DIR)/cidparse.c \ $(CID_DIR)/cidload.c \ $(CID_DIR)/cidriver.c \ $(CID_DIR)/cidgload.c \ $(CID_DIR)/cidobjs.c # CID driver headers # CID_DRV_H := $(CID_DRV_SRC:%.c=%.h) \ $(CID_DIR)/cidtoken.h \ $(CID_DIR)/ciderrs.h # CID driver object(s) # # CID_DRV_OBJ_M is used during `multi' builds # CID_DRV_OBJ_S is used during `single' builds # CID_DRV_OBJ_M := $(CID_DRV_SRC:$(CID_DIR)/%.c=$(OBJ_DIR)/%.$O) CID_DRV_OBJ_S := $(OBJ_DIR)/type1cid.$O # CID driver source file for single build # CID_DRV_SRC_S := $(CID_DIR)/type1cid.c # CID driver - single object # $(CID_DRV_OBJ_S): $(CID_DRV_SRC_S) $(CID_DRV_SRC) $(FREETYPE_H) $(CID_DRV_H) $(CID_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(CID_DRV_SRC_S)) # CID driver - multiple objects # $(OBJ_DIR)/%.$O: $(CID_DIR)/%.c $(FREETYPE_H) $(CID_DRV_H) $(CID_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) # update main driver object lists # DRV_OBJS_S += $(CID_DRV_OBJ_S) DRV_OBJS_M += $(CID_DRV_OBJ_M) # EOF --- NEW FILE: cidgload.h --- /***************************************************************************/ /* */ /* cidgload.h */ /* */ /* OpenType Glyph Loader (specification). */ /* */ /* Copyright 1996-2001, 2002, 2004 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __CIDGLOAD_H__ #define __CIDGLOAD_H__ #include <ft2build.h> #include "cidobjs.h" FT_BEGIN_HEADER #if 0 /* Compute the maximum advance width of a font through quick parsing */ FT_LOCAL( FT_Error ) cid_face_compute_max_advance( CID_Face face, FT_Int* max_advance ); #endif /* 0 */ FT_LOCAL( FT_Error ) cid_slot_load_glyph( FT_GlyphSlot glyph, /* CID_Glyph_Slot */ FT_Size size, /* CID_Size */ FT_UInt glyph_index, FT_Int32 load_flags ); FT_END_HEADER #endif /* __CIDGLOAD_H__ */ /* END */ --- NEW FILE: Jamfile --- # FreeType 2 src/cid Jamfile # # Copyright 2001 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. SubDir FT2_TOP $(FT2_SRC_DIR) cid ; { local _sources ; if $(FT2_MULTI) { _sources = cidobjs cidload cidgload cidriver cidparse ; } else { _sources = type1cid ; } Library $(FT2_LIB) : $(_sources).c ; } # end of src/cid Jamfile --- NEW FILE: cidtoken.h --- /***************************************************************************/ /* */ /* cidtoken.h */ /* */ /* CID token definitions (specification only). */ /* */ /* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #undef FT_STRUCTURE #define FT_STRUCTURE CID_FaceInfoRec #undef T1CODE #define T1CODE T1_FIELD_LOCATION_CID_INFO T1_FIELD_KEY ( "CIDFontName", cid_font_name ) T1_FIELD_NUM ( "CIDFontVersion", cid_version ) T1_FIELD_NUM ( "CIDFontType", cid_font_type ) T1_FIELD_STRING( "Registry", registry ) T1_FIELD_STRING( "Ordering", ordering ) T1_FIELD_NUM ( "Supplement", supplement ) T1_FIELD_NUM ( "UIDBase", uid_base ) T1_FIELD_NUM ( "CIDMapOffset", cidmap_offset ) T1_FIELD_NUM ( "FDBytes", fd_bytes ) T1_FIELD_NUM ( "GDBytes", gd_bytes ) T1_FIELD_NUM ( "CIDCount", cid_count ) #undef FT_STRUCTURE #define FT_STRUCTURE PS_FontInfoRec #undef T1CODE #define T1CODE T1_FIELD_LOCATION_FONT_INFO T1_FIELD_STRING( "version", version ) T1_FIELD_STRING( "Notice", notice ) T1_FIELD_STRING( "FullName", full_name ) T1_FIELD_STRING( "FamilyName", family_name ) T1_FIELD_STRING( "Weight", weight ) T1_FIELD_NUM ( "ItalicAngle", italic_angle ) T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch ) T1_FIELD_NUM ( "UnderlinePosition", underline_position ) T1_FIELD_NUM ( "UnderlineThickness", underline_thickness ) #undef FT_STRUCTURE #define FT_STRUCTURE CID_FaceDictRec #undef T1CODE #define T1CODE T1_FIELD_LOCATION_FONT_DICT T1_FIELD_NUM ( "PaintType", paint_type ) T1_FIELD_NUM ( "FontType", font_type ) T1_FIELD_NUM ( "SubrMapOffset", subrmap_offset ) T1_FIELD_NUM ( "SDBytes", sd_bytes ) T1_FIELD_NUM ( "SubrCount", num_subrs ) T1_FIELD_NUM ( "lenBuildCharArray", len_buildchar ) T1_FIELD_FIXED( "ForceBoldThreshold", forcebold_threshold ) T1_FIELD_FIXED( "ExpansionFactor", expansion_factor ) T1_FIELD_FIXED( "StrokeWidth", stroke_width ) #undef FT_STRUCTURE #define FT_STRUCTURE PS_PrivateRec #undef T1CODE #define T1CODE T1_FIELD_LOCATION_PRIVATE T1_FIELD_NUM ( "UniqueID", unique_id ) T1_FIELD_NUM ( "lenIV", lenIV ) T1_FIELD_NUM ( "LanguageGroup", language_group ) T1_FIELD_NUM ( "password", password ) T1_FIELD_FIXED_1000( "BlueScale", blue_scale ) T1_FIELD_NUM ( "BlueShift", blue_shift ) T1_FIELD_NUM ( "BlueFuzz", blue_fuzz ) T1_FIELD_NUM_TABLE ( "BlueValues", blue_values, 14 ) T1_FIELD_NUM_TABLE ( "OtherBlues", other_blues, 10 ) T1_FIELD_NUM_TABLE ( "FamilyBlues", family_blues, 14 ) T1_FIELD_NUM_TABLE ( "FamilyOtherBlues", family_other_blues, 10 ) T1_FIELD_NUM_TABLE2( "StdHW", standard_width, 1 ) T1_FIELD_NUM_TABLE2( "StdVW", standard_height, 1 ) T1_FIELD_NUM_TABLE2( "MinFeature", min_feature, 2 ) T1_FIELD_NUM_TABLE ( "StemSnapH", snap_widths, 12 ) T1_FIELD_NUM_TABLE ( "StemSnapV", snap_heights, 12 ) #undef FT_STRUCTURE #define FT_STRUCTURE FT_BBox #undef T1CODE #define T1CODE T1_FIELD_LOCATION_BBOX T1_FIELD_BBOX( "FontBBox", xMin ) /* END */ --- NEW FILE: cidobjs.h --- /***************************************************************************/ /* */ /* cidobjs.h */ /* */ /* CID objects manager (specification). */ /* */ /* Copyright 1996-2001, 2002, 2004 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __CIDOBJS_H__ #define __CIDOBJS_H__ #include <ft2build.h> #include FT_INTERNAL_OBJECTS_H #include FT_CONFIG_CONFIG_H #include FT_INTERNAL_TYPE1_TYPES_H FT_BEGIN_HEADER /* The following structures must be defined by the hinter */ typedef struct CID_Size_Hints_ CID_Size_Hints; typedef struct CID_Glyph_Hints_ CID_Glyph_Hints; /*************************************************************************/ /* */ /* <Type> */ /* CID_Driver */ /* */ /* <Description> */ /* A handle to a Type 1 driver object. */ /* */ typedef struct CID_DriverRec_* CID_Driver; /*************************************************************************/ /* */ /* <Type> */ /* CID_Size */ /* */ /* <Description> */ /* A handle to a Type 1 size object. */ /* */ typedef struct CID_SizeRec_* CID_Size; /*************************************************************************/ /* */ /* <Type> */ /* CID_GlyphSlot */ /* */ /* <Description> */ /* A handle to a Type 1 glyph slot object. */ /* */ typedef struct CID_GlyphSlotRec_* CID_GlyphSlot; /*************************************************************************/ /* */ /* <Type> */ /* CID_CharMap */ /* */ /* <Description> */ /* A handle to a Type 1 character mapping object. */ /* */ /* <Note> */ /* The Type 1 format doesn't use a charmap but an encoding table. */ /* The driver is responsible for making up charmap objects */ /* corresponding to these tables. */ /* */ typedef struct CID_CharMapRec_* CID_CharMap; /*************************************************************************/ /* */ /* HERE BEGINS THE TYPE 1 SPECIFIC STUFF */ /* */ /*************************************************************************/ typedef struct CID_SizeRec_ { FT_SizeRec root; FT_Bool valid; } CID_SizeRec; typedef struct CID_GlyphSlotRec_ { FT_GlyphSlotRec root; FT_Bool hint; FT_Bool scaled; FT_Fixed x_scale; FT_Fixed y_scale; } CID_GlyphSlotRec; FT_LOCAL( void ) cid_slot_done( FT_GlyphSlot slot ); FT_LOCAL( FT_Error ) cid_slot_init( FT_GlyphSlot slot ); FT_LOCAL( void ) cid_size_done( FT_Size size ); /* CID_Size */ FT_LOCAL( FT_Error ) cid_size_init( FT_Size size ); /* CID_Size */ FT_LOCAL( FT_Error ) cid_size_reset( FT_Size size, /* CID_Size */ FT_UInt char_width, FT_UInt char_height ); FT_LOCAL( FT_Error ) cid_point_size_reset( FT_Size size, FT_F26Dot6 char_width, FT_F26Dot6 char_height, FT_UInt horz_resolution, FT_UInt vert_resolution ); FT_LOCAL( FT_Error ) cid_face_init( FT_Stream stream, FT_Face face, /* CID_Face */ FT_Int face_index, FT_Int num_params, FT_Parameter* params ); FT_LOCAL( void ) cid_face_done( FT_Face face ); /* CID_Face */ FT_LOCAL( FT_Error ) cid_driver_init( FT_Module driver ); FT_LOCAL( void ) cid_driver_done( FT_Module driver ); FT_END_HEADER #endif /* __CIDOBJS_H__ */ /* END */ --- NEW FILE: cidload.h --- /***************************************************************************/ /* */ /* cidload.h */ /* */ /* CID-keyed Type1 font loader (specification). */ /* */ /* Copyright 1996-2001, 2002, 2003, 2004 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __CIDLOAD_H__ #define __CIDLOAD_H__ #include <ft2build.h> #include FT_INTERNAL_STREAM_H #include "cidparse.h" FT_BEGIN_HEADER typedef struct CID_Loader_ { CID_Parser parser; /* parser used to read the stream */ FT_Int num_chars; /* number of characters in encoding */ } CID_Loader; FT_LOCAL( FT_Long ) cid_get_offset( FT_Byte** start, FT_Byte offsize ); FT_LOCAL( FT_Error ) cid_face_open( CID_Face face, FT_Int face_index ); FT_END_HEADER #endif /* __CIDLOAD_H__ */ /* END */ --- NEW FILE: cidparse.h --- /***************************************************************************/ /* */ /* cidparse.h */ /* */ /* CID-keyed Type1 parser (specification). */ /* */ /* Copyright 1996-2001, 2002, 2003, 2004 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __CIDPARSE_H__ #define __CIDPARSE_H__ #include <ft2build.h> #include FT_INTERNAL_TYPE1_TYPES_H #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_POSTSCRIPT_AUX_H FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Struct> */ /* CID_Parser */ /* */ /* <Description> */ /* A CID_Parser is an object used to parse a Type 1 fonts very */ /* quickly. */ /* */ /* <Fields> */ /* root :: The root PS_ParserRec fields. */ /* */ /* stream :: The current input stream. */ /* */ /* postscript :: A pointer to the data to be parsed. */ /* */ /* postscript_len :: The length of the data to be parsed. */ /* */ /* data_offset :: The start position of the binary data (i.e., the */ /* end of the data to be parsed. */ /* */ /* binary_length :: The length of the data after the `StartData' */ /* command if the data format is hexadecimal. */ /* */ /* cid :: A structure which holds the information about */ /* the current font. */ /* */ /* num_dict :: The number of font dictionaries. */ /* */ typedef struct CID_Parser_ { PS_ParserRec root; FT_Stream stream; FT_Byte* postscript; FT_Long postscript_len; FT_ULong data_offset; FT_Long binary_length; CID_FaceInfo cid; FT_Int num_dict; } CID_Parser; FT_LOCAL( FT_Error ) cid_parser_new( CID_Parser* parser, FT_Stream stream, FT_Memory memory, PSAux_Service psaux ); FT_LOCAL( void ) cid_parser_done( CID_Parser* parser ); /*************************************************************************/ /* */ /* PARSING ROUTINES */ /* */ /*************************************************************************/ #define cid_parser_skip_spaces( p ) \ (p)->root.funcs.skip_spaces( &(p)->root ) #define cid_parser_skip_PS_token( p ) \ (p)->root.funcs.skip_PS_token( &(p)->root ) #define cid_parser_to_int( p ) (p)->root.funcs.to_int( &(p)->root ) #define cid_parser_to_fixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t ) #define cid_parser_to_coord_array( p, m, c ) \ (p)->root.funcs.to_coord_array( &(p)->root, m, c ) #define cid_parser_to_fixed_array( p, m, f, t ) \ (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t ) #define cid_parser_to_token( p, t ) \ (p)->root.funcs.to_token( &(p)->root, t ) #define cid_parser_to_token_array( p, t, m, c ) \ (p)->root.funcs.to_token_array( &(p)->root, t, m, c ) #define cid_parser_load_field( p, f, o ) \ (p)->root.funcs.load_field( &(p)->root, f, o, 0, 0 ) #define cid_parser_load_field_table( p, f, o ) \ (p)->root.funcs.load_field_table( &(p)->root, f, o, 0, 0 ) FT_END_HEADER #endif /* __CIDPARSE_H__ */ /* END */ --- NEW FILE: module.mk --- # # FreeType 2 CID module definition # # Copyright 1996-2000 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. make_module_list: add_type1cid_driver add_type1cid_driver: $(OPEN_DRIVER)t1cid_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)cid $(ECHO_DRIVER_DESC)Postscript CID-keyed fonts, no known extension$(ECHO_DRIVER_DONE) # EOF --- NEW FILE: cidriver.h --- /***************************************************************************/ /* */ /* cidriver.h */ /* */ /* High-level CID driver interface (specification). */ /* */ /* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __CIDRIVER_H__ #define __CIDRIVER_H__ #include <ft2build.h> #include FT_INTERNAL_DRIVER_H FT_BEGIN_HEADER FT_CALLBACK_TABLE const FT_Driver_ClassRec t1cid_driver_class; FT_END_HEADER #endif /* __CIDRIVER_H__ */ /* END */ --- NEW FILE: ciderrs.h --- /***************************************************************************/ /* */ /* ciderrs.h */ /* */ /* CID error codes (specification only). */ /* */ /* Copyright 2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file is used to define the CID error enumeration constants. */ /* */ /*************************************************************************/ #ifndef __CIDERRS_H__ #define __CIDERRS_H__ #include FT_MODULE_ERRORS_H #undef __FTERRORS_H__ #define FT_ERR_PREFIX CID_Err_ #define FT_ERR_BASE FT_Mod_Err_CID #include FT_ERRORS_H #endif /* __CIDERRS_H__ */ /* END */ |
From: Ehud S. <esh...@us...> - 2006-04-21 16:31:22
|
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/raster In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28321/src/raster Added Files: Jamfile ftmisc.h ftraster.h ftrend1.h module.mk rasterrs.h rules.mk Log Message: Import freetype sources. --- NEW FILE: rules.mk --- # # FreeType 2 renderer module build rules # # Copyright 1996-2000, 2001, 2003 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. # raster driver directory # RASTER_DIR := $(SRC_DIR)/raster # compilation flags for the driver # RASTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(RASTER_DIR)) # raster driver sources (i.e., C files) # RASTER_DRV_SRC := $(RASTER_DIR)/ftraster.c \ $(RASTER_DIR)/ftrend1.c # raster driver headers # RASTER_DRV_H := $(RASTER_DRV_SRC:%.c=%.h) \ $(RASTER_DIR)/rasterrs.h # raster driver object(s) # # RASTER_DRV_OBJ_M is used during `multi' builds. # RASTER_DRV_OBJ_S is used during `single' builds. # RASTER_DRV_OBJ_M := $(RASTER_DRV_SRC:$(RASTER_DIR)/%.c=$(OBJ_DIR)/%.$O) RASTER_DRV_OBJ_S := $(OBJ_DIR)/raster.$O # raster driver source file for single build # RASTER_DRV_SRC_S := $(RASTER_DIR)/raster.c # raster driver - single object # $(RASTER_DRV_OBJ_S): $(RASTER_DRV_SRC_S) $(RASTER_DRV_SRC) \ $(FREETYPE_H) $(RASTER_DRV_H) $(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(RASTER_DRV_SRC_S)) # raster driver - multiple objects # $(OBJ_DIR)/%.$O: $(RASTER_DIR)/%.c $(FREETYPE_H) $(RASTER_DRV_H) $(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) # update main driver object lists # DRV_OBJS_S += $(RASTER_DRV_OBJ_S) DRV_OBJS_M += $(RASTER_DRV_OBJ_M) # EOF --- NEW FILE: Jamfile --- # FreeType 2 src/raster Jamfile # # Copyright 2001 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. SubDir FT2_TOP $(FT2_SRC_DIR) raster ; { local _sources ; if $(FT2_MULTI) { _sources = ftraster ftrend1 ; } else { _sources = raster ; } Library $(FT2_LIB) : $(_sources).c ; } # end of src/raster Jamfile --- NEW FILE: ftrend1.h --- /***************************************************************************/ /* */ /* ftrend1.h */ /* */ /* The FreeType glyph rasterizer interface (specification). */ /* */ /* Copyright 1996-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __FTREND1_H__ #define __FTREND1_H__ #include <ft2build.h> #include FT_RENDER_H FT_BEGIN_HEADER FT_EXPORT_VAR( const FT_Renderer_Class ) ft_raster1_renderer_class; /* this renderer is _NOT_ part of the default modules, you'll need */ /* to register it by hand in your application. It should only be */ /* used for backwards-compatibility with FT 1.x anyway. */ /* */ FT_EXPORT_VAR( const FT_Renderer_Class ) ft_raster5_renderer_class; FT_END_HEADER #endif /* __FTREND1_H__ */ /* END */ --- NEW FILE: ftmisc.h --- /***************************************************************************/ /* */ /* ftmisc.h */ /* */ /* Miscellaneous macros for stand-alone rasterizer (specification */ /* only). */ /* */ /* Copyright 2005 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ /* modified and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /***************************************************/ /* */ /* This file is *not* portable! You have to adapt */ /* its definitions to your platform. */ /* */ /***************************************************/ #ifndef __FTMISC_H__ #define __FTMISC_H__ #include <string.h> /* memset */ #define FT_BEGIN_HEADER #define FT_END_HEADER #define FT_LOCAL_DEF( x ) static x /* from include/freetype2/fttypes.h */ typedef unsigned char FT_Byte; typedef signed int FT_Int; typedef unsigned int FT_UInt; typedef signed long FT_Long; typedef unsigned long FT_ULong; typedef signed long FT_F26Dot6; typedef int FT_Error; #define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ ( ( (FT_ULong)_x1 << 24 ) | \ ( (FT_ULong)_x2 << 16 ) | \ ( (FT_ULong)_x3 << 8 ) | \ (FT_ULong)_x4 ) /* from src/ftcalc.c */ #include <inttypes.h> typedef int64_t FT_Int64; static FT_Long FT_MulDiv( FT_Long a, FT_Long b, FT_Long c ) { FT_Int s; FT_Long d; s = 1; if ( a < 0 ) { a = -a; s = -1; } if ( b < 0 ) { b = -b; s = -s; } if ( c < 0 ) { c = -c; s = -s; } d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c : 0x7FFFFFFFL ); return ( s > 0 ) ? d : -d; } #endif /* __FTMISC_H__ */ /* END */ --- NEW FILE: module.mk --- # # FreeType 2 renderer module definition # # Copyright 1996-2000 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. make_module_list: add_raster_module add_raster_module: $(OPEN_DRIVER)ft_raster1_renderer_class$(CLOSE_DRIVER) $(ECHO_DRIVER)raster $(ECHO_DRIVER_DESC)monochrome bitmap renderer$(ECHO_DRIVER_DONE) # EOF --- NEW FILE: rasterrs.h --- /***************************************************************************/ /* */ /* rasterrs.h */ /* */ /* monochrome renderer error codes (specification only). */ /* */ /* Copyright 2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file is used to define the monochrome renderer error enumeration */ /* constants. */ /* */ /*************************************************************************/ #ifndef __RASTERRS_H__ #define __RASTERRS_H__ #include FT_MODULE_ERRORS_H #undef __FTERRORS_H__ #define FT_ERR_PREFIX Raster_Err_ #define FT_ERR_BASE FT_Mod_Err_Raster #include FT_ERRORS_H #endif /* __RASTERRS_H__ */ /* END */ --- NEW FILE: ftraster.h --- /***************************************************************************/ /* */ /* ftraster.h */ /* */ /* The FreeType glyph rasterizer (specification). */ /* */ /* Copyright 1996-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ /* modified and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __FTRASTER_H__ #define __FTRASTER_H__ #include <ft2build.h> #include FT_CONFIG_CONFIG_H #include FT_IMAGE_H FT_BEGIN_HEADER /*************************************************************************/ /* */ /* Uncomment the following line if you are using ftraster.c as a */ /* standalone module, fully independent of FreeType. */ /* */ /* #define _STANDALONE_ */ FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_standard_raster; FT_END_HEADER #endif /* __FTRASTER_H__ */ /* END */ |
From: Ehud S. <esh...@us...> - 2006-04-21 16:31:22
|
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/smooth In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28321/src/smooth Added Files: Jamfile ftgrays.h ftsmerrs.h ftsmooth.h module.mk rules.mk Log Message: Import freetype sources. --- NEW FILE: rules.mk --- # # FreeType 2 smooth renderer module build rules # # Copyright 1996-2000, 2001, 2003 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. # smooth driver directory # SMOOTH_DIR := $(SRC_DIR)/smooth # compilation flags for the driver # SMOOTH_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SMOOTH_DIR)) # smooth driver sources (i.e., C files) # SMOOTH_DRV_SRC := $(SMOOTH_DIR)/ftgrays.c \ $(SMOOTH_DIR)/ftsmooth.c # smooth driver headers # SMOOTH_DRV_H := $(SMOOTH_DRV_SRC:%c=%h) \ $(SMOOTH_DIR)/ftsmerrs.h # smooth driver object(s) # # SMOOTH_DRV_OBJ_M is used during `multi' builds. # SMOOTH_DRV_OBJ_S is used during `single' builds. # SMOOTH_DRV_OBJ_M := $(SMOOTH_DRV_SRC:$(SMOOTH_DIR)/%.c=$(OBJ_DIR)/%.$O) SMOOTH_DRV_OBJ_S := $(OBJ_DIR)/smooth.$O # smooth driver source file for single build # SMOOTH_DRV_SRC_S := $(SMOOTH_DIR)/smooth.c # smooth driver - single object # $(SMOOTH_DRV_OBJ_S): $(SMOOTH_DRV_SRC_S) $(SMOOTH_DRV_SRC) \ $(FREETYPE_H) $(SMOOTH_DRV_H) $(SMOOTH_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(SMOOTH_DRV_SRC_S)) # smooth driver - multiple objects # $(OBJ_DIR)/%.$O: $(SMOOTH_DIR)/%.c $(FREETYPE_H) $(SMOOTH_DRV_H) $(SMOOTH_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) # update main driver object lists # DRV_OBJS_S += $(SMOOTH_DRV_OBJ_S) DRV_OBJS_M += $(SMOOTH_DRV_OBJ_M) # EOF --- NEW FILE: Jamfile --- # FreeType 2 src/smooth Jamfile # # Copyright 2001 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. SubDir FT2_TOP $(FT2_SRC_DIR) smooth ; { local _sources ; if $(FT2_MULTI) { _sources = ftgrays ftsmooth ; } else { _sources = smooth ; } Library $(FT2_LIB) : $(_sources).c ; } # end of src/smooth Jamfile --- NEW FILE: ftgrays.h --- /***************************************************************************/ /* */ /* ftgrays.h */ /* */ /* FreeType smooth renderer declaration */ /* */ /* Copyright 1996-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __FTGRAYS_H__ #define __FTGRAYS_H__ #ifdef __cplusplus extern "C" { #endif #ifdef _STANDALONE_ #include "ftimage.h" #else #include <ft2build.h> #include FT_IMAGE_H #endif /*************************************************************************/ /* */ /* To make ftgrays.h independent from configuration files we check */ /* whether FT_EXPORT_VAR has been defined already. */ /* */ /* On some systems and compilers (Win32 mostly), an extra keyword is */ /* necessary to compile the library as a DLL. */ /* */ #ifndef FT_EXPORT_VAR #define FT_EXPORT_VAR( x ) extern x #endif FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_grays_raster; #ifdef __cplusplus } #endif #endif /* __FTGRAYS_H__ */ /* END */ --- NEW FILE: module.mk --- # # FreeType 2 smooth renderer module definition # # Copyright 1996-2000 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. make_module_list: add_smooth_renderer add_smooth_renderer: $(OPEN_DRIVER)ft_smooth_renderer_class$(CLOSE_DRIVER) $(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer$(ECHO_DRIVER_DONE) # EOF --- NEW FILE: ftsmooth.h --- /***************************************************************************/ /* */ /* ftsmooth.h */ /* */ /* Anti-aliasing renderer interface (specification). */ /* */ /* Copyright 1996-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __FTSMOOTH_H__ #define __FTSMOOTH_H__ #include <ft2build.h> #include FT_RENDER_H FT_BEGIN_HEADER #ifndef FT_CONFIG_OPTION_NO_STD_RASTER FT_EXPORT_VAR( const FT_Renderer_Class ) ft_std_renderer_class; #endif #ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_renderer_class; FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_lcd_renderer_class; FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_lcd_v_renderer_class; #endif FT_END_HEADER #endif /* __FTSMOOTH_H__ */ /* END */ --- NEW FILE: ftsmerrs.h --- /***************************************************************************/ /* */ /* ftsmerrs.h */ /* */ /* smooth renderer error codes (specification only). */ /* */ /* Copyright 2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file is used to define the smooth renderer error enumeration */ /* constants. */ /* */ /*************************************************************************/ #ifndef __FTSMERRS_H__ #define __FTSMERRS_H__ #include FT_MODULE_ERRORS_H #undef __FTERRORS_H__ #define FT_ERR_PREFIX Smooth_Err_ #define FT_ERR_BASE FT_Mod_Err_Smooth #include FT_ERRORS_H #endif /* __FTSMERRS_H__ */ /* END */ |
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/truetype In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28321/src/truetype Added Files: Jamfile module.mk rules.mk ttdriver.h tterrors.h ttgload.h ttgxvar.h ttinterp.h ttobjs.h ttpload.h Log Message: Import freetype sources. --- NEW FILE: rules.mk --- # # FreeType 2 TrueType driver configuration rules # # Copyright 1996-2000, 2001, 2003, 2004 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. # TrueType driver directory # TT_DIR := $(SRC_DIR)/truetype # compilation flags for the driver # TT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(TT_DIR)) # TrueType driver sources (i.e., C files) # TT_DRV_SRC := $(TT_DIR)/ttobjs.c \ $(TT_DIR)/ttpload.c \ $(TT_DIR)/ttgload.c \ $(TT_DIR)/ttinterp.c \ $(TT_DIR)/ttgxvar.c \ $(TT_DIR)/ttdriver.c # TrueType driver headers # TT_DRV_H := $(TT_DRV_SRC:%.c=%.h) \ $(TT_DIR)/tterrors.h # TrueType driver object(s) # # TT_DRV_OBJ_M is used during `multi' builds # TT_DRV_OBJ_S is used during `single' builds # TT_DRV_OBJ_M := $(TT_DRV_SRC:$(TT_DIR)/%.c=$(OBJ_DIR)/%.$O) TT_DRV_OBJ_S := $(OBJ_DIR)/truetype.$O # TrueType driver source file for single build # TT_DRV_SRC_S := $(TT_DIR)/truetype.c # TrueType driver - single object # $(TT_DRV_OBJ_S): $(TT_DRV_SRC_S) $(TT_DRV_SRC) $(FREETYPE_H) $(TT_DRV_H) $(TT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(TT_DRV_SRC_S)) # driver - multiple objects # $(OBJ_DIR)/%.$O: $(TT_DIR)/%.c $(FREETYPE_H) $(TT_DRV_H) $(TT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) # update main driver object lists # DRV_OBJS_S += $(TT_DRV_OBJ_S) DRV_OBJS_M += $(TT_DRV_OBJ_M) # EOF --- NEW FILE: Jamfile --- # FreeType 2 src/truetype Jamfile # # Copyright 2001, 2004 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. SubDir FT2_TOP $(FT2_SRC_DIR) truetype ; { local _sources ; if $(FT2_MULTI) { _sources = ttdriver ttobjs ttpload ttgload ttinterp ttgxvar ; } else { _sources = truetype ; } Library $(FT2_LIB) : $(_sources).c ; } # end of src/truetype Jamfile --- NEW FILE: tterrors.h --- /***************************************************************************/ /* */ /* tterrors.h */ /* */ /* TrueType error codes (specification only). */ /* */ /* Copyright 2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file is used to define the TrueType error enumeration */ /* constants. */ /* */ /*************************************************************************/ #ifndef __TTERRORS_H__ #define __TTERRORS_H__ #include FT_MODULE_ERRORS_H #undef __FTERRORS_H__ #define FT_ERR_PREFIX TT_Err_ #define FT_ERR_BASE FT_Mod_Err_TrueType #include FT_ERRORS_H #endif /* __TTERRORS_H__ */ /* END */ --- NEW FILE: ttinterp.h --- /***************************************************************************/ /* */ /* ttinterp.h */ /* */ /* TrueType bytecode interpreter (specification). */ /* */ /* Copyright 1996-2001, 2002, 2003, 2004 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __TTINTERP_H__ #define __TTINTERP_H__ #include <ft2build.h> #include "ttobjs.h" FT_BEGIN_HEADER #ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */ #define EXEC_OP_ TT_ExecContext exc, #define EXEC_OP TT_ExecContext exc #define EXEC_ARG_ exc, #define EXEC_ARG exc #else /* static implementation */ #define EXEC_OP_ /* void */ #define EXEC_OP /* void */ #define EXEC_ARG_ /* void */ #define EXEC_ARG /* void */ #endif /* TT_CONFIG_OPTION_STATIC_INTERPRETER */ /*************************************************************************/ /* */ /* Rounding mode constants. */ /* */ #define TT_Round_Off 5 #define TT_Round_To_Half_Grid 0 #define TT_Round_To_Grid 1 #define TT_Round_To_Double_Grid 2 #define TT_Round_Up_To_Grid 4 #define TT_Round_Down_To_Grid 3 #define TT_Round_Super 6 #define TT_Round_Super_45 7 /*************************************************************************/ /* */ /* Function types used by the interpreter, depending on various modes */ /* (e.g. the rounding mode, whether to render a vertical or horizontal */ /* line etc). */ /* */ /*************************************************************************/ /* Rounding function */ typedef FT_F26Dot6 (*TT_Round_Func)( EXEC_OP_ FT_F26Dot6 distance, FT_F26Dot6 compensation ); /* Point displacement along the freedom vector routine */ typedef void (*TT_Move_Func)( EXEC_OP_ TT_GlyphZone zone, FT_UShort point, FT_F26Dot6 distance ); /* Distance projection along one of the projection vectors */ typedef FT_F26Dot6 (*TT_Project_Func)( EXEC_OP_ FT_Vector* v1, FT_Vector* v2 ); /* reading a cvt value. Take care of non-square pixels if necessary */ typedef FT_F26Dot6 (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong idx ); /* setting or moving a cvt value. Take care of non-square pixels */ /* if necessary */ typedef void (*TT_Set_CVT_Func)( EXEC_OP_ FT_ULong idx, FT_F26Dot6 value ); /*************************************************************************/ /* */ /* This structure defines a call record, used to manage function calls. */ /* */ typedef struct TT_CallRec_ { FT_Int Caller_Range; FT_Long Caller_IP; FT_Long Cur_Count; FT_Long Cur_Restart; } TT_CallRec, *TT_CallStack; /*************************************************************************/ /* */ /* The main structure for the interpreter which collects all necessary */ /* variables and states. */ /* */ typedef struct TT_ExecContextRec_ { TT_Face face; TT_Size size; FT_Memory memory; /* instructions state */ FT_Error error; /* last execution error */ FT_Long top; /* top of exec. stack */ FT_UInt stackSize; /* size of exec. stack */ FT_Long* stack; /* current exec. stack */ FT_Long args; FT_UInt new_top; /* new top after exec. */ TT_GlyphZoneRec zp0, /* zone records */ zp1, zp2, pts, twilight; FT_Size_Metrics metrics; TT_Size_Metrics tt_metrics; /* size metrics */ TT_GraphicsState GS; /* current graphics state */ FT_Int curRange; /* current code range number */ FT_Byte* code; /* current code range */ FT_Long IP; /* current instruction pointer */ FT_Long codeSize; /* size of current range */ FT_Byte opcode; /* current opcode */ FT_Int length; /* length of current opcode */ FT_Bool step_ins; /* true if the interpreter must */ /* increment IP after ins. exec */ FT_Long cvtSize; FT_Long* cvt; FT_UInt glyphSize; /* glyph instructions buffer size */ FT_Byte* glyphIns; /* glyph instructions buffer */ FT_UInt numFDefs; /* number of function defs */ FT_UInt maxFDefs; /* maximum number of function defs */ TT_DefArray FDefs; /* table of FDefs entries */ FT_UInt numIDefs; /* number of instruction defs */ FT_UInt maxIDefs; /* maximum number of ins defs */ TT_DefArray IDefs; /* table of IDefs entries */ FT_UInt maxFunc; /* maximum function index */ FT_UInt maxIns; /* maximum instruction index */ FT_Int callTop, /* top of call stack during execution */ callSize; /* size of call stack */ TT_CallStack callStack; /* call stack */ FT_UShort maxPoints; /* capacity of this context's `pts' */ FT_Short maxContours; /* record, expressed in points and */ /* contours. */ TT_CodeRangeTable codeRangeTable; /* table of valid code ranges */ /* useful for the debugger */ FT_UShort storeSize; /* size of current storage */ FT_Long* storage; /* storage area */ FT_F26Dot6 period; /* values used for the */ FT_F26Dot6 phase; /* `SuperRounding' */ FT_F26Dot6 threshold; #if 0 /* this seems to be unused */ FT_Int cur_ppem; /* ppem along the current proj vector */ #endif FT_Bool instruction_trap; /* If `True', the interpreter will */ /* exit after each instruction */ TT_GraphicsState default_GS; /* graphics state resulting from */ /* the prep program */ FT_Bool is_composite; /* true if the glyph is composite */ FT_Bool pedantic_hinting; /* true if pedantic interpretation */ /* latest interpreter additions */ FT_Long F_dot_P; /* dot product of freedom and projection */ /* vectors */ TT_Round_Func func_round; /* current rounding function */ TT_Project_Func func_project, /* current projection function */ func_dualproj, /* current dual proj. function */ func_freeProj; /* current freedom proj. func */ TT_Move_Func func_move; /* current point move function */ TT_Move_Func func_move_orig; /* move original position function */ TT_Get_CVT_Func func_read_cvt; /* read a cvt entry */ TT_Set_CVT_Func func_write_cvt; /* write a cvt entry (in pixels) */ TT_Set_CVT_Func func_move_cvt; /* incr a cvt entry (in pixels) */ FT_ULong loadSize; TT_SubGlyph_Stack loadStack; /* loading subglyph stack */ FT_Bool grayscale; /* are we hinting for grayscale? */ } TT_ExecContextRec; extern const TT_GraphicsState tt_default_graphics_state; FT_LOCAL( FT_Error ) TT_Goto_CodeRange( TT_ExecContext exec, FT_Int range, FT_Long IP ); FT_LOCAL( FT_Error ) TT_Set_CodeRange( TT_ExecContext exec, FT_Int range, void* base, FT_Long length ); FT_LOCAL( FT_Error ) TT_Clear_CodeRange( TT_ExecContext exec, FT_Int range ); /*************************************************************************/ /* */ /* <Function> */ /* TT_New_Context */ /* */ /* <Description> */ /* Queries the face context for a given font. Note that there is */ /* now a _single_ execution context in the TrueType driver which is */ /* shared among faces. */ /* */ /* <Input> */ /* face :: A handle to the source face object. */ /* */ /* <Return> */ /* A handle to the execution context. Initialized for `face'. */ /* */ /* <Note> */ /* Only the glyph loader and debugger should call this function. */ /* */ FT_EXPORT( TT_ExecContext ) TT_New_Context( TT_Face face ); FT_LOCAL( FT_Error ) TT_Done_Context( TT_ExecContext exec ); FT_LOCAL( FT_Error ) TT_Destroy_Context( TT_ExecContext exec, FT_Memory memory ); FT_LOCAL( FT_Error ) TT_Load_Context( TT_ExecContext exec, TT_Face face, TT_Size size ); FT_LOCAL( FT_Error ) TT_Save_Context( TT_ExecContext exec, TT_Size ins ); FT_LOCAL( FT_Error ) TT_Run_Context( TT_ExecContext exec, FT_Bool debug ); /*************************************************************************/ /* */ /* <Function> */ /* TT_RunIns */ /* */ /* <Description> */ /* Executes one or more instruction in the execution context. This */ /* is the main function of the TrueType opcode interpreter. */ /* */ /* <Input> */ /* exec :: A handle to the target execution context. */ /* */ /* <Return> */ /* FreeType error code. 0 means success. */ /* */ /* <Note> */ /* Only the object manager and debugger should call this function. */ /* */ /* This function is publicly exported because it is directly */ /* invoked by the TrueType debugger. */ /* */ FT_EXPORT( FT_Error ) TT_RunIns( TT_ExecContext exec ); FT_END_HEADER #endif /* __TTINTERP_H__ */ /* END */ --- NEW FILE: ttobjs.h --- /***************************************************************************/ /* */ /* ttobjs.h */ /* */ /* Objects manager (specification). */ /* */ /* Copyright 1996-2001, 2002, 2003, 2004 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __TTOBJS_H__ #define __TTOBJS_H__ #include <ft2build.h> #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_TRUETYPE_TYPES_H FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Type> */ /* TT_Driver */ /* */ /* <Description> */ /* A handle to a TrueType driver object. */ /* */ typedef struct TT_DriverRec_* TT_Driver; /*************************************************************************/ /* */ /* <Type> */ /* TT_Instance */ /* */ /* <Description> */ /* A handle to a TrueType size object. */ /* */ typedef struct TT_SizeRec_* TT_Size; /*************************************************************************/ /* */ /* <Type> */ /* TT_GlyphSlot */ /* */ /* <Description> */ /* A handle to a TrueType glyph slot object. */ /* */ /* <Note> */ /* This is a direct typedef of FT_GlyphSlot, as there is nothing */ /* specific about the TrueType glyph slot. */ /* */ typedef FT_GlyphSlot TT_GlyphSlot; /*************************************************************************/ /* */ /* <Struct> */ /* TT_GraphicsState */ /* */ /* <Description> */ /* The TrueType graphics state used during bytecode interpretation. */ /* */ typedef struct TT_GraphicsState_ { FT_UShort rp0; FT_UShort rp1; FT_UShort rp2; FT_UnitVector dualVector; FT_UnitVector projVector; FT_UnitVector freeVector; #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING FT_Bool both_x_axis; #endif FT_Long loop; FT_F26Dot6 minimum_distance; FT_Int round_state; FT_Bool auto_flip; FT_F26Dot6 control_value_cutin; FT_F26Dot6 single_width_cutin; FT_F26Dot6 single_width_value; FT_Short delta_base; FT_Short delta_shift; FT_Byte instruct_control; FT_Bool scan_control; FT_Int scan_type; FT_UShort gep0; FT_UShort gep1; FT_UShort gep2; } TT_GraphicsState; #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER FT_LOCAL( void ) tt_glyphzone_done( TT_GlyphZone zone ); FT_LOCAL( FT_Error ) tt_glyphzone_new( FT_Memory memory, FT_UShort maxPoints, FT_Short maxContours, TT_GlyphZone zone ); #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ /*************************************************************************/ /* */ /* EXECUTION SUBTABLES */ /* */ /* These sub-tables relate to instruction execution. */ /* */ /*************************************************************************/ #define TT_MAX_CODE_RANGES 3 /*************************************************************************/ /* */ /* There can only be 3 active code ranges at once: */ /* - the Font Program */ /* - the CVT Program */ /* - a glyph's instructions set */ /* */ typedef enum TT_CodeRange_Tag_ { tt_coderange_none = 0, tt_coderange_font, tt_coderange_cvt, tt_coderange_glyph } TT_CodeRange_Tag; typedef struct TT_CodeRange_ { FT_Byte* base; FT_ULong size; } TT_CodeRange; typedef TT_CodeRange TT_CodeRangeTable[TT_MAX_CODE_RANGES]; /*************************************************************************/ /* */ /* Defines a function/instruction definition record. */ /* */ typedef struct TT_DefRecord_ { FT_Int range; /* in which code range is it located? */ FT_Long start; /* where does it start? */ FT_UInt opc; /* function #, or instruction code */ FT_Bool active; /* is it active? */ } TT_DefRecord, *TT_DefArray; /*************************************************************************/ /* */ /* Subglyph transformation record. */ /* */ typedef struct TT_Transform_ { FT_Fixed xx, xy; /* transformation matrix coefficients */ FT_Fixed yx, yy; FT_F26Dot6 ox, oy; /* offsets */ } TT_Transform; /*************************************************************************/ /* */ /* Subglyph loading record. Used to load composite components. */ /* */ typedef struct TT_SubglyphRec_ { FT_Long index; /* subglyph index; initialized with -1 */ FT_Bool is_scaled; /* is the subglyph scaled? */ FT_Bool is_hinted; /* should it be hinted? */ FT_Bool preserve_pps; /* preserve phantom points? */ FT_Long file_offset; FT_BBox bbox; FT_Pos left_bearing; FT_Pos advance; TT_GlyphZoneRec zone; FT_Long arg1; /* first argument */ FT_Long arg2; /* second argument */ FT_UShort element_flag; /* current load element flag */ TT_Transform transform; /* transformation matrix */ FT_Vector pp1, pp2; /* phantom points (horizontal) */ FT_Vector pp3, pp4; /* phantom points (vertical) */ } TT_SubGlyphRec, *TT_SubGlyph_Stack; /*************************************************************************/ /* */ /* A note regarding non-squared pixels: */ /* */ /* (This text will probably go into some docs at some time; for now, it */ /* is kept here to explain some definitions in the TIns_Metrics */ /* record). */ /* */ /* The CVT is a one-dimensional array containing values that control */ /* certain important characteristics in a font, like the height of all */ /* capitals, all lowercase letter, default spacing or stem width/height. */ /* */ /* These values are found in FUnits in the font file, and must be scaled */ /* to pixel coordinates before being used by the CVT and glyph programs. */ /* Unfortunately, when using distinct x and y resolutions (or distinct x */ /* and y pointsizes), there are two possible scalings. */ /* */ /* A first try was to implement a `lazy' scheme where all values were */ /* scaled when first used. However, while some values are always used */ /* in the same direction, some others are used under many different */ /* circumstances and orientations. */ /* */ /* I have found a simpler way to do the same, and it even seems to work */ /* in most of the cases: */ /* */ /* - All CVT values are scaled to the maximum ppem size. */ /* */ /* - When performing a read or write in the CVT, a ratio factor is used */ /* to perform adequate scaling. Example: */ /* */ /* x_ppem = 14 */ /* y_ppem = 10 */ /* */ /* We choose ppem = x_ppem = 14 as the CVT scaling size. All cvt */ /* entries are scaled to it. */ /* */ /* x_ratio = 1.0 */ /* y_ratio = y_ppem/ppem (< 1.0) */ /* */ /* We compute the current ratio like: */ /* */ /* - If projVector is horizontal, */ /* ratio = x_ratio = 1.0 */ /* */ /* - if projVector is vertical, */ /* ratio = y_ratio */ /* */ /* - else, */ /* ratio = sqrt( (proj.x * x_ratio) ^ 2 + (proj.y * y_ratio) ^ 2 ) */ /* */ /* Reading a cvt value returns */ /* ratio * cvt[index] */ /* */ /* Writing a cvt value in pixels: */ /* cvt[index] / ratio */ /* */ /* The current ppem is simply */ /* ratio * ppem */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* Metrics used by the TrueType size and context objects. */ /* */ typedef struct TT_Size_Metrics_ { /* for non-square pixels */ FT_Long x_ratio; FT_Long y_ratio; FT_UShort ppem; /* maximum ppem size */ FT_Long ratio; /* current ratio */ FT_Fixed scale; FT_F26Dot6 compensations[4]; /* device-specific compensations */ FT_Bool valid; FT_Bool rotated; /* `is the glyph rotated?'-flag */ FT_Bool stretched; /* `is the glyph stretched?'-flag */ } TT_Size_Metrics; /*************************************************************************/ /* */ /* TrueType size class. */ /* */ typedef struct TT_SizeRec_ { FT_SizeRec root; FT_Size_Metrics metrics; /* slightly different from the root metrics */ TT_Size_Metrics ttmetrics; #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS FT_UInt strike_index; /* 0xFFFF to indicate invalid */ FT_Size_Metrics strike_metrics; /* current strike's metrics */ #endif #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER FT_UInt num_function_defs; /* number of function definitions */ FT_UInt max_function_defs; TT_DefArray function_defs; /* table of function definitions */ FT_UInt num_instruction_defs; /* number of ins. definitions */ FT_UInt max_instruction_defs; TT_DefArray instruction_defs; /* table of ins. definitions */ FT_UInt max_func; FT_UInt max_ins; TT_CodeRangeTable codeRangeTable; TT_GraphicsState GS; FT_ULong cvt_size; /* the scaled control value table */ FT_Long* cvt; FT_UShort storage_size; /* The storage area is now part of */ FT_Long* storage; /* the instance */ TT_GlyphZoneRec twilight; /* The instance's twilight zone */ /* debugging variables */ /* When using the debugger, we must keep the */ /* execution context tied to the instance */ /* object rather than asking it on demand. */ FT_Bool debug; TT_ExecContext context; #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ } TT_SizeRec; /*************************************************************************/ /* */ /* TrueType driver class. */ /* */ typedef struct TT_DriverRec_ { FT_DriverRec root; TT_ExecContext context; /* execution context */ TT_GlyphZoneRec zone; /* glyph loader points zone */ void* extension_component; } TT_DriverRec; /* Note: All of the functions below (except tt_size_reset()) are used */ /* as function pointers in a FT_Driver_ClassRec. Therefore their */ /* parameters are of types FT_Face, FT_Size, etc., rather than TT_Face, */ /* TT_Size, etc., so that the compiler can confirm that the types and */ /* number of parameters are correct. In all cases the FT_xxx types are */ /* cast to their TT_xxx counterparts inside the functions since FreeType */ /* will always use the TT driver to create them. */ /*************************************************************************/ /* */ /* Face functions */ /* */ FT_LOCAL( FT_Error ) tt_face_init( FT_Stream stream, FT_Face ttface, /* TT_Face */ FT_Int face_index, FT_Int num_params, FT_Parameter* params ); FT_LOCAL( void ) tt_face_done( FT_Face ttface ); /* TT_Face */ /*************************************************************************/ /* */ /* Size functions */ /* */ FT_LOCAL( FT_Error ) tt_size_init( FT_Size ttsize ); /* TT_Size */ FT_LOCAL( void ) tt_size_done( FT_Size ttsize ); /* TT_Size */ FT_LOCAL( FT_Error ) tt_size_reset( TT_Size size ); /*************************************************************************/ /* */ /* Driver functions */ /* */ FT_LOCAL( FT_Error ) tt_driver_init( FT_Module ttdriver ); /* TT_Driver */ FT_LOCAL( void ) tt_driver_done( FT_Module ttdriver ); /* TT_Driver */ FT_END_HEADER #endif /* __TTOBJS_H__ */ /* END */ --- NEW FILE: module.mk --- # # FreeType 2 TrueType module definition # # Copyright 1996-2000 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. make_module_list: add_truetype_driver add_truetype_driver: $(OPEN_DRIVER)tt_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)truetype $(ECHO_DRIVER_DESC)Windows/Mac font files with extension *.ttf or *.ttc$(ECHO_DRIVER_DONE) # EOF --- NEW FILE: ttdriver.h --- /***************************************************************************/ /* */ /* ttdriver.h */ /* */ /* High-level TrueType driver interface (specification). */ /* */ /* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __TTDRIVER_H__ #define __TTDRIVER_H__ #include <ft2build.h> #include FT_INTERNAL_DRIVER_H FT_BEGIN_HEADER FT_EXPORT_VAR( const FT_Driver_ClassRec ) tt_driver_class; FT_END_HEADER #endif /* __TTDRIVER_H__ */ /* END */ --- NEW FILE: ttpload.h --- /***************************************************************************/ /* */ /* ttpload.h */ /* */ /* TrueType glyph data/program tables loader (specification). */ /* */ /* Copyright 1996-2001, 2002, 2005 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __TTPLOAD_H__ #define __TTPLOAD_H__ #include <ft2build.h> #include FT_INTERNAL_TRUETYPE_TYPES_H FT_BEGIN_HEADER FT_LOCAL( FT_Error ) tt_face_load_loca( TT_Face face, FT_Stream stream ); FT_LOCAL( FT_ULong ) tt_face_get_location( TT_Face face, FT_UInt gindex, FT_UInt *asize ); FT_LOCAL( void ) tt_face_done_loca( TT_Face face ); FT_LOCAL( FT_Error ) tt_face_load_cvt( TT_Face face, FT_Stream stream ); FT_LOCAL( FT_Error ) tt_face_load_fpgm( TT_Face face, FT_Stream stream ); FT_END_HEADER #endif /* __TTPLOAD_H__ */ /* END */ --- NEW FILE: ttgload.h --- /***************************************************************************/ /* */ /* ttgload.h */ /* */ /* TrueType Glyph Loader (specification). */ /* */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __TTGLOAD_H__ #define __TTGLOAD_H__ #include <ft2build.h> #include "ttobjs.h" #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER #include "ttinterp.h" #endif FT_BEGIN_HEADER FT_LOCAL( void ) TT_Init_Glyph_Loading( TT_Face face ); FT_LOCAL( FT_Error ) TT_Load_Glyph( TT_Size size, TT_GlyphSlot glyph, FT_UInt glyph_index, FT_Int32 load_flags ); FT_END_HEADER #endif /* __TTGLOAD_H__ */ /* END */ --- NEW FILE: ttgxvar.h --- /***************************************************************************/ /* */ /* ttgxvar.h */ /* */ /* TrueType GX Font Variation loader (specification) */ /* */ /* Copyright 2004 by */ /* David Turner, Robert Wilhelm, Werner Lemberg and George Williams. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __TTGXVAR_H__ #define __TTGXVAR_H__ #include <ft2build.h> #include "ttobjs.h" FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Struct> */ /* GX_AVarCorrespondenceRec */ /* */ /* <Description> */ /* A data structure representing `shortFracCorrespondence' in `avar' */ /* table according to the specifications from Apple. */ /* */ typedef struct GX_AVarCorrespondenceRec_ { FT_Fixed fromCoord; FT_Fixed toCoord; } GX_AVarCorrespondenceRec_, *GX_AVarCorrespondence; /*************************************************************************/ /* */ /* <Struct> */ /* GX_AVarRec */ /* */ /* <Description> */ /* Data from the segment field of `avar' table. */ /* There is one of these for each axis. */ /* */ typedef struct GX_AVarSegmentRec_ { FT_UShort pairCount; GX_AVarCorrespondence correspondence; /* array with pairCount entries */ } GX_AVarSegmentRec, *GX_AVarSegment; /*************************************************************************/ /* */ /* <Struct> */ /* GX_BlendRec */ /* */ /* <Description> */ /* Data for interpolating a font from a distortable font specified */ /* by the GX *var tables ([fgca]var). */ /* */ /* <Fields> */ /* num_axis :: The number of axes along which interpolation */ /* may happen */ /* */ /* normalizedcoords :: A normalized value (between [-1,1]) indicating */ /* the contribution along each axis to the final */ /* interpolated font. */ /* */ typedef struct GX_BlendRec_ { FT_UInt num_axis; FT_Fixed* normalizedcoords; FT_MM_Var* mmvar; FT_Int mmvar_len; FT_Bool avar_checked; GX_AVarSegment avar_segment; FT_UInt tuplecount; /* shared tuples in `gvar' */ FT_Fixed* tuplecoords; /* tuplecoords[tuplecount][num_axis] */ FT_UInt gv_glyphcnt; FT_ULong* glyphoffsets; } GX_BlendRec; /*************************************************************************/ /* */ /* <enum> */ /* GX_TupleCountFlags */ /* */ /* <Description> */ /* Flags used within the `TupleCount' field of the `gvar' table. */ /* */ typedef enum GX_TupleCountFlags_ { GX_TC_TUPLES_SHARE_POINT_NUMBERS = 0x8000, GX_TC_RESERVED_TUPLE_FLAGS = 0x7000, GX_TC_TUPLE_COUNT_MASK = 0x0FFF } GX_TupleCountFlags; /*************************************************************************/ /* */ /* <enum> */ /* GX_TupleIndexFlags */ /* */ /* <Description> */ /* Flags used within the `TupleIndex' field of the `gvar' and `cvar' */ /* tables. */ /* */ typedef enum GX_TupleIndexFlags_ { GX_TI_EMBEDDED_TUPLE_COORD = 0x8000, GX_TI_INTERMEDIATE_TUPLE = 0x4000, GX_TI_PRIVATE_POINT_NUMBERS = 0x2000, GX_TI_RESERVED_TUPLE_FLAG = 0x1000, GX_TI_TUPLE_INDEX_MASK = 0x0FFF } GX_TupleIndexFlags; #define TTAG_wght FT_MAKE_TAG( 'w', 'g', 'h', 't' ) #define TTAG_wdth FT_MAKE_TAG( 'w', 'd', 't', 'h' ) #define TTAG_opsz FT_MAKE_TAG( 'o', 'p', 's', 'z' ) #define TTAG_slnt FT_MAKE_TAG( 's', 'l', 'n', 't' ) FT_LOCAL( FT_Error ) TT_Set_MM_Blend( TT_Face face, FT_UInt num_coords, FT_Fixed* coords ); FT_LOCAL( FT_Error ) TT_Set_Var_Design( TT_Face face, FT_UInt num_coords, FT_Fixed* coords ); FT_LOCAL( FT_Error ) TT_Get_MM_Var( TT_Face face, FT_MM_Var* *master ); FT_LOCAL( FT_Error ) tt_face_vary_cvt( TT_Face face, FT_Stream stream ); FT_LOCAL( FT_Error ) TT_Vary_Get_Glyph_Deltas( TT_Face face, FT_UInt glyph_index, FT_Vector* *deltas, FT_UInt n_points ); FT_LOCAL( void ) tt_done_blend( FT_Memory memory, GX_Blend blend ); FT_END_HEADER #endif /* __TTGXVAR_H__ */ /* END */ |
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/otvalid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28321/src/otvalid Added Files: Jamfile module.mk otvalid.h otvcommn.h otverror.h otvgpos.h otvmod.h rules.mk Log Message: Import freetype sources. --- NEW FILE: rules.mk --- # # FreeType 2 OpenType validation driver configuration rules # # Copyright 2004 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. # OTV driver directory # OTV_DIR := $(SRC_DIR)/otvalid # compilation flags for the driver # OTV_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(OTV_DIR)) # OTV driver sources (i.e., C files) # OTV_DRV_SRC := $(OTV_DIR)/otvbase.c \ $(OTV_DIR)/otvcommn.c \ $(OTV_DIR)/otvgdef.c \ $(OTV_DIR)/otvgpos.c \ $(OTV_DIR)/otvgsub.c \ $(OTV_DIR)/otvjstf.c \ $(OTV_DIR)/otvmod.c # OTV driver headers # OTV_DRV_H := $(OTV_DIR)/otvalid.h \ $(OTV_DIR)/otverror.h \ $(OTV_DIR)/otvcommn.h \ $(OTV_DIR)/otvgpos.h \ $(OTV_DIR)/otvmod.h # OTV driver object(s) # # OTV_DRV_OBJ_M is used during `multi' builds. # OTV_DRV_OBJ_S is used during `single' builds. # OTV_DRV_OBJ_M := $(OTV_DRV_SRC:$(OTV_DIR)/%.c=$(OBJ_DIR)/%.$O) OTV_DRV_OBJ_S := $(OBJ_DIR)/otvalid.$O # OTV driver source file for single build # OTV_DRV_SRC_S := $(OTV_DIR)/otvalid.c # OTV driver - single object # $(OTV_DRV_OBJ_S): $(OTV_DRV_SRC_S) $(OTV_DRV_SRC) \ $(FREETYPE_H) $(OTV_DRV_H) $(OTV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(OTV_DRV_SRC_S)) # OTV driver - multiple objects # $(OBJ_DIR)/%.$O: $(OTV_DIR)/%.c $(FREETYPE_H) $(OTV_DRV_H) $(OTV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) # update main driver object lists # DRV_OBJS_S += $(OTV_DRV_OBJ_S) DRV_OBJS_M += $(OTV_DRV_OBJ_M) # EOF --- NEW FILE: Jamfile --- # FreeType 2 src/otvalid Jamfile # # Copyright 2004 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. SubDir FT2_TOP $(FT2_SRC_DIR) otvalid ; { local _sources ; if $(FT2_MULTI) { _sources = otvbase otvcommn otvgdef otvgpos otvgsub otvjstf otvmod ; } else { _sources = otvalid ; } Library $(FT2_LIB) : $(_sources).c ; } # end of src/otvalid Jamfile --- NEW FILE: otvcommn.h --- /***************************************************************************/ /* */ /* otvcommn.h */ /* */ /* OpenType common tables validation (specification). */ /* */ /* Copyright 2004 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __OTVCOMMN_H__ #define __OTVCOMMN_H__ #include <ft2build.h> #include "otvalid.h" #include FT_INTERNAL_DEBUG_H FT_BEGIN_HEADER /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** VALIDATION *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ typedef struct OTV_ValidatorRec_* OTV_Validator; typedef void (*OTV_Validate_Func)( FT_Bytes table, OTV_Validator valid ); typedef struct OTV_ValidatorRec_ { FT_Validator root; FT_UInt type_count; OTV_Validate_Func* type_funcs; FT_UInt lookup_count; FT_UInt glyph_count; FT_UInt nesting_level; OTV_Validate_Func func[3]; FT_UInt extra1; /* for passing parameters */ FT_UInt extra2; FT_Bytes extra3; #ifdef FT_DEBUG_LEVEL_TRACE FT_UInt debug_indent; const FT_String* debug_function_name[3]; #endif } OTV_ValidatorRec; #undef FT_INVALID_ #define FT_INVALID_( _prefix, _error ) \ ft_validator_error( valid->root, _prefix ## _error ) #define OTV_OPTIONAL_TABLE( _table ) FT_UInt _table; \ FT_Bytes _table ## _p #define OTV_OPTIONAL_OFFSET( _offset ) \ FT_BEGIN_STMNT \ _offset ## _p = p; \ _offset = FT_NEXT_USHORT( p ); \ FT_END_STMNT #define OTV_LIMIT_CHECK( _count ) \ FT_BEGIN_STMNT \ if ( p + (_count) > valid->root->limit ) \ FT_INVALID_TOO_SHORT; \ FT_END_STMNT #define OTV_SIZE_CHECK( _size ) \ FT_BEGIN_STMNT \ if ( _size > 0 && _size < table_size ) \ { \ if ( valid->root->level == FT_VALIDATE_PARANOID ) \ FT_INVALID_OFFSET; \ else \ { \ /* strip off `const' */ \ FT_Byte* pp = (FT_Byte*)_size ## _p; \ \ \ FT_TRACE3(( "\n" \ "Invalid offset to optional table `%s'!\n" \ "Set to zero.\n" \ "\n", #_size )); \ \ /* always assume 16bit entities */ \ _size = pp[0] = pp[1] = 0; \ } \ } \ FT_END_STMNT #ifdef FT_DEBUG_LEVEL_TRACE /* use preprocessor's argument prescan to expand one argument into two */ #define OTV_NEST1( x ) OTV_NEST1_( x ) #define OTV_NEST1_( func0, name0 ) \ FT_BEGIN_STMNT \ valid->nesting_level = 0; \ valid->func[0] = func0; \ valid->debug_function_name[0] = name0; \ FT_END_STMNT /* use preprocessor's argument prescan to expand two arguments into four */ #define OTV_NEST2( x, y ) OTV_NEST2_( x, y ) #define OTV_NEST2_( func0, name0, func1, name1 ) \ FT_BEGIN_STMNT \ valid->nesting_level = 0; \ valid->func[0] = func0; \ valid->func[1] = func1; \ valid->debug_function_name[0] = name0; \ valid->debug_function_name[1] = name1; \ FT_END_STMNT /* use preprocessor's argument prescan to expand three arguments into six */ #define OTV_NEST3( x, y, z ) OTV_NEST3_( x, y, z ) #define OTV_NEST3_( func0, name0, func1, name1, func2, name2 ) \ FT_BEGIN_STMNT \ valid->nesting_level = 0; \ valid->func[0] = func0; \ valid->func[1] = func1; \ valid->func[2] = func2; \ valid->debug_function_name[0] = name0; \ valid->debug_function_name[1] = name1; \ valid->debug_function_name[2] = name2; \ FT_END_STMNT #define OTV_INIT valid->debug_indent = 0 #define OTV_ENTER \ FT_BEGIN_STMNT \ valid->debug_indent += 2; \ FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ FT_TRACE4(( "%s table\n", \ valid->debug_function_name[valid->nesting_level] )); \ FT_END_STMNT #define OTV_NAME_ENTER( name ) \ FT_BEGIN_STMNT \ valid->debug_indent += 2; \ FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ FT_TRACE4(( "%s table\n", name )); \ FT_END_STMNT #define OTV_EXIT valid->debug_indent -= 2 #define OTV_TRACE( s ) \ FT_BEGIN_STMNT \ FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ FT_TRACE4( s ); \ FT_END_STMNT #else /* !FT_DEBUG_LEVEL_TRACE */ /* use preprocessor's argument prescan to expand one argument into two */ #define OTV_NEST1( x ) OTV_NEST1_( x ) #define OTV_NEST1_( func0, name0 ) \ FT_BEGIN_STMNT \ valid->nesting_level = 0; \ valid->func[0] = func0; \ FT_END_STMNT /* use preprocessor's argument prescan to expand two arguments into four */ #define OTV_NEST2( x, y ) OTV_NEST2_( x, y ) #define OTV_NEST2_( func0, name0, func1, name1 ) \ FT_BEGIN_STMNT \ valid->nesting_level = 0; \ valid->func[0] = func0; \ valid->func[1] = func1; \ FT_END_STMNT /* use preprocessor's argument prescan to expand three arguments into six */ #define OTV_NEST3( x, y, z ) OTV_NEST3_( x, y, z ) #define OTV_NEST3_( func0, name0, func1, name1, func2, name2 ) \ FT_BEGIN_STMNT \ valid->nesting_level = 0; \ valid->func[0] = func0; \ valid->func[1] = func1; \ valid->func[2] = func2; \ FT_END_STMNT #define OTV_INIT do ; while ( 0 ) #define OTV_ENTER do ; while ( 0 ) #define OTV_NAME_ENTER( name ) do ; while ( 0 ) #define OTV_EXIT do ; while ( 0 ) #define OTV_TRACE( s ) do ; while ( 0 ) #endif /* !FT_DEBUG_LEVEL_TRACE */ #define OTV_RUN valid->func[0] /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** COVERAGE TABLE *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ FT_LOCAL( void ) otv_Coverage_validate( FT_Bytes table, OTV_Validator valid ); /* return first covered glyph */ FT_LOCAL( FT_UInt ) otv_Coverage_get_first( FT_Bytes table ); /* return last covered glyph */ FT_LOCAL( FT_UInt ) otv_Coverage_get_last( FT_Bytes table ); /* return number of covered glyphs */ FT_LOCAL( FT_UInt ) otv_Coverage_get_count( FT_Bytes table ); /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** CLASS DEFINITION TABLE *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ FT_LOCAL( void ) otv_ClassDef_validate( FT_Bytes table, OTV_Validator valid ); /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** DEVICE TABLE *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ FT_LOCAL( void ) otv_Device_validate( FT_Bytes table, OTV_Validator valid ); /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** LOOKUPS *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ FT_LOCAL( void ) otv_Lookup_validate( FT_Bytes table, OTV_Validator valid ); FT_LOCAL( void ) otv_LookupList_validate( FT_Bytes table, OTV_Validator valid ); /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** FEATURES *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ FT_LOCAL( void ) otv_Feature_validate( FT_Bytes table, OTV_Validator valid ); /* lookups must already be validated */ FT_LOCAL( void ) otv_FeatureList_validate( FT_Bytes table, FT_Bytes lookups, OTV_Validator valid ); /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** LANGUAGE SYSTEM *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ FT_LOCAL( void ) otv_LangSys_validate( FT_Bytes table, OTV_Validator valid ); /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** SCRIPTS *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ FT_LOCAL( void ) otv_Script_validate( FT_Bytes table, OTV_Validator valid ); /* features must already be validated */ FT_LOCAL( void ) otv_ScriptList_validate( FT_Bytes table, FT_Bytes features, OTV_Validator valid ); /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** UTILITY FUNCTIONS *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ #define ChainPosClassSet otv_x_Ox, "ChainPosClassSet" #define ChainPosRuleSet otv_x_Ox, "ChainPosRuleSet" #define ChainSubClassSet otv_x_Ox, "ChainSubClassSet" #define ChainSubRuleSet otv_x_Ox, "ChainSubRuleSet" #define JstfLangSys otv_x_Ox, "JstfLangSys" #define JstfMax otv_x_Ox, "JstfMax" #define LigGlyph otv_x_Ox, "LigGlyph" #define LigatureArray otv_x_Ox, "LigatureArray" #define LigatureSet otv_x_Ox, "LigatureSet" #define PosClassSet otv_x_Ox, "PosClassSet" #define PosRuleSet otv_x_Ox, "PosRuleSet" #define SubClassSet otv_x_Ox, "SubClassSet" #define SubRuleSet otv_x_Ox, "SubRuleSet" FT_LOCAL( void ) otv_x_Ox ( FT_Bytes table, OTV_Validator valid ); #define AlternateSubstFormat1 otv_u_C_x_Ox, "AlternateSubstFormat1" #define ChainContextPosFormat1 otv_u_C_x_Ox, "ChainContextPosFormat1" #define ChainContextSubstFormat1 otv_u_C_x_Ox, "ChainContextSubstFormat1" #define ContextPosFormat1 otv_u_C_x_Ox, "ContextPosFormat1" #define ContextSubstFormat1 otv_u_C_x_Ox, "ContextSubstFormat1" #define LigatureSubstFormat1 otv_u_C_x_Ox, "LigatureSubstFormat1" #define MultipleSubstFormat1 otv_u_C_x_Ox, "MultipleSubstFormat1" FT_LOCAL( void ) otv_u_C_x_Ox( FT_Bytes table, OTV_Validator valid ); #define AlternateSet otv_x_ux, "AlternateSet" #define AttachPoint otv_x_ux, "AttachPoint" #define ExtenderGlyph otv_x_ux, "ExtenderGlyph" #define JstfGPOSModList otv_x_ux, "JstfGPOSModList" #define JstfGSUBModList otv_x_ux, "JstfGSUBModList" #define Sequence otv_x_ux, "Sequence" FT_LOCAL( void ) otv_x_ux( FT_Bytes table, OTV_Validator valid ); #define PosClassRule otv_x_y_ux_sy, "PosClassRule" #define PosRule otv_x_y_ux_sy, "PosRule" #define SubClassRule otv_x_y_ux_sy, "SubClassRule" #define SubRule otv_x_y_ux_sy, "SubRule" FT_LOCAL( void ) otv_x_y_ux_sy( FT_Bytes table, OTV_Validator valid ); #define ChainPosClassRule otv_x_ux_y_uy_z_uz_p_sp, "ChainPosClassRule" #define ChainPosRule otv_x_ux_y_uy_z_uz_p_sp, "ChainPosRule" #define ChainSubClassRule otv_x_ux_y_uy_z_uz_p_sp, "ChainSubClassRule" #define ChainSubRule otv_x_ux_y_uy_z_uz_p_sp, "ChainSubRule" FT_LOCAL( void ) otv_x_ux_y_uy_z_uz_p_sp( FT_Bytes table, OTV_Validator valid ); #define ContextPosFormat2 otv_u_O_O_x_Onx, "ContextPosFormat2" #define ContextSubstFormat2 otv_u_O_O_x_Onx, "ContextSubstFormat2" FT_LOCAL( void ) otv_u_O_O_x_Onx( FT_Bytes table, OTV_Validator valid ); #define ContextPosFormat3 otv_u_x_y_Ox_sy, "ContextPosFormat3" #define ContextSubstFormat3 otv_u_x_y_Ox_sy, "ContextSubstFormat3" FT_LOCAL( void ) otv_u_x_y_Ox_sy( FT_Bytes table, OTV_Validator valid ); #define ChainContextPosFormat2 otv_u_O_O_O_O_x_Onx, "ChainContextPosFormat2" #define ChainContextSubstFormat2 otv_u_O_O_O_O_x_Onx, "ChainContextSubstFormat2" FT_LOCAL( void ) otv_u_O_O_O_O_x_Onx( FT_Bytes table, OTV_Validator valid ); #define ChainContextPosFormat3 otv_u_x_Ox_y_Oy_z_Oz_p_sp, "ChainContextPosFormat3" #define ChainContextSubstFormat3 otv_u_x_Ox_y_Oy_z_Oz_p_sp, "ChainContextSubstFormat3" FT_LOCAL( void ) otv_u_x_Ox_y_Oy_z_Oz_p_sp( FT_Bytes table, OTV_Validator valid ); FT_LOCAL( FT_UInt ) otv_GSUBGPOS_get_Lookup_count( FT_Bytes table ); FT_LOCAL( FT_UInt ) otv_GSUBGPOS_have_MarkAttachmentType_flag( FT_Bytes table ); /* */ FT_END_HEADER #endif /* __OTVCOMMN_H__ */ /* END */ --- NEW FILE: module.mk --- # # FreeType 2 otvalid module definition # # Copyright 2004 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. make_module_list: add_otvalid_module add_otvalid_module: $(OPEN_DRIVER)otvalid_module_class$(CLOSE_DRIVER) $(ECHO_DRIVER)otvalid $(ECHO_DRIVER_DESC)OpenType validation module$(ECHO_DRIVER_DONE) # EOF --- NEW FILE: otvmod.h --- /***************************************************************************/ /* */ /* otvmod.h */ /* */ /* FreeType's OpenType validation module implementation */ /* (specification). */ /* */ /* Copyright 2004 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __OTVMOD_H__ #define __OTVMOD_H__ #include <ft2build.h> #include FT_MODULE_H FT_BEGIN_HEADER FT_EXPORT_VAR( const FT_Module_Class ) otv_module_class; FT_END_HEADER #endif /* __OTVMOD_H__ */ /* END */ --- NEW FILE: otverror.h --- /***************************************************************************/ /* */ /* otverror.h */ /* */ /* OpenType validation module error codes (specification only). */ /* */ /* Copyright 2004, 2005 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file is used to define the OpenType validation module error */ /* enumeration constants. */ /* */ /*************************************************************************/ #ifndef __OTVERROR_H__ #define __OTVERROR_H__ #include FT_MODULE_ERRORS_H #undef __FTERRORS_H__ #define FT_ERR_PREFIX OTV_Err_ #define FT_ERR_BASE FT_Mod_Err_OTvalid #define FT_KEEP_ERR_PREFIX #include FT_ERRORS_H #endif /* __OTVERROR_H__ */ /* END */ --- NEW FILE: otvalid.h --- /***************************************************************************/ /* */ /* otvalid.h */ /* */ /* OpenType table validation (specification only). */ /* */ /* Copyright 2004 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __OTVALID_H__ #define __OTVALID_H__ #include <ft2build.h> #include FT_FREETYPE_H #include "otverror.h" /* must come before FT_INTERNAL_VALIDATE_H */ #include FT_INTERNAL_VALIDATE_H #include FT_INTERNAL_STREAM_H FT_BEGIN_HEADER FT_LOCAL( void ) otv_BASE_validate( FT_Bytes table, FT_Validator valid ); /* GSUB and GPOS tables should already be validated; */ /* if missing, set corresponding argument to 0 */ FT_LOCAL( void ) otv_GDEF_validate( FT_Bytes table, FT_Bytes gsub, FT_Bytes gpos, FT_Validator valid ); FT_LOCAL( void ) otv_GPOS_validate( FT_Bytes table, FT_UInt glyph_count, FT_Validator valid ); FT_LOCAL( void ) otv_GSUB_validate( FT_Bytes table, FT_UInt glyph_count, FT_Validator valid ); /* GSUB and GPOS tables should already be validated; */ /* if missing, set corresponding argument to 0 */ FT_LOCAL( void ) otv_JSTF_validate( FT_Bytes table, FT_Bytes gsub, FT_Bytes gpos, FT_UInt glyph_count, FT_Validator valid ); FT_END_HEADER #endif /* __OTVALID_H__ */ /* END */ --- NEW FILE: otvgpos.h --- /***************************************************************************/ /* */ /* otvgpos.h */ /* */ /* OpenType GPOS table validator (specification). */ /* */ /* Copyright 2004 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __OTVGPOS_H__ #define __OTVGPOS_H__ FT_BEGIN_HEADER FT_LOCAL( void ) otv_GPOS_subtable_validate( FT_Bytes table, OTV_Validator valid ); FT_END_HEADER #endif /* __OTVGPOS_H__ */ /* END */ |
From: Ehud S. <esh...@us...> - 2006-04-21 16:31:22
|
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/psnames In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28321/src/psnames Added Files: Jamfile module.mk psmodule.h psnamerr.h pstables.h rules.mk Log Message: Import freetype sources. --- NEW FILE: rules.mk --- # # FreeType 2 PSNames driver configuration rules # # Copyright 1996-2000, 2001, 2003 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. # PSNames driver directory # PSNAMES_DIR := $(SRC_DIR)/psnames # compilation flags for the driver # PSNAMES_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR)) # PSNames driver sources (i.e., C files) # PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c # PSNames driver headers # PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \ $(PSNAMES_DIR)/pstables.h \ $(PSNAMES_DIR)/psnamerr.h # PSNames driver object(s) # # PSNAMES_DRV_OBJ_M is used during `multi' builds # PSNAMES_DRV_OBJ_S is used during `single' builds # PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR)/%.c=$(OBJ_DIR)/%.$O) PSNAMES_DRV_OBJ_S := $(OBJ_DIR)/psnames.$O # PSNames driver source file for single build # PSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psmodule.c # PSNames driver - single object # $(PSNAMES_DRV_OBJ_S): $(PSNAMES_DRV_SRC_S) $(PSNAMES_DRV_SRC) \ $(FREETYPE_H) $(PSNAMES_DRV_H) $(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSNAMES_DRV_SRC_S)) # PSNames driver - multiple objects # $(OBJ_DIR)/%.$O: $(PSNAMES_DIR)/%.c $(FREETYPE_H) $(PSNAMES_DRV_H) $(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) # update main driver object lists # DRV_OBJS_S += $(PSNAMES_DRV_OBJ_S) DRV_OBJS_M += $(PSNAMES_DRV_OBJ_M) # EOF --- NEW FILE: Jamfile --- # FreeType 2 src/psnames Jamfile # # Copyright 2001 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. SubDir FT2_TOP $(FT2_SRC_DIR) psnames ; { local _sources ; if $(FT2_MULTI) { _sources = psmodule ; } else { _sources = psnames ; } Library $(FT2_LIB) : $(_sources).c ; } # end of src/psnames Jamfile --- NEW FILE: module.mk --- # # FreeType 2 PSnames module definition # # Copyright 1996-2000 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. make_module_list: add_psnames_module add_psnames_module: $(OPEN_DRIVER)psnames_module_class$(CLOSE_DRIVER) $(ECHO_DRIVER)psnames $(ECHO_DRIVER_DESC)Postscript & Unicode Glyph name handling$(ECHO_DRIVER_DONE) # EOF --- NEW FILE: pstables.h --- /***************************************************************************/ /* */ /* pstables.h */ /* */ /* PostScript glyph names. */ /* */ /* Copyright 2005 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /* This file has been generated automatically -- do not edit! */ [...4051 lines suppressed...] const unsigned char* q = ft_adobe_glyph_list + offset; if ( c == ( q[0] & 127 ) ) { p = q; goto NextIter; } } goto NotFound; NextIter: ; } NotFound: return 0; } /* END */ --- NEW FILE: psnamerr.h --- /***************************************************************************/ /* */ /* psnamerr.h */ /* */ /* PS names module error codes (specification only). */ /* */ /* Copyright 2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file is used to define the PS names module error enumeration */ /* constants. */ /* */ /*************************************************************************/ #ifndef __PSNAMERR_H__ #define __PSNAMERR_H__ #include FT_MODULE_ERRORS_H #undef __FTERRORS_H__ #define FT_ERR_PREFIX PSnames_Err_ #define FT_ERR_BASE FT_Mod_Err_PSnames #include FT_ERRORS_H #endif /* __PSNAMERR_H__ */ /* END */ --- NEW FILE: psmodule.h --- /***************************************************************************/ /* */ /* psmodule.h */ /* */ /* High-level PSNames module interface (specification). */ /* */ /* Copyright 1996-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __PSMODULE_H__ #define __PSMODULE_H__ #include <ft2build.h> #include FT_MODULE_H FT_BEGIN_HEADER FT_EXPORT_VAR( const FT_Module_Class ) psnames_module_class; FT_END_HEADER #endif /* __PSMODULE_H__ */ /* END */ |
From: Ehud S. <esh...@us...> - 2006-04-21 16:31:21
|
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/lzw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28321/src/lzw Added Files: Jamfile rules.mk zopen.h Log Message: Import freetype sources. --- NEW FILE: rules.mk --- # # FreeType 2 LZW support configuration rules # # Copyright 2004 by # Albert Chin-A-Young. # # Based on src/lzw/rules.mk, Copyright 2002 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. # LZW driver directory # LZW_DIR := $(SRC_DIR)/lzw # compilation flags for the driver # LZW_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(LZW_DIR)) # LZW support sources (i.e., C files) # LZW_DRV_SRC := $(LZW_DIR)/ftlzw.c \ $(LZW_DIR)/zopen.c # LZW support headers # LZW_DRV_H := $(LZW_DIR)/zopen.h # LZW driver object(s) # # LZW_DRV_OBJ_M is used during `multi' builds # LZW_DRV_OBJ_S is used during `single' builds # LZW_DRV_OBJ_M := $(OBJ_DIR)/ftlzw.$O LZW_DRV_OBJ_S := $(OBJ_DIR)/ftlzw.$O # LZW support source file for single build # LZW_DRV_SRC_S := $(LZW_DIR)/ftlzw.c # LZW support - single object # $(LZW_DRV_OBJ_S): $(LZW_DRV_SRC_S) $(LZW_DRV_SRC) $(FREETYPE_H) $(LZW_DRV_H) $(LZW_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(LZW_DRV_SRC_S)) # LZW support - multiple objects # $(OBJ_DIR)/%.$O: $(LZW_DIR)/%.c $(FREETYPE_H) $(LZW_DRV_H) $(LZW_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) # update main driver object lists # DRV_OBJS_S += $(LZW_DRV_OBJ_S) DRV_OBJS_M += $(LZW_DRV_OBJ_M) # EOF --- NEW FILE: Jamfile --- # FreeType 2 src/lzw Jamfile # # Copyright 2004 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. SubDir FT2_TOP $(FT2_SRC_DIR) lzw ; Library $(FT2_LIB) : ftlzw.c ; # end of src/lzw Jamfile --- NEW FILE: zopen.h --- /* $NetBSD: zopen.c,v 1.8 2003/08/07 11:13:29 agc Exp $ */ /*- * Copyright (c) 1985, 1986, 1992, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Diomidis Spinellis and James A. Woods, derived from original * work by Spencer Thomas and Joseph Orost. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /*- * * Copyright (c) 2004 * Albert Chin-A-Young. * * Modified to work with FreeType's PCF driver. * */ #if defined(LIBC_SCCS) && !defined(lint) #if 0 static char sccsid[] = "@(#)zopen.c 8.1 (Berkeley) 6/27/93"; #else static char rcsid[] = "$NetBSD: zopen.c,v 1.8 2003/08/07 11:13:29 agc Exp $"; #endif #endif /* LIBC_SCCS and not lint */ #include <stdio.h> #define BITS 16 /* Default bits. */ #define HSIZE 69001 /* 95% occupancy */ /* A code_int must be able to hold 2**BITS values of type int, and also -1. */ typedef long code_int; typedef long count_int; typedef unsigned char char_type; typedef enum { S_START, S_MIDDLE, S_EOF } zs_enum; typedef struct { unsigned char *next_in; unsigned int avail_in; unsigned long total_in; unsigned char *next_out; unsigned int avail_out; unsigned long total_out; zs_enum zs_state; /* State of computation */ int zs_n_bits; /* Number of bits/code. */ int zs_maxbits; /* User settable max # bits/code. */ code_int zs_maxcode; /* Maximum code, given n_bits. */ code_int zs_maxmaxcode; /* Should NEVER generate this code. */ count_int zs_htab [HSIZE]; unsigned short zs_codetab [HSIZE]; code_int zs_hsize; /* For dynamic table sizing. */ code_int zs_free_ent; /* First unused entry. */ /* * Block compression parameters -- after all codes are used up, * and compression rate changes, start over. */ int zs_block_compress; int zs_clear_flg; int zs_offset; long zs_in_count; /* Remaining uncompressed bytes. */ char_type zs_buf_len; char_type zs_buf[BITS]; /* Temporary buffer if we need to read more to accumulate n_bits. */ union { struct { char_type *zs_stackp; int zs_finchar; code_int zs_code, zs_oldcode, zs_incode; int zs_roffset, zs_size; char_type zs_gbuf[BITS]; } r; /* Read parameters */ } u; } s_zstate_t; static code_int getcode(s_zstate_t *); #if 0 static int zclose(s_zstate_t *); #endif static void zinit(s_zstate_t *); static int zread(s_zstate_t *); |
From: Ehud S. <esh...@us...> - 2006-04-21 16:31:20
|
Update of /cvsroot/roadmap/roadmap_editor/src/freetype/src/pfr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28321/src/pfr Added Files: Jamfile module.mk pfrcmap.h pfrdrivr.h pfrerror.h pfrgload.h pfrload.h pfrobjs.h pfrsbit.h pfrtypes.h rules.mk Log Message: Import freetype sources. --- NEW FILE: rules.mk --- # # FreeType 2 PFR driver configuration rules # # Copyright 2002, 2003 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. # pfr driver directory # PFR_DIR := $(SRC_DIR)/pfr # compilation flags for the driver # PFR_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PFR_DIR)) # pfr driver sources (i.e., C files) # PFR_DRV_SRC := $(PFR_DIR)/pfrload.c \ $(PFR_DIR)/pfrgload.c \ $(PFR_DIR)/pfrcmap.c \ $(PFR_DIR)/pfrdrivr.c \ $(PFR_DIR)/pfrsbit.c \ $(PFR_DIR)/pfrobjs.c # pfr driver headers # PFR_DRV_H := $(PFR_DRV_SRC:%.c=%.h) \ $(PFR_DIR)/pfrerror.h \ $(PFR_DIR)/pfrtypes.h # Pfr driver object(s) # # PFR_DRV_OBJ_M is used during `multi' builds # PFR_DRV_OBJ_S is used during `single' builds # PFR_DRV_OBJ_M := $(PFR_DRV_SRC:$(PFR_DIR)/%.c=$(OBJ_DIR)/%.$O) PFR_DRV_OBJ_S := $(OBJ_DIR)/pfr.$O # pfr driver source file for single build # PFR_DRV_SRC_S := $(PFR_DIR)/pfr.c # pfr driver - single object # $(PFR_DRV_OBJ_S): $(PFR_DRV_SRC_S) $(PFR_DRV_SRC) $(FREETYPE_H) $(PFR_DRV_H) $(PFR_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PFR_DRV_SRC_S)) # pfr driver - multiple objects # $(OBJ_DIR)/%.$O: $(PFR_DIR)/%.c $(FREETYPE_H) $(PFR_DRV_H) $(PFR_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) # update main driver object lists # DRV_OBJS_S += $(PFR_DRV_OBJ_S) DRV_OBJS_M += $(PFR_DRV_OBJ_M) # EOF --- NEW FILE: Jamfile --- # FreeType 2 src/pfr Jamfile # # Copyright 2002 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. SubDir FT2_TOP $(FT2_SRC_DIR) pfr ; { local _sources ; if $(FT2_MULTI) { _sources = pfrdrivr pfrgload pfrload pfrobjs pfrcmap pfrsbit ; } else { _sources = pfr ; } Library $(FT2_LIB) : $(_sources).c ; } # end of src/pfr Jamfile --- NEW FILE: pfrobjs.h --- /***************************************************************************/ /* */ /* pfrobjs.h */ /* */ /* FreeType PFR object methods (specification). */ /* */ /* Copyright 2002, 2003, 2004 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __PFROBJS_H__ #define __PFROBJS_H__ #include "pfrtypes.h" FT_BEGIN_HEADER typedef struct PFR_FaceRec_* PFR_Face; typedef struct PFR_SizeRec_* PFR_Size; typedef struct PFR_SlotRec_* PFR_Slot; typedef struct PFR_FaceRec_ { FT_FaceRec root; PFR_HeaderRec header; PFR_LogFontRec log_font; PFR_PhyFontRec phy_font; } PFR_FaceRec; typedef struct PFR_SizeRec_ { FT_SizeRec root; } PFR_SizeRec; typedef struct PFR_SlotRec_ { FT_GlyphSlotRec root; PFR_GlyphRec glyph; } PFR_SlotRec; FT_LOCAL( FT_Error ) pfr_face_init( FT_Stream stream, FT_Face face, /* PFR_Face */ FT_Int face_index, FT_Int num_params, FT_Parameter* params ); FT_LOCAL( void ) pfr_face_done( FT_Face face ); /* PFR_Face */ FT_LOCAL( FT_Error ) pfr_face_get_kerning( FT_Face face, /* PFR_Face */ FT_UInt glyph1, FT_UInt glyph2, FT_Vector* kerning ); FT_LOCAL( FT_Error ) pfr_slot_init( FT_GlyphSlot slot ); /* PFR_Slot */ FT_LOCAL( void ) pfr_slot_done( FT_GlyphSlot slot ); /* PFR_Slot */ FT_LOCAL( FT_Error ) pfr_slot_load( FT_GlyphSlot slot, /* PFR_Slot */ FT_Size size, /* PFR_Size */ FT_UInt gindex, FT_Int32 load_flags ); FT_END_HEADER #endif /* __PFROBJS_H__ */ /* END */ --- NEW FILE: pfrgload.h --- /***************************************************************************/ /* */ /* pfrgload.h */ /* */ /* FreeType PFR glyph loader (specification). */ /* */ /* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __PFRGLOAD_H__ #define __PFRGLOAD_H__ #include "pfrtypes.h" FT_BEGIN_HEADER FT_LOCAL( void ) pfr_glyph_init( PFR_Glyph glyph, FT_GlyphLoader loader ); FT_LOCAL( void ) pfr_glyph_done( PFR_Glyph glyph ); FT_LOCAL( FT_Error ) pfr_glyph_load( PFR_Glyph glyph, FT_Stream stream, FT_ULong gps_offset, FT_ULong offset, FT_ULong size ); FT_END_HEADER #endif /* __PFRGLOAD_H__ */ /* END */ --- NEW FILE: pfrdrivr.h --- /***************************************************************************/ /* */ /* pfrdrivr.h */ /* */ /* High-level Type PFR driver interface (specification). */ /* */ /* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __PFRDRIVR_H__ #define __PFRDRIVR_H__ #include <ft2build.h> #include FT_INTERNAL_DRIVER_H FT_BEGIN_HEADER FT_EXPORT_VAR( const FT_Driver_ClassRec ) pfr_driver_class; FT_END_HEADER #endif /* __PFRDRIVR_H__ */ /* END */ --- NEW FILE: pfrtypes.h --- /***************************************************************************/ /* */ /* pfrtypes.h */ /* */ /* FreeType PFR data structures (specification only). */ /* */ /* Copyright 2002, 2003, 2005 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __PFRTYPES_H__ #define __PFRTYPES_H__ #include <ft2build.h> #include FT_INTERNAL_OBJECTS_H FT_BEGIN_HEADER /************************************************************************/ /* the PFR Header structure */ typedef struct PFR_HeaderRec_ { FT_UInt32 signature; FT_UInt version; FT_UInt signature2; FT_UInt header_size; FT_UInt log_dir_size; FT_UInt log_dir_offset; FT_UInt log_font_max_size; FT_UInt32 log_font_section_size; FT_UInt32 log_font_section_offset; FT_UInt32 phy_font_max_size; FT_UInt32 phy_font_section_size; FT_UInt32 phy_font_section_offset; FT_UInt gps_max_size; FT_UInt32 gps_section_size; FT_UInt32 gps_section_offset; FT_UInt max_blue_values; FT_UInt max_x_orus; FT_UInt max_y_orus; FT_UInt phy_font_max_size_high; FT_UInt color_flags; FT_UInt32 bct_max_size; FT_UInt32 bct_set_max_size; FT_UInt32 phy_bct_set_max_size; FT_UInt num_phy_fonts; FT_UInt max_vert_stem_snap; FT_UInt max_horz_stem_snap; FT_UInt max_chars; } PFR_HeaderRec, *PFR_Header; /* used in `color_flags' field of the PFR_Header */ typedef enum PFR_HeaderFlags_ { PFR_FLAG_BLACK_PIXEL = 1, PFR_FLAG_INVERT_BITMAP = 2 } PFR_HeaderFlags; /************************************************************************/ typedef struct PFR_LogFontRec_ { FT_UInt32 size; FT_UInt32 offset; FT_Int32 matrix[4]; FT_UInt stroke_flags; FT_Int stroke_thickness; FT_Int bold_thickness; FT_Int32 miter_limit; FT_UInt32 phys_size; FT_UInt32 phys_offset; } PFR_LogFontRec, *PFR_LogFont; typedef enum PFR_LogFlags_ { PFR_LOG_EXTRA_ITEMS = 0x40, PFR_LOG_2BYTE_BOLD = 0x20, PFR_LOG_BOLD = 0x10, PFR_LOG_2BYTE_STROKE = 8, PFR_LOG_STROKE = 4, PFR_LINE_JOIN_MASK = 3 } PFR_LogFlags; typedef enum PFR_LineJoinFlags_ { PFR_LINE_JOIN_MITER = 0, PFR_LINE_JOIN_ROUND = 1, PFR_LINE_JOIN_BEVEL = 2 } PFR_LineJoinFlags; /************************************************************************/ typedef enum PFR_BitmapFlags_ { PFR_BITMAP_3BYTE_OFFSET = 4, PFR_BITMAP_2BYTE_SIZE = 2, PFR_BITMAP_2BYTE_CHARCODE = 1 } PFR_BitmapFlags; typedef struct PFR_BitmapCharRec_ { FT_UInt char_code; FT_UInt gps_size; FT_UInt32 gps_offset; } PFR_BitmapCharRec, *PFR_BitmapChar; typedef enum PFR_StrikeFlags_ { PFR_STRIKE_2BYTE_COUNT = 0x10, PFR_STRIKE_3BYTE_OFFSET = 0x08, PFR_STRIKE_3BYTE_SIZE = 0x04, PFR_STRIKE_2BYTE_YPPM = 0x02, PFR_STRIKE_2BYTE_XPPM = 0x01 } PFR_StrikeFlags; typedef struct PFR_StrikeRec_ { FT_UInt x_ppm; FT_UInt y_ppm; FT_UInt flags; FT_UInt32 gps_size; FT_UInt32 gps_offset; FT_UInt32 bct_size; FT_UInt32 bct_offset; /* optional */ FT_UInt num_bitmaps; PFR_BitmapChar bitmaps; } PFR_StrikeRec, *PFR_Strike; /************************************************************************/ typedef struct PFR_CharRec_ { FT_UInt char_code; FT_Int advance; FT_UInt gps_size; FT_UInt32 gps_offset; } PFR_CharRec, *PFR_Char; /************************************************************************/ typedef struct PFR_DimensionRec_ { FT_UInt standard; FT_UInt num_stem_snaps; FT_Int* stem_snaps; } PFR_DimensionRec, *PFR_Dimension; /************************************************************************/ typedef struct PFR_KernItemRec_* PFR_KernItem; typedef struct PFR_KernItemRec_ { PFR_KernItem next; FT_Byte pair_count; FT_Byte flags; FT_Short base_adj; FT_UInt pair_size; FT_UInt32 offset; FT_UInt32 pair1; FT_UInt32 pair2; } PFR_KernItemRec; #define PFR_KERN_INDEX( g1, g2 ) \ ( ( (FT_UInt32)(g1) << 16 ) | (FT_UInt16)(g2) ) #define PFR_KERN_PAIR_INDEX( pair ) \ PFR_KERN_INDEX( (pair)->glyph1, (pair)->glyph2 ) #define PFR_NEXT_KPAIR( p ) ( p += 2, \ ( (FT_UInt32)p[-2] << 16 ) | p[-1] ) typedef struct PFR_KernPairRec_ { FT_UInt glyph1; FT_UInt glyph2; FT_Int kerning; } PFR_KernPairRec, *PFR_KernPair; /************************************************************************/ typedef struct PFR_PhyFontRec_ { FT_Memory memory; FT_UInt32 offset; FT_UInt font_ref_number; FT_UInt outline_resolution; FT_UInt metrics_resolution; FT_BBox bbox; FT_UInt flags; FT_UInt standard_advance; FT_Int ascent; /* optional, bbox.yMax if not present */ FT_Int descent; /* optional, bbox.yMin if not present */ FT_Int leading; /* optional, 0 if not present */ PFR_DimensionRec horizontal; PFR_DimensionRec vertical; FT_String* font_id; FT_String* family_name; FT_String* style_name; FT_UInt num_strikes; FT_UInt max_strikes; PFR_StrikeRec* strikes; FT_UInt num_blue_values; FT_Int *blue_values; FT_UInt blue_fuzz; FT_UInt blue_scale; FT_UInt num_chars; FT_UInt32 chars_offset; PFR_Char chars; FT_UInt num_kern_pairs; PFR_KernItem kern_items; PFR_KernItem* kern_items_tail; #ifndef FT_OPTIMIZE_MEMORY PFR_KernPair kern_pairs; #endif /* not part of the spec, but used during load */ FT_UInt32 bct_offset; FT_Byte* cursor; } PFR_PhyFontRec, *PFR_PhyFont; typedef enum PFR_PhyFlags_ { PFR_PHY_EXTRA_ITEMS = 0x80, PFR_PHY_3BYTE_GPS_OFFSET = 0x20, PFR_PHY_2BYTE_GPS_SIZE = 0x10, PFR_PHY_ASCII_CODE = 0x08, PFR_PHY_PROPORTIONAL = 0x04, PFR_PHY_2BYTE_CHARCODE = 0x02, PFR_PHY_VERTICAL = 0x01 } PFR_PhyFlags; typedef enum PFR_KernFlags_ { PFR_KERN_2BYTE_CHAR = 0x01, PFR_KERN_2BYTE_ADJ = 0x02 } PFR_KernFlags; /************************************************************************/ typedef enum PFR_GlyphFlags_ { PFR_GLYPH_IS_COMPOUND = 0x80, PFR_GLYPH_EXTRA_ITEMS = 0x08, PFR_GLYPH_1BYTE_XYCOUNT = 0x04, PFR_GLYPH_XCOUNT = 0x02, PFR_GLYPH_YCOUNT = 0x01 } PFR_GlyphFlags; /* controlled coordinate */ typedef struct PFR_CoordRec_ { FT_UInt org; FT_UInt cur; } PFR_CoordRec, *PFR_Coord; typedef struct PFR_SubGlyphRec_ { FT_Fixed x_scale; FT_Fixed y_scale; FT_Int x_delta; FT_Int y_delta; FT_UInt32 gps_offset; FT_UInt gps_size; } PFR_SubGlyphRec, *PFR_SubGlyph; typedef enum PFR_SubgGlyphFlags_ { PFR_SUBGLYPH_3BYTE_OFFSET = 0x80, PFR_SUBGLYPH_2BYTE_SIZE = 0x40, PFR_SUBGLYPH_YSCALE = 0x20, PFR_SUBGLYPH_XSCALE = 0x10 } PFR_SubGlyphFlags; typedef struct PFR_GlyphRec_ { FT_Byte format; FT_UInt num_x_control; FT_UInt num_y_control; FT_UInt max_xy_control; FT_Pos* x_control; FT_Pos* y_control; FT_UInt num_subs; FT_UInt max_subs; PFR_SubGlyphRec* subs; FT_GlyphLoader loader; FT_Bool path_begun; } PFR_GlyphRec, *PFR_Glyph; FT_END_HEADER #endif /* __PFRTYPES_H__ */ /* END */ --- NEW FILE: pfrcmap.h --- /***************************************************************************/ /* */ /* pfrcmap.h */ /* */ /* FreeType PFR cmap handling (specification). */ /* */ /* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __PFRCMAP_H__ #define __PFRCMAP_H__ #include <ft2build.h> #include FT_INTERNAL_OBJECTS_H #include "pfrtypes.h" FT_BEGIN_HEADER typedef struct PFR_CMapRec_ { FT_CMapRec cmap; FT_UInt num_chars; PFR_Char chars; } PFR_CMapRec, *PFR_CMap; FT_CALLBACK_TABLE const FT_CMap_ClassRec pfr_cmap_class_rec; FT_END_HEADER #endif /* __PFRCMAP_H__ */ /* END */ --- NEW FILE: pfrload.h --- /***************************************************************************/ /* */ /* pfrload.h */ /* */ /* FreeType PFR loader (specification). */ /* */ /* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __PFRLOAD_H__ #define __PFRLOAD_H__ #include "pfrobjs.h" #include FT_INTERNAL_STREAM_H FT_BEGIN_HEADER #ifdef PFR_CONFIG_NO_CHECKS #define PFR_CHECK( x ) do { } while ( 0 ) #else #define PFR_CHECK( x ) do \ { \ if ( p + (x) > limit ) \ goto Too_Short; \ } while ( 0 ) #endif #define PFR_NEXT_BYTE( p ) FT_NEXT_BYTE( p ) #define PFR_NEXT_INT8( p ) FT_NEXT_CHAR( p ) #define PFR_NEXT_SHORT( p ) FT_NEXT_SHORT( p ) #define PFR_NEXT_USHORT( p ) FT_NEXT_USHORT( p ) #define PFR_NEXT_LONG( p ) FT_NEXT_OFF3( p ) #define PFR_NEXT_ULONG( p ) FT_NEXT_UOFF3( p ) /* handling extra items */ typedef FT_Error (*PFR_ExtraItem_ParseFunc)( FT_Byte* p, FT_Byte* limit, FT_Pointer data ); typedef struct PFR_ExtraItemRec_ { FT_UInt type; PFR_ExtraItem_ParseFunc parser; } PFR_ExtraItemRec; typedef const struct PFR_ExtraItemRec_* PFR_ExtraItem; FT_LOCAL( FT_Error ) pfr_extra_items_skip( FT_Byte* *pp, FT_Byte* limit ); FT_LOCAL( FT_Error ) pfr_extra_items_parse( FT_Byte* *pp, FT_Byte* limit, PFR_ExtraItem item_list, FT_Pointer item_data ); /* load a PFR header */ FT_LOCAL( FT_Error ) pfr_header_load( PFR_Header header, FT_Stream stream ); /* check a PFR header */ FT_LOCAL( FT_Bool ) pfr_header_check( PFR_Header header ); /* return number of logical fonts in this file */ FT_LOCAL( FT_Error ) pfr_log_font_count( FT_Stream stream, FT_UInt32 log_section_offset, FT_UInt *acount ); /* load a pfr logical font entry */ FT_LOCAL( FT_Error ) pfr_log_font_load( PFR_LogFont log_font, FT_Stream stream, FT_UInt face_index, FT_UInt32 section_offset, FT_Bool size_increment ); /* load a physical font entry */ FT_LOCAL( FT_Error ) pfr_phy_font_load( PFR_PhyFont phy_font, FT_Stream stream, FT_UInt32 offset, FT_UInt32 size ); /* finalize a physical font */ FT_LOCAL( void ) pfr_phy_font_done( PFR_PhyFont phy_font, FT_Memory memory ); /* */ FT_END_HEADER #endif /* __PFRLOAD_H__ */ /* END */ --- NEW FILE: pfrerror.h --- /***************************************************************************/ /* */ /* pfrerror.h */ /* */ /* PFR error codes (specification only). */ /* */ /* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file is used to define the PFR error enumeration constants. */ /* */ /*************************************************************************/ #ifndef __PFRERROR_H__ #define __PFRERROR_H__ #include FT_MODULE_ERRORS_H #undef __FTERRORS_H__ #define FT_ERR_PREFIX PFR_Err_ #define FT_ERR_BASE FT_Mod_Err_PFR #include FT_ERRORS_H #endif /* __PFRERROR_H__ */ /* END */ --- NEW FILE: module.mk --- # # FreeType 2 PFR module definition # # Copyright 2002 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to use, modify, or distribute this file you # indicate that you have read the license and understand and accept it # fully. make_module_list: add_pfr_driver add_pfr_driver: $(OPEN_DRIVER)pfr_driver_class$(CLOSE_DRIVER) $(ECHO_DRIVER)pfr $(ECHO_DRIVER_DESC)PFR/TrueDoc font files with extension *.pfr$(ECHO_DRIVER_DONE) # EOF --- NEW FILE: pfrsbit.h --- /***************************************************************************/ /* */ /* pfrsbit.h */ /* */ /* FreeType PFR bitmap loader (specification). */ /* */ /* Copyright 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __PFRSBIT_H__ #define __PFRSBIT_H__ #include "pfrobjs.h" FT_BEGIN_HEADER FT_LOCAL( FT_Error ) pfr_slot_load_bitmap( PFR_Slot glyph, PFR_Size size, FT_UInt glyph_index ); FT_END_HEADER #endif /* __PFR_SBIT_H__ */ /* END */ |