summaryrefslogtreecommitdiff
path: root/Build/source/texk/ttfdump/libttf/font.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/font.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/font.c')
-rw-r--r--Build/source/texk/ttfdump/libttf/font.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/Build/source/texk/ttfdump/libttf/font.c b/Build/source/texk/ttfdump/libttf/font.c
index c8b3784a6eb..0ee6c25ec02 100644
--- a/Build/source/texk/ttfdump/libttf/font.c
+++ b/Build/source/texk/ttfdump/libttf/font.c
@@ -9,23 +9,15 @@
#include "ttfutil.h"
#include "protos.h"
-#ifdef MEMCHECK
-#include <dmalloc.h>
-#endif
-
/* $Id: font.c,v 1.1.1.1 1998/06/05 07:47:52 robert Exp $ */
-#ifndef lint
-static char vcid[] = "$Id: font.c,v 1.1.1.1 1998/06/05 07:47:52 robert Exp $";
-#endif /* lint */
-
static void ttfInitInterpreter(TTFontPtr font);
TTFontPtr ttfInitFont(char *filename)
{
TTFontPtr font;
- font = (TTFontPtr) calloc(1,sizeof(TTFont));
+ font = XCALLOC1 (TTFont);
font->ttfname = filename;
if ((font->fp = fopen (filename,"r")) == NULL)
@@ -40,8 +32,7 @@ TTFontPtr ttfInitFont(char *filename)
}
void ttfLoadFont(TTFontPtr font, ULONG offset)
{
- if (fseek(font->fp,offset,SEEK_SET) != 0)
- ttfError("Fseek Failed\n");
+ xfseek(font->fp, offset, SEEK_SET, "ttfLoadFont");
/* offset table */
font->version = ttfGetFixed(font->fp);
@@ -55,7 +46,7 @@ void ttfLoadFont(TTFontPtr font, ULONG offset)
ttfInitInterpreter(font);
/* initialize the reference count to 1 */
- font->refcount = (int *) calloc(1, sizeof(int));
+ font->refcount = XCALLOC1 (int);
*(font->refcount) = 1;
}
void ttfFreeFont(TTFontPtr font)
@@ -147,7 +138,7 @@ TTFontPtr ttfCloneFont(TTFontPtr font)
{
TTFontPtr newfont;
- newfont = (TTFontPtr) calloc(1,sizeof(TTFont));
+ newfont = XTALLOC1 (TTFont);
memcpy(newfont, font, sizeof(TTFont));
newfont->refcount += 1;