diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-11-08 16:53:46 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-11-08 16:53:46 +0000 |
commit | 8b70788fa0333ae44b46195dd78f8614438443c9 (patch) | |
tree | 467400baaaeaf8b4ffffc650c4414c208ab11ac4 /Build/source/texk/ttfdump/include | |
parent | 35d16fdfd460a826228374bc74b0d68c7923e112 (diff) |
ttfdump: Major update (see ChangeLog for details)
git-svn-id: svn://tug.org/texlive/trunk@24546 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ttfdump/include')
-rw-r--r-- | Build/source/texk/ttfdump/include/ttf.h | 25 | ||||
-rw-r--r-- | Build/source/texk/ttfdump/include/ttfutil.h | 21 |
2 files changed, 33 insertions, 13 deletions
diff --git a/Build/source/texk/ttfdump/include/ttf.h b/Build/source/texk/ttfdump/include/ttf.h index 8658345874b..dd226235b23 100644 --- a/Build/source/texk/ttfdump/include/ttf.h +++ b/Build/source/texk/ttfdump/include/ttf.h @@ -23,16 +23,12 @@ typedef signed short SHORT; #if SIZEOF_INT==4 typedef unsigned int ULONG; typedef signed int LONG; -typedef ULONG Fixed; /* 16.16 fixed point number used for - * version information */ +#else +#error "Unsupported size of `int' type!" +#endif -#elif SIZEOF_LONG==4 -typedef unsigned long ULONG; -typedef signed long LONG; typedef ULONG Fixed; /* 16.16 fixed point number used for * version information */ -#endif - typedef USHORT FUnit; typedef SHORT FWord; /* pixel position in the unit of FUnit */ typedef USHORT uFWord; @@ -44,7 +40,7 @@ typedef LONG F26Dot6; /* 26.6 fixed point number to specify BYTE ttfGetBYTE(FILE *fp); CHAR ttfGetCHAR(FILE *fp); USHORT ttfGetUSHORT(FILE *fp); -USHORT ttfGetSHORT(FILE *fp); +SHORT ttfGetSHORT(FILE *fp); ULONG ttfGetULONG(FILE *fp); LONG ttfGetLONG(FILE *fp); Fixed ttfGetFixed(FILE *fp); @@ -53,8 +49,17 @@ FWord ttfGetFWord(FILE *fp); uFWord ttfGetuFWord(FILE *fp); F2Dot14 ttfGetF2Dot14(FILE *fp); -short ttfGetLSB16(FILE *fp); -int ttfGetLSB32(FILE *fp); +/* Read arrays. */ +void ttfReadUSHORT(USHORT *array, size_t nelem, FILE *fp); +void ttfReadULONG(ULONG *array, size_t nelem, FILE *fp); +void ttfReadFWord(FWord *array, size_t nelem, FILE *fp); + +/* Allocate and read arrays. */ +BYTE *ttfMakeBYTE(size_t nelem, FILE *fp); +USHORT *ttfMakeUSHORT(size_t nelem, FILE *fp); +SHORT *ttfMakeSHORT(size_t nelem, FILE *fp); +ULONG *ttfMakeULONG(size_t nelem, FILE *fp); +LONG *ttfMakeLONG(size_t nelem, FILE *fp); #include "tables.h" #include "gcache.h" diff --git a/Build/source/texk/ttfdump/include/ttfutil.h b/Build/source/texk/ttfdump/include/ttfutil.h index 17cd47e5575..e660bfce5fa 100644 --- a/Build/source/texk/ttfdump/include/ttfutil.h +++ b/Build/source/texk/ttfdump/include/ttfutil.h @@ -5,11 +5,26 @@ /* $Id: ttfutil.h,v 1.2 1998/07/06 06:07:01 werner Exp $ */ +#if !defined(EXIT_FAILURE) +#define EXIT_FAILURE 1 +#endif + void FixedSplit(Fixed f, int b[]); -void TwoByteSwap(unsigned char *buf, int nbytes); -void FourByteSwap(unsigned char *buf, int nbytes); -void FourByteSwap(unsigned char *buf, int nbytes); void ttfError(const char *msg); +#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) _x1 << 24 | _x2 << 16 | _x3 << 8 | _x4 +char *TagToStr(ULONG tag); + +/* Functions copied or adapted from kpathsea. */ +void xfseek (FILE *fp, long offset, int wherefrom, const char *funcname); +void *xmalloc (size_t size); +void *xcalloc (size_t nelem, size_t elsize); +char *xstrdup(const char *s); + +#define FATAL_PERROR(str) do { perror (str); exit (EXIT_FAILURE); } while (0) +#define XTALLOC(n, t) ((t *) xmalloc ((n) * sizeof (t))) +#define XCALLOC(n, t) ((t *) xcalloc (n, sizeof (t))) +#define XTALLOC1(t) XTALLOC (1, t) +#define XCALLOC1(t) XCALLOC (1, t) #include "protos.h" |