1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/ots/src/cff.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +// Copyright (c) 2009 The Chromium Authors. All rights reserved. 1.5 +// Use of this source code is governed by a BSD-style license that can be 1.6 +// found in the LICENSE file. 1.7 + 1.8 +#ifndef OTS_CFF_H_ 1.9 +#define OTS_CFF_H_ 1.10 + 1.11 +#include "ots.h" 1.12 + 1.13 +#include <map> 1.14 +#include <string> 1.15 +#include <vector> 1.16 + 1.17 +namespace ots { 1.18 + 1.19 +struct CFFIndex { 1.20 + CFFIndex() 1.21 + : count(0), off_size(0), offset_to_next(0) {} 1.22 + uint16_t count; 1.23 + uint8_t off_size; 1.24 + std::vector<uint32_t> offsets; 1.25 + uint32_t offset_to_next; 1.26 +}; 1.27 + 1.28 +struct OpenTypeCFF { 1.29 + const uint8_t *data; 1.30 + size_t length; 1.31 + // Name INDEX. This name is used in name.cc as a postscript font name. 1.32 + std::string name; 1.33 + 1.34 + // The number of fonts the file has. 1.35 + size_t font_dict_length; 1.36 + // A map from glyph # to font #. 1.37 + std::map<uint16_t, uint8_t> fd_select; 1.38 + 1.39 + // A list of char strings. 1.40 + std::vector<CFFIndex *> char_strings_array; 1.41 + // A list of Local Subrs associated with FDArrays. Can be empty. 1.42 + std::vector<CFFIndex *> local_subrs_per_font; 1.43 + // A Local Subrs associated with Top DICT. Can be NULL. 1.44 + CFFIndex *local_subrs; 1.45 +}; 1.46 + 1.47 +} // namespace ots 1.48 + 1.49 +#endif // OTS_CFF_H_