Coverage Report

Created: 2025-06-10 07:15

/src/ghostpdl/base/ttfinp.c
Line
Count
Source (jump to first uncovered line)
1
/* Copyright (C) 2001-2023 Artifex Software, Inc.
2
   All Rights Reserved.
3
4
   This software is provided AS-IS with no warranty, either express or
5
   implied.
6
7
   This software is distributed under license and may not be copied,
8
   modified or distributed except as expressly authorized under the terms
9
   of the license contained in the file LICENSE in this distribution.
10
11
   Refer to licensing information at http://www.artifex.com or contact
12
   Artifex Software, Inc.,  39 Mesa Street, Suite 108A, San Francisco,
13
   CA 94129, USA, for further information.
14
*/
15
16
17
/* A TT font input support. */
18
19
#include "ttmisc.h"
20
21
#include "ttfoutl.h"
22
#include "ttfsfnt.h"
23
#include "ttfinp.h"
24
25
unsigned char ttfReader__Byte(ttfReader *r)
26
1.45M
{   unsigned char b;
27
28
1.45M
    r->Read(r, &b, 1);
29
1.45M
    return b;
30
1.45M
}
31
32
signed char ttfReader__SignedByte(ttfReader *r)
33
700
{   signed char b;
34
35
700
    r->Read(r, &b, 1);
36
700
    return b;
37
700
}
38
39
signed short ttfReader__Short(ttfReader *r)
40
892k
{   unsigned char buf[2];
41
42
892k
    r->Read(r, buf, 2);
43
892k
    return ((int16)buf[0] << 8) | (int16)buf[1];
44
892k
}
45
46
unsigned short ttfReader__UShort(ttfReader *r)
47
22.9k
{   unsigned char buf[2];
48
49
22.9k
    r->Read(r, buf, 2);
50
22.9k
    return ((uint16)buf[0] << 8) | (uint16)buf[1];
51
22.9k
}
52
53
unsigned int ttfReader__UInt(ttfReader *r)
54
27.9k
{   unsigned char buf[4];
55
56
27.9k
    r->Read(r, buf, 4);
57
27.9k
    return ((int32)buf[0] << 24) | ((int32)buf[1] << 16) |
58
27.9k
           ((int32)buf[2] <<  8) |  (int32)buf[3];
59
27.9k
}
60
61
signed int ttfReader__Int(ttfReader *r)
62
0
{
63
0
    return (int)ttfReader__UInt(r);
64
0
}