Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: trunk/src/cmap.cc

Issue 341983012: OTS: Add DoNotDropColorBitmapTables() API. (Closed) Base URL: http://ots.googlecode.com/svn/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/src/cblc.cc ('k') | trunk/src/ots.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cmap.h" 5 #include "cmap.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 const unsigned num_subtables = static_cast<unsigned>(have_034) + 841 const unsigned num_subtables = static_cast<unsigned>(have_034) +
842 static_cast<unsigned>(have_0514) + 842 static_cast<unsigned>(have_0514) +
843 static_cast<unsigned>(have_100) + 843 static_cast<unsigned>(have_100) +
844 static_cast<unsigned>(have_304) + 844 static_cast<unsigned>(have_304) +
845 static_cast<unsigned>(have_314) + 845 static_cast<unsigned>(have_314) +
846 static_cast<unsigned>(have_31012) + 846 static_cast<unsigned>(have_31012) +
847 static_cast<unsigned>(have_31013); 847 static_cast<unsigned>(have_31013);
848 const off_t table_start = out->Tell(); 848 const off_t table_start = out->Tell();
849 849
850 // Some fonts don't have 3-0-4 MS Symbol nor 3-1-4 Unicode BMP tables 850 // Some fonts don't have 3-0-4 MS Symbol nor 3-1-4 Unicode BMP tables
851 // (e.g., old fonts for Mac). We don't support them. 851 // (e.g., old fonts for Mac). We don't support them except for color bitmap
852 // fonts.
852 if (!have_304 && !have_314 && !have_034) { 853 if (!have_304 && !have_314 && !have_034) {
853 return OTS_FAILURE(); 854 if (!(file->cbdt && file->cblc)) {
855 return OTS_FAILURE();
856 }
854 } 857 }
855 858
856 if (!out->WriteU16(0) || 859 if (!out->WriteU16(0) ||
857 !out->WriteU16(num_subtables)) { 860 !out->WriteU16(num_subtables)) {
858 return OTS_FAILURE(); 861 return OTS_FAILURE();
859 } 862 }
860 863
861 const off_t record_offset = out->Tell(); 864 const off_t record_offset = out->Tell();
862 if (!out->Pad(num_subtables * 8)) { 865 if (!out->Pad(num_subtables * 8)) {
863 return OTS_FAILURE(); 866 return OTS_FAILURE();
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 out->RestoreChecksum(saved_checksum); 1070 out->RestoreChecksum(saved_checksum);
1068 1071
1069 return true; 1072 return true;
1070 } 1073 }
1071 1074
1072 void ots_cmap_free(OpenTypeFile *file) { 1075 void ots_cmap_free(OpenTypeFile *file) {
1073 delete file->cmap; 1076 delete file->cmap;
1074 } 1077 }
1075 1078
1076 } // namespace ots 1079 } // namespace ots
OLDNEW
« no previous file with comments | « trunk/src/cblc.cc ('k') | trunk/src/ots.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698