summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2019-10-15 12:24:12 +0200
committerThomas Deutschmann <whissi@gentoo.org>2020-08-13 11:26:55 +0200
commite088156d5b620e5e639580dacf85c6dc13823c74 (patch)
tree57f5c025e203279944da512166c20bc0521d8ccd /base/ttfinp.c
downloadghostscript-gpl-patches-e088156d5b620e5e639580dacf85c6dc13823c74.tar.gz
ghostscript-gpl-patches-e088156d5b620e5e639580dacf85c6dc13823c74.tar.bz2
ghostscript-gpl-patches-e088156d5b620e5e639580dacf85c6dc13823c74.zip
Import Ghostscript 9.50ghostscript-9.50
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'base/ttfinp.c')
-rw-r--r--base/ttfinp.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/base/ttfinp.c b/base/ttfinp.c
new file mode 100644
index 00000000..0449f279
--- /dev/null
+++ b/base/ttfinp.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2001-2019 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
+ CA 94945, U.S.A., +1(415)492-9861, for further information.
+*/
+
+
+/* A TT font input support. */
+
+#include "ttmisc.h"
+
+#include "ttfoutl.h"
+#include "ttfsfnt.h"
+#include "ttfinp.h"
+
+unsigned char ttfReader__Byte(ttfReader *r)
+{ unsigned char b;
+
+ r->Read(r, &b, 1);
+ return b;
+}
+
+signed char ttfReader__SignedByte(ttfReader *r)
+{ signed char b;
+
+ r->Read(r, &b, 1);
+ return b;
+}
+
+signed short ttfReader__Short(ttfReader *r)
+{ unsigned char buf[2];
+
+ r->Read(r, buf, 2);
+ return ((int16)buf[0] << 8) | (int16)buf[1];
+}
+
+unsigned short ttfReader__UShort(ttfReader *r)
+{ unsigned char buf[2];
+
+ r->Read(r, buf, 2);
+ return ((uint16)buf[0] << 8) | (uint16)buf[1];
+}
+
+unsigned int ttfReader__UInt(ttfReader *r)
+{ unsigned char buf[4];
+
+ r->Read(r, buf, 4);
+ return ((int32)buf[0] << 24) | ((int32)buf[1] << 16) |
+ ((int32)buf[2] << 8) | (int32)buf[3];
+}
+
+signed int ttfReader__Int(ttfReader *r)
+{
+ return (int)ttfReader__UInt(r);
+}