diff options
author | Karl Berry <karl@freefriends.org> | 2021-02-25 19:22:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-02-25 19:22:25 +0000 |
commit | ad547a6b5986815fda458221149728d9d9ab1d87 (patch) | |
tree | 16296910eb3eca724371474ea9aea3994dc69614 /Build/source/texk/ttfdump/libttf/prep.c | |
parent | 947b43de3dd21d58ccc2ffadefc4441ea1c2a813 (diff) |
restore Build,TODO from r57911
git-svn-id: svn://tug.org/texlive/trunk@57915 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ttfdump/libttf/prep.c')
-rw-r--r-- | Build/source/texk/ttfdump/libttf/prep.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Build/source/texk/ttfdump/libttf/prep.c b/Build/source/texk/ttfdump/libttf/prep.c new file mode 100644 index 00000000000..6408e9ef881 --- /dev/null +++ b/Build/source/texk/ttfdump/libttf/prep.c @@ -0,0 +1,47 @@ +/* prep.c -- Control Value Program + * Copyright (C) 1996 Li-Da Lho, All right reserved + */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdio.h> +#include <stdlib.h> +#include "ttf.h" +#include "ttfutil.h" + +/* $Id: prep.c,v 1.1.1.1 1998/06/05 07:47:52 robert Exp $ */ + +static void ttfLoadPREP(FILE *fp,BYTE *prep,USHORT lenght,ULONG offset); + +void ttfInitPREP(TTFontPtr font) +{ + ULONG tag = FT_MAKE_TAG ('p', 'r', 'e', 'p'); + TableDirPtr ptd; + + if ((ptd = ttfLookUpTableDir(tag,font)) != NULL) + { + font->prepLength = ptd->length; + font->prep = XCALLOC (font->prepLength, BYTE); + ttfLoadPREP(font->fp,font->prep,font->prepLength,ptd->offset); + } +} + +static void ttfLoadPREP(FILE *fp,BYTE *prep,USHORT length,ULONG offset) +{ + xfseek(fp, offset, SEEK_SET, "ttfLoadPREP"); + + if (fread(prep, sizeof(BYTE), length, fp) != length) + ttfError("Error when getting PREP\n"); +} + +void ttfPrintPREP(FILE *fp, BYTE *prep, USHORT length) +{ + ttfPrintInstructions(fp, prep); +} + +void ttfFreePREP(BYTE *prep) +{ + if (prep != NULL) + free(prep); +} |