OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ots.h" | 5 #include "ots.h" |
6 | 6 |
7 #include <sys/types.h> | 7 #include <sys/types.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cstdlib> | 10 #include <cstdlib> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 { Tag("cvt "), ots::ots_cvt_parse, ots::ots_cvt_serialise, | 112 { Tag("cvt "), ots::ots_cvt_parse, ots::ots_cvt_serialise, |
113 ots::ots_cvt_should_serialise, ots::ots_cvt_free, false }, | 113 ots::ots_cvt_should_serialise, ots::ots_cvt_free, false }, |
114 { Tag("fpgm"), ots::ots_fpgm_parse, ots::ots_fpgm_serialise, | 114 { Tag("fpgm"), ots::ots_fpgm_parse, ots::ots_fpgm_serialise, |
115 ots::ots_fpgm_should_serialise, ots::ots_fpgm_free, false }, | 115 ots::ots_fpgm_should_serialise, ots::ots_fpgm_free, false }, |
116 { Tag("prep"), ots::ots_prep_parse, ots::ots_prep_serialise, | 116 { Tag("prep"), ots::ots_prep_parse, ots::ots_prep_serialise, |
117 ots::ots_prep_should_serialise, ots::ots_prep_free, false }, | 117 ots::ots_prep_should_serialise, ots::ots_prep_free, false }, |
118 { Tag("LTSH"), ots::ots_ltsh_parse, ots::ots_ltsh_serialise, | 118 { Tag("LTSH"), ots::ots_ltsh_parse, ots::ots_ltsh_serialise, |
119 ots::ots_ltsh_should_serialise, ots::ots_ltsh_free, false }, | 119 ots::ots_ltsh_should_serialise, ots::ots_ltsh_free, false }, |
120 { Tag("VORG"), ots::ots_vorg_parse, ots::ots_vorg_serialise, | 120 { Tag("VORG"), ots::ots_vorg_parse, ots::ots_vorg_serialise, |
121 ots::ots_vorg_should_serialise, ots::ots_vorg_free, false }, | 121 ots::ots_vorg_should_serialise, ots::ots_vorg_free, false }, |
122 // TODO(yusukes): Support GDEF, GPOS, GSUB, kern, mort, base, and jstf tables. | 122 { Tag("kern"), ots::ots_kern_parse, ots::ots_kern_serialise, |
| 123 ots::ots_kern_should_serialise, ots::ots_kern_free, false }, |
| 124 // TODO(yusukes): Support GDEF, GPOS, GSUB, mort, base, and jstf tables. |
123 { 0, NULL, NULL, NULL, NULL, false }, | 125 { 0, NULL, NULL, NULL, NULL, false }, |
124 }; | 126 }; |
125 | 127 |
126 bool DoProcess(ots::OpenTypeFile *header, | 128 bool DoProcess(ots::OpenTypeFile *header, |
127 ots::OTSStream *output, const uint8_t *data, size_t length) { | 129 ots::OTSStream *output, const uint8_t *data, size_t length) { |
128 ots::Buffer file(data, length); | 130 ots::Buffer file(data, length); |
129 | 131 |
130 // we disallow all files > 1GB in size for sanity. | 132 // we disallow all files > 1GB in size for sanity. |
131 if (length > 1024 * 1024 * 1024) { | 133 if (length > 1024 * 1024 * 1024) { |
132 return OTS_FAILURE(); | 134 return OTS_FAILURE(); |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 va_start(va, format); | 454 va_start(va, format); |
453 std::vfprintf(stderr, format, va); | 455 std::vfprintf(stderr, format, va); |
454 va_end(va); | 456 va_end(va); |
455 std::fprintf(stderr, "\n"); | 457 std::fprintf(stderr, "\n"); |
456 std::fflush(stderr); | 458 std::fflush(stderr); |
457 } | 459 } |
458 } | 460 } |
459 #endif | 461 #endif |
460 | 462 |
461 } // namespace ots | 463 } // namespace ots |
OLD | NEW |