| 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 "post.h" | 5 #include "post.h" |
| 6 | 6 |
| 7 #include "maxp.h" | 7 #include "maxp.h" |
| 8 | 8 |
| 9 // post - PostScript | 9 // post - PostScript |
| 10 // http://www.microsoft.com/typography/otspec/post.htm | 10 // http://www.microsoft.com/typography/otspec/post.htm |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 bool ots_post_should_serialise(Font *font) { | 123 bool ots_post_should_serialise(Font *font) { |
| 124 return font->post != NULL; | 124 return font->post != NULL; |
| 125 } | 125 } |
| 126 | 126 |
| 127 bool ots_post_serialise(OTSStream *out, Font *font) { | 127 bool ots_post_serialise(OTSStream *out, Font *font) { |
| 128 const OpenTypePOST *post = font->post; | 128 const OpenTypePOST *post = font->post; |
| 129 | 129 |
| 130 // OpenType with CFF glyphs must have v3 post table. | 130 // OpenType with CFF glyphs must have v3 post table. |
| 131 if (font->post && font->cff && font->post->version != 0x00030000) { | 131 if (post && font->cff && post->version != 0x00030000) { |
| 132 return OTS_FAILURE_MSG("Bad post version %x", post->version); | 132 return OTS_FAILURE_MSG("Bad post version %x", post->version); |
| 133 } | 133 } |
| 134 | 134 |
| 135 if (!out->WriteU32(post->version) || | 135 if (!out->WriteU32(post->version) || |
| 136 !out->WriteU32(post->italic_angle) || | 136 !out->WriteU32(post->italic_angle) || |
| 137 !out->WriteS16(post->underline) || | 137 !out->WriteS16(post->underline) || |
| 138 !out->WriteS16(post->underline_thickness) || | 138 !out->WriteS16(post->underline_thickness) || |
| 139 !out->WriteU32(post->is_fixed_pitch) || | 139 !out->WriteU32(post->is_fixed_pitch) || |
| 140 !out->WriteU32(0) || | 140 !out->WriteU32(0) || |
| 141 !out->WriteU32(0) || | 141 !out->WriteU32(0) || |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 font->post_reused = true; | 184 font->post_reused = true; |
| 185 } | 185 } |
| 186 | 186 |
| 187 void ots_post_free(Font *font) { | 187 void ots_post_free(Font *font) { |
| 188 delete font->post; | 188 delete font->post; |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace ots | 191 } // namespace ots |
| 192 | 192 |
| 193 #undef TABLE_NAME | 193 #undef TABLE_NAME |
| OLD | NEW |