aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/utils/SkSfntUtils.h
blob: 4e8d7548f9b263e98143f9743f98ab032f951546 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkSfntUtils_DEFINED
#define SkSfntUtils_DEFINED

#include "Sk64.h"
#include "SkTypeface.h"

struct SkSfntTable_head {
    SkFixed     fVersion;
    SkFixed     fRevision;
    uint32_t    fCheckSumAdjustment;
    uint32_t    fMagicNumber;
    uint16_t    fFlags;
    uint16_t    fUnitsPerEm;
    Sk64        fDateCreated;
    Sk64        fDateModified;
    int16_t     fXMin;
    int16_t     fYMin;
    int16_t     fXMax;
    int16_t     fYMax;
    uint16_t    fMacStyle;
    uint16_t    fLowestPPEM;
    int16_t     fFontDirectionHint;
    int16_t     fIndexToLocFormat;
    int16_t     fGlyphDataFormat;
};

struct SkSfntTable_maxp {
    SkFixed     fVersion;
    uint16_t    fNumGlyphs;
    uint16_t    fMaxPoints;
    uint16_t    fMaxContours;
    uint16_t    fMaxComponentPoints;
    uint16_t    fMaxComponentContours;
    uint16_t    fMaxZones;
    uint16_t    fMaxTwilightPoints;
    uint16_t    fMaxStorage;
    uint16_t    fMaxFunctionDefs;
    uint16_t    fMaxInstructionDefs;
    uint16_t    fMaxStackElements;
    uint16_t    fMaxSizeOfInstructions;
    uint16_t    fMaxComponentElements;
    uint16_t    fMaxComponentDepth;
};

class SkSfntUtils {
public:
    static bool ReadTable_head(SkTypeface&, SkSfntTable_head*);
    static bool ReadTable_maxp(SkTypeface&, SkSfntTable_maxp*);
};

#endif