summaryrefslogtreecommitdiff
path: root/Build/source/texk/ttfdump/libttf/cvt.c
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-11-08 16:53:46 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-11-08 16:53:46 +0000
commit8b70788fa0333ae44b46195dd78f8614438443c9 (patch)
tree467400baaaeaf8b4ffffc650c4414c208ab11ac4 /Build/source/texk/ttfdump/libttf/cvt.c
parent35d16fdfd460a826228374bc74b0d68c7923e112 (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/libttf/cvt.c')
-rw-r--r--Build/source/texk/ttfdump/libttf/cvt.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/Build/source/texk/ttfdump/libttf/cvt.c b/Build/source/texk/ttfdump/libttf/cvt.c
index 0e9c2f14782..2621a938e62 100644
--- a/Build/source/texk/ttfdump/libttf/cvt.c
+++ b/Build/source/texk/ttfdump/libttf/cvt.c
@@ -7,42 +7,28 @@
#include "ttf.h"
#include "ttfutil.h"
-#ifdef MEMCHECK
-#include <dmalloc.h>
-#endif
-
/* $Id: cvt.c,v 1.1.1.1 1998/06/05 07:47:52 robert Exp $ */
-#ifndef lint
-static char vcid[] = "$Id: cvt.c,v 1.1.1.1 1998/06/05 07:47:52 robert Exp $";
-#endif /* lint */
static void ttfLoadCVT(FILE *fp,FWord *cvt,USHORT lenght,ULONG offset);
void ttfInitCVT(TTFontPtr font)
{
- ULONG tag = 'c' | 'v' << 8 | 't' << 16 | ' ' << 24;
+ ULONG tag = FT_MAKE_TAG ('c', 'v', 't', ' ');
TableDirPtr ptd;
if ((ptd = ttfLookUpTableDir(tag,font)) != NULL)
{
font->cvtLength = ptd->length / sizeof(FWord);
- font->cvt = (FWord *) calloc(font->cvtLength, sizeof(FWord));
- if (font->cvt != NULL)
- ttfLoadCVT(font->fp,font->cvt,font->cvtLength,ptd->offset);
+ font->cvt = XCALLOC (font->cvtLength, FWord);
+ ttfLoadCVT(font->fp,font->cvt,font->cvtLength,ptd->offset);
}
}
static void ttfLoadCVT(FILE *fp,FWord *cvt,USHORT length,ULONG offset)
{
- if (fseek(fp,offset,SEEK_SET) !=0)
- ttfError("Fseek Failed in ttfLoadCVT \n");
-
- if (fread(cvt, sizeof(FWord), length, fp) != length)
- ttfError("Error when getting CVT\n");
+ xfseek(fp, offset, SEEK_SET, "ttfLoadCVT");
-#ifndef WORDS_BIGENDIAN
- TwoByteSwap((unsigned char *) cvt,length*sizeof(FWord));
-#endif
+ ttfReadFWord (cvt, length, fp);
}
void ttfPrintCVT(FILE *fp, FWord *cvt, USHORT cvtLength)