Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Fix calling autohintexe -rs -a
Browse files Browse the repository at this point in the history
The -a option was ignored because it came after -rs option. Need to do
set the callbacks after processing all command line options.
  • Loading branch information
khaledhosny committed Sep 7, 2018
1 parent cc5e26c commit ae20724
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions libpsautohint/autohintexe.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ main(int argc, char* argv[])
bool allowEdit, roundCoords, allowHintSub, badParam, allStems;
bool argumentIsBezData = false;
bool doMM = false;
bool report = false;
bool report_zones = false, report_stems = false;
char* fontInfoFileName = NULL; /* font info file name, or suffix of
environment variable holding
the fontfino string. */
Expand Down Expand Up @@ -365,14 +365,10 @@ main(int argc, char* argv[])
fileSuffix = (char*)reportExt;
switch (current_arg[2]) {
case 'a':
AC_SetReportRetryCB(reportRetry);
AC_SetReportZonesCB(charZoneCB, stemZoneCB);
report = true;
report_zones = true;
break;
case 's':
AC_SetReportRetryCB(reportRetry);
AC_SetReportStemsCB(hstemCB, vstemCB, allStems);
report = true;
report_stems = true;
break;
default:
fprintf(stdout, "Error. %s is an invalid parameter.\n",
Expand All @@ -392,6 +388,16 @@ main(int argc, char* argv[])
}
}

if (report_zones) {
AC_SetReportRetryCB(reportRetry);
AC_SetReportZonesCB(charZoneCB, stemZoneCB);
}

if (report_stems) {
AC_SetReportRetryCB(reportRetry);
AC_SetReportStemsCB(hstemCB, vstemCB, allStems);
}

if (firstFileNameIndex == -1) {
fprintf(stdout,
"Error. Illegal command line. Must provide bez file name.\n");
Expand Down Expand Up @@ -422,7 +428,7 @@ main(int argc, char* argv[])
outputsize = 4 * strlen(bezdata);
output = malloc(outputsize);

if (!argumentIsBezData && report) {
if (!argumentIsBezData && (report_zones || report_stems)) {
openReportFile(bezName, fileSuffix);
}

Expand Down

0 comments on commit ae20724

Please sign in to comment.