1 /* 2 * Copyright 2011 Google Inc. All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #include <stdio.h> 18 #if _MSC_VER > 12 19 #define _CRTDBG_MAP_ALLOC 20 #include <stdlib.h> 21 #include <crtdbg.h> 22 #endif 23 24 #include "sample/subsetter/subset_util.h" 25 main(int argc,char ** argv)26int main(int argc, char** argv) { 27 #ifdef _CRTDBG_MAP_ALLOC 28 _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); 29 #endif 30 31 if (argc < 3) { 32 printf("Usage: subsetter <font file> <output file>\n"); 33 return 0; 34 } 35 36 sfntly::SubsetUtil subset_util; 37 subset_util.Subset(argv[1], argv[2]); 38 39 #ifdef _CRTDBG_MAP_ALLOC 40 _CrtDumpMemoryLeaks(); 41 #endif 42 43 return 0; 44 } 45