MathEngine::LineBreaking(lineBreaking); MathEngine::ShowEmptyElements(showEmptyRows);
main(int argc, char *argv[]){  sprintf(appName, "MathML to PostScript v%s", MATHML2PS_VERSION);  while (TRUE) {    int option_index = 0;    static struct option long_options[] =    {      { "version", 	 no_argument,       NULL, OPTION_VERSION },      { "help",    	 no_argument,       NULL, OPTION_HELP },      { "verbose",       optional_argument, NULL, OPTION_VERBOSE },      { "size",          required_argument, NULL, OPTION_SIZE },      { "unit",          required_argument, NULL, OPTION_UNIT },      { "margins",       required_argument, NULL, OPTION_MARGINS },      { "font-size",     required_argument, NULL, OPTION_FONT_SIZE },      { "colors",        optional_argument, NULL, OPTION_COLORS },      { "subset",        optional_argument, NULL, OPTION_SUBSET },      { "crop",          optional_argument, NULL, OPTION_CROP },      { "show-missing",  optional_argument, NULL, OPTION_SHOW_MISSING },      { "cut-filename",  optional_argument, NULL, OPTION_CUT_FILENAME },      //{ "kerning",       optional_argument, NULL, OPTION_KERNING },      { "config",        required_argument, NULL, OPTION_CONFIG },      { NULL,            no_argument, NULL, 0 }    };    int c = getopt_long(argc, argv, "vhg:u:m:f:k::c::s::", long_options, &option_index);    if (c == -1) break;    switch (c) {    case OPTION_VERSION:    case 'v':      printVersion();      break;    case OPTION_HELP:    case 'h':      printHelp();      break;    case OPTION_SIZE:    case 'g':      if (optarg == NULL) printHelp();      if (!parseSize(optarg)) parseError("size");      break;    case OPTION_UNIT:    case 'u':      if (optarg == NULL) printHelp();      if (!parseUnit(optarg)) parseError("unit");      break;    case OPTION_MARGINS:    case 'm':      if (optarg == NULL) printHelp();      if (!parseMargins(optarg)) parseError("margins");      break;    case OPTION_VERBOSE:      if (optarg == NULL) logLevel = LOG_ERROR;      else logLevel = *optarg - '0';      break;    case OPTION_FONT_SIZE:    case 'f':      if (optarg == NULL) printHelp();      fontSize = atof(optarg);      break;    case OPTION_COLORS:    case 'c':      if (optarg == NULL) colors = true;      else if (!parseBoolean(optarg, colors)) parseError("colors");      break;    case OPTION_SUBSET:    case 's':      if (optarg == NULL) subsetting = true;      else if (!parseBoolean(optarg, subsetting)) parseError("subset");      break;    case OPTION_CROP:    case 'r':      if (optarg == NULL) cropping = true;      else if (!parseBoolean(optarg, cropping)) parseError("crop");      break;    case OPTION_SHOW_MISSING:    case 'i':      if (optarg == NULL) showMissing = true;      else if (!parseBoolean(optarg, showMissing)) parseError("show-missing");      break;    case OPTION_CUT_FILENAME:      if (optarg == NULL) cutFileName = true;      else if (!parseBoolean(optarg, cutFileName)) parseError("cut-filename");      break;#if 0    case OPTION_KERNING:    case 'k':      if (optarg == NULL) kerning = true;      else if (!parseBoolean(optarg, kerning)) parseError("kerning");      break;#endif    case OPTION_CONFIG:      configPath = optarg;      break;    case '?':      break;    default:      fprintf(stderr, "*** getopt returned %o value\n", c);      break;    }  }  if (configPath == NULL) configPath = getenv("MATHENGINECONF");    MathEngine::logger.SetLogLevel(logLevel);  MathEngine::logger(LOG_INFO, "Font size : %f", fontSize);  MathEngine::logger(LOG_INFO, "Paper size: %fx%f", width, height);  MathEngine::logger(LOG_INFO, "Margins   : %fx%f", xMargin, yMargin);#ifdef HAVE_LIBT1  if (optind >= argc) {    printHelp();    exit(1);  }    MathEngine engine;  MathEngine::InitGlobalData(configPath);  UnitValue uWidth;  UnitValue uHeight;  UnitValue uXMargin;  UnitValue uYMargin;  uWidth.Set(width, unitId);  uHeight.Set(height, unitId);  uXMargin.Set(xMargin, unitId);  uYMargin.Set(yMargin, unitId);  scaled w = uWidth.ToScaledPoints();  scaled h = uHeight.ToScaledPoints();  scaled x0 = uXMargin.ToScaledPoints();  scaled y0 = uYMargin.ToScaledPoints();  GraphicsContextValues values;  values.foreground = BLACK_COLOR;  values.background = WHITE_COLOR;  values.lineStyle = LINE_STYLE_SOLID;  values.lineWidth = px2sp(1);  PS_DrawingArea area(values, x0, y0);  area.SetSize(w, h);  if (!colors) area.DisableColors();  PS_T1_FontManager fm;  engine.Init(&area, &fm);  while (optind < argc) {    MathEngine::logger(LOG_INFO, "Processing `%s'...", argv[optind]);    char* outName = getOutputFileName(argv[optind]);    assert(outName != NULL);    FILE* outFile = fopen(outName, "wt");    if (outFile == NULL) {      MathEngine::logger(LOG_ERROR, "could not open output file `%s' for writing", outName);      exit(1);    }    area.SetOutputFile(outFile);    engine.SetVerbosity(logLevel);    engine.SetDefaultFontSize(fontSize);    MathEngine::DrawMissingCharacter(showMissing);#if 0    engine.SetKerning(kerning);#endif    fm.ResetUsedFonts();    if (engine.Load(argv[optind])) {      engine.Layout();      Rectangle rect;      engine.GetDocumentRectangle(rect);      Rectangle sheet;      sheet.x = 0;      sheet.y = 0;      sheet.width = w;      sheet.height = h;      // the following invocations are needed just to mark the chars actually used :(      fm.ResetUsedChars();      area.SetOutputFile(NULL);      engine.Render(&sheet);      area.SetOutputFile(outFile);      area.DumpHeader(appName, argv[optind], cropping ? rect : sheet);      fm.DumpFontDictionary(outFile, subsetting);      area.DumpPreamble();      //area.DumpGrid();      engine.Render(&sheet);      area.DumpEpilogue();      fclose(outFile);    } else {      fclose(outFile);      remove(outName);      fprintf(stderr, "cannot open input document `%s' (skipped)\n", argv[optind]);    }    delete [] outName;    optind++;  }#else   printHelp();#endif  exit(0);}