Coverage Report

Created: 2025-06-24 07:01

/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
3.76M
{   unsigned char b;
27
28
3.76M
    r->Read(r, &b, 1);
29
3.76M
    return b;
30
3.76M
}
31
32
signed char ttfReader__SignedByte(ttfReader *r)
33
1.67k
{   signed char b;
34
35
1.67k
    r->Read(r, &b, 1);
36
1.67k
    return b;
37
1.67k
}
38
39
signed short ttfReader__Short(ttfReader *r)
40
2.49M
{   unsigned char buf[2];
41
42
2.49M
    r->Read(r, buf, 2);
43
2.49M
    return ((int16)buf[0] << 8) | (int16)buf[1];
44
2.49M
}
45
46
unsigned short ttfReader__UShort(ttfReader *r)
47
60.6k
{   unsigned char buf[2];
48
49
60.6k
    r->Read(r, buf, 2);
50
60.6k
    return ((uint16)buf[0] << 8) | (uint16)buf[1];
51
60.6k
}
52
53
unsigned int ttfReader__UInt(ttfReader *r)
54
74.3k
{   unsigned char buf[4];
55
56
74.3k
    r->Read(r, buf, 4);
57
74.3k
    return ((int32)buf[0] << 24) | ((int32)buf[1] << 16) |
58
74.3k
           ((int32)buf[2] <<  8) |  (int32)buf[3];
59
74.3k
}
60
61
signed int ttfReader__Int(ttfReader *r)
62
0
{
63
0
    return (int)ttfReader__UInt(r);
64
0
}