Header.java 984 Bytes
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.fontengine.font.cff;

import com.adobe.fontengine.font.InvalidFontException;
import com.adobe.fontengine.font.UnsupportedFontException;
import com.adobe.fontengine.font.cff.CFFByteArray;

final class Header {
    protected final CFFByteArray data;
    protected final int offset;

    protected Header(CFFByteArray data, int offset) throws InvalidFontException, UnsupportedFontException {
        this.data = data;
        this.offset = offset;
    }

    public int getMajorVersion() throws InvalidFontException {
        return this.data.getcard8(0);
    }

    public int getMinorversion() throws InvalidFontException {
        return this.data.getcard8(1);
    }

    public int size() throws InvalidFontException {
        return this.data.getcard8(2);
    }

    static void toBinary(CFFByteArray.CFFByteArrayBuilder b) {
        b.addCard8(1);
        b.addCard8(0);
        b.addCard8(4);
        b.addCard8(4);
    }
}