Coverage Report

Created: 2025-11-16 09:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/vcl/font/EOTConverter.hxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 */
9
10
#pragma once
11
12
#include <vcl/dllapi.h>
13
#include <vcl/font/FontDataContainer.hxx>
14
15
namespace font
16
{
17
#pragma pack(push, 1)
18
19
/** Main EOT Header
20
 *
21
 * See: https://www.w3.org/submissions/EOT/ */
22
struct EOTHeader
23
{
24
    sal_uInt32 nEotSize;
25
    sal_uInt32 nFontDataSize;
26
    sal_uInt32 nVersion;
27
    sal_uInt32 nFlags;
28
    sal_uInt8 nFontPANOSE[10];
29
    sal_uInt8 nCharset;
30
    sal_uInt8 nItalic;
31
    sal_uInt32 nWeight;
32
    sal_uInt16 nFsType;
33
    sal_uInt16 nMagicNumber;
34
    sal_uInt32 nUnicodeRange1;
35
    sal_uInt32 nUnicodeRange2;
36
    sal_uInt32 nUnicodeRange3;
37
    sal_uInt32 nUnicodeRange4;
38
    sal_uInt32 nCodePageRange1;
39
    sal_uInt32 nCodePageRange2;
40
    sal_uInt32 nCheckSumAdjustment;
41
    sal_uInt32 nReserved1;
42
    sal_uInt32 nReserved2;
43
    sal_uInt32 nReserved3;
44
    sal_uInt32 nReserved4;
45
    // variable length types come after this
46
};
47
48
#pragma pack(pop)
49
50
/** Converts TTF Font wrapped in a FontDataContainer to EOT type */
51
class VCL_DLLPUBLIC EOTConverter
52
{
53
private:
54
    font::FontDataContainer const& mrFontDataContainer;
55
56
public:
57
    explicit EOTConverter(font::FontDataContainer const& rFontDataContainer)
58
780
        : mrFontDataContainer(rFontDataContainer)
59
780
    {
60
780
    }
61
62
    bool convert(std::vector<sal_uInt8>& rEmbeddedOutput);
63
};
64
65
} // end font namespace
66
67
int VCL_DLLPUBLIC TestEOT(const void* data, sal_uInt32 size);
68
69
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */