[sword-svn] r120 - trunk/flashtools

scribe at www.crosswire.org scribe at www.crosswire.org
Fri Nov 9 02:24:37 MST 2007


Author: scribe
Date: 2007-11-09 02:24:36 -0700 (Fri, 09 Nov 2007)
New Revision: 120

Modified:
   trunk/flashtools/Makefile
   trunk/flashtools/flash.cpp
Log:
Added feature to specify font


Modified: trunk/flashtools/Makefile
===================================================================
--- trunk/flashtools/Makefile	2007-11-08 04:03:12 UTC (rev 119)
+++ trunk/flashtools/Makefile	2007-11-09 09:24:36 UTC (rev 120)
@@ -8,10 +8,10 @@
 lessons:
 	rm -rf lessons
 	mkdir -p lessons/hebrewFreq lessons/hebrewFreqKJV lessons/greekFreq lessons/greekFreqKJV
-	./flash -o lessons/hebrewFreq -w 25 -d m -r Gen-Mal
-	./flash -o lessons/hebrewFreqKJV -w 25 -d k -r Gen-Mal
-	./flash -o lessons/greekFreq -w 25 -d m -r Mat-Rev
-	./flash -o lessons/greekFreqKJV -w 25 -d k -r Mat-Rev
+	./flash -o lessons/hebrewFreq -w 25 -d m -r Gen-Mal -f Ezra
+	./flash -o lessons/hebrewFreqKJV -w 25 -d k -r Gen-Mal -f Ezra
+	./flash -o lessons/greekFreq -w 25 -d m -r Mat-Rev -f Galatia
+	./flash -o lessons/greekFreqKJV -w 25 -d k -r Mat-Rev -f Galatia
 
 .cpp:
 	g++ -g `pkg-config --cflags sword` $< -o $@ `pkg-config --libs sword`

Modified: trunk/flashtools/flash.cpp
===================================================================
--- trunk/flashtools/flash.cpp	2007-11-08 04:03:12 UTC (rev 119)
+++ trunk/flashtools/flash.cpp	2007-11-09 09:24:36 UTC (rev 120)
@@ -197,7 +197,7 @@
  * 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 @@
 			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 @@
 	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 @@
 	bool csv             = false;
 	char def             = 'k';
 	SWBuf range          = "Mat-Rev";
+	SWBuf fontName       = "";
 	SWBuf outDir         = ".";
 	int count            = 25;
 
@@ -429,6 +434,10 @@
 			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 @@
 		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;




More information about the sword-cvs mailing list