diff options
author | Troy A. Griffitts <scribe@crosswire.org> | 2007-11-09 09:24:36 +0000 |
---|---|---|
committer | Troy A. Griffitts <scribe@crosswire.org> | 2007-11-09 09:24:36 +0000 |
commit | 23d1269df7431cf2d537fb12a969062e05b44cbe (patch) | |
tree | dc71f6ebe705c75f64733914e800a4736a1de951 /flashtools/flash.cpp | |
parent | b0be99972c5e7282f627c673c945f073d9304853 (diff) | |
download | sword-tools-23d1269df7431cf2d537fb12a969062e05b44cbe.tar.gz |
Added feature to specify font
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@120 07627401-56e2-0310-80f4-f8cd0041bdcd
Diffstat (limited to 'flashtools/flash.cpp')
-rw-r--r-- | flashtools/flash.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/flashtools/flash.cpp b/flashtools/flash.cpp index 1167166..def5e99 100644 --- a/flashtools/flash.cpp +++ b/flashtools/flash.cpp @@ -197,7 +197,7 @@ void outputCSV(const vector<Word> &wordList) { * maxPerLesson - maximum number of words per lesson * */ -void outputFlash(const vector<Word> &wordList, const char *outputDir = ".", bool kjvFreq = true, int maxPerLesson = 25) { +void outputFlash(const vector<Word> &wordList, const char *outputDir = ".", bool kjvFreq = true, int maxPerLesson = 25, const char *fontName=0) { ThMLPlain strip; ofstream ofile; int wordCount = 0; @@ -249,6 +249,9 @@ void outputFlash(const vector<Word> &wordList, const char *outputDir = ".", bool lessonTitle.appendFormatted("lessonTitle=%.3d Freqs. %d-%d\n", lessonNumber, startFreq, lastFreq); ofile << lessonTitle; ofile << "wordCount=" << wordCount << "\n"; + if (fontName) { + ofile << "lessonFont=" << fontName << "\n"; + } ofile.close(); wordCount = 0; lessonNumber++; @@ -388,6 +391,7 @@ void usage(const char *app, const char *error = 0) { fprintf(stderr, " -d <m|k>\t\t definition to use (default k):\n"); fprintf(stderr, "\t\t\t\t m - short meaning; k - KJV collation\n"); fprintf(stderr, " -r <\"range\">\t\t verse range\n"); + fprintf(stderr, " -f <fontName>\t\t include special font name for lesson\n"); fprintf(stderr, " -h\t\t\t display this help message\n\n"); exit(-1); } @@ -404,6 +408,7 @@ int main(int argc, char **argv) { bool csv = false; char def = 'k'; SWBuf range = "Mat-Rev"; + SWBuf fontName = ""; SWBuf outDir = "."; int count = 25; @@ -429,6 +434,10 @@ int main(int argc, char **argv) { if (i+1 < argc) range = argv[++i]; else usage(*argv, "-r requires <\"range\">"); } + else if (!strcmp(argv[i], "-f")) { + if (i+1 < argc) fontName = argv[++i]; + else usage(*argv, "-f requires <\"fontName\">"); + } else if (!strcmp(argv[i], "-o")) { if (i+1 < argc) outDir = argv[++i]; else usage(*argv, "-o requires <outputDir>"); @@ -443,7 +452,7 @@ int main(int argc, char **argv) { outputCSV(processWords(range)); } else { - outputFlash(processWords(range), outDir, (def == 'k'), count); + outputFlash(processWords(range), outDir, (def == 'k'), count, (fontName.length()?fontName.c_str():0)); } return 0; |