public int getLength() {
        int length = 0;
        
        for (int i = 0; i < glyphs.length; i++) {
            Object o = glyphs[i];
            if (o == null) {
                continue;
            }
            
            if (o instanceof ByteBuffer) {
                length += ((ByteBuffer) o).remaining();
            } else {
                length += ((Glyf) o).getLength();
            }
        }
        
        return length;
    }