Skip to content

Commit 29f36d9

Browse files
committed
training: Fix typos in comments and strings
All of them were found by codespell. Signed-off-by: Stefan Weil <[email protected]>
1 parent 64f9190 commit 29f36d9

7 files changed

+12
-12
lines changed

training/GlyphLessFont.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,14 @@ cmap_table cmap = {
263263
0x0000, /* encodingID = 0 */
264264
0x20000000, /* Offset of data */
265265
0x0600, /* STart of Apple table (format 6) */
266-
0x0C00, /* lenght of table (12) */
266+
0x0C00, /* length of table (12) */
267267
0x0000, /* Language must be 0 for non-Apple or
268268
non-specific language */
269269
0x0000, /* firstCode = 0 */
270270
0x0100, /* number of codes is 1 */
271271
0x0000, /* GID is 0 */
272272
0x0600, /* Start of MS Table (format 4) */
273-
0x0C00, /* lenght of table (12) */
273+
0x0C00, /* length of table (12) */
274274
0x0000, /* Language must be 0 for non-Apple or
275275
non-specific language */
276276
0x0000, /* firstCode = 0 */

training/boxchar.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void BoxChar::InsertSpaces(bool rtl_rules, bool vertical_rules,
175175
right = prev->x;
176176
}
177177
}
178-
// Left becomes the max right of all next boxes foward to the first
178+
// Left becomes the max right of all next boxes forward to the first
179179
// space or newline.
180180
for (int j = i + 2; j < boxes->size() && (*boxes)[j]->box_ != NULL &&
181181
(*boxes)[j]->ch_ != "\t";

training/combine_tessdata.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int main(int argc, char **argv) {
7878
printf("Error combining tessdata files into %s\n",
7979
output_file.string());
8080
} else {
81-
printf("Output %s created sucessfully.\n", output_file.string());
81+
printf("Output %s created successfully.\n", output_file.string());
8282
}
8383
} else if (argc >= 4 && (strcmp(argv[1], "-e") == 0 ||
8484
strcmp(argv[1], "-u") == 0)) {

training/commontraining.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ const char *GetNextFilename(int argc, const char* const * argv) {
318318

319319
/*---------------------------------------------------------------------------*/
320320
/**
321-
* This routine searches thru a list of labeled lists to find
321+
* This routine searches through a list of labeled lists to find
322322
* a list with the specified label. If a matching labeled list
323323
* cannot be found, NULL is returned.
324324
* @param List list to search
@@ -461,10 +461,10 @@ void FreeTrainingSamples(LIST CharList) {
461461
LIST FeatureList;
462462

463463

464-
iterate(CharList) { /* iterate thru all of the fonts */
464+
iterate(CharList) { /* iterate through all of the fonts */
465465
char_sample = (LABELEDLIST) first_node(CharList);
466466
FeatureList = char_sample->List;
467-
iterate(FeatureList) { /* iterate thru all of the classes */
467+
iterate(FeatureList) { /* iterate through all of the classes */
468468
FeatureSet = (FEATURE_SET) first_node(FeatureList);
469469
FreeFeatureSet(FeatureSet);
470470
}
@@ -743,7 +743,7 @@ void FreeLabeledClassList (
743743
{
744744
MERGE_CLASS MergeClass;
745745

746-
iterate (ClassList) /* iterate thru all of the fonts */
746+
iterate (ClassList) /* iterate through all of the fonts */
747747
{
748748
MergeClass = (MERGE_CLASS) first_node (ClassList);
749749
free (MergeClass->Label);
@@ -841,7 +841,7 @@ void FreeNormProtoList (
841841
{
842842
LABELEDLIST char_sample;
843843

844-
iterate (CharList) /* iterate thru all of the fonts */
844+
iterate (CharList) /* iterate through all of the fonts */
845845
{
846846
char_sample = (LABELEDLIST) first_node (CharList);
847847
FreeLabeledList (char_sample);

training/mergenf.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void ComputeMergedProto (PROTO p1,
149149
} /* ComputeMergedProto */
150150

151151
/**
152-
* This routine searches thru all of the prototypes in
152+
* This routine searches through all of the prototypes in
153153
* Class and returns the id of the proto which would provide
154154
* the best approximation of Prototype. If no close
155155
* approximation can be found, NO_PROTO is returned.

training/pango_font_info.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ bool PangoFontInfo::ParseFontDescription(const PangoFontDescription *desc) {
217217
== PANGO_VARIANT_SMALL_CAPS);
218218

219219
is_bold_ = (pango_font_description_get_weight(desc) >= PANGO_WEIGHT_BOLD);
220-
// We dont have a way to detect whether a font is of type Fraktur. The fonts
220+
// We don't have a way to detect whether a font is of type Fraktur. The fonts
221221
// we currently use all have "Fraktur" in their family name, so we do a
222222
// fragile but functional check for that here.
223223
is_fraktur_ = (strcasestr(family, "Fraktur") != NULL);

training/stringrenderer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class StringRenderer {
5050
StringRenderer(const string& font_desc, int page_width, int page_height);
5151
~StringRenderer();
5252

53-
// Renders the text with the chosen font and returns the byte offset upto
53+
// Renders the text with the chosen font and returns the byte offset up to
5454
// which the text could be rendered so as to fit the specified page
5555
// dimensions.
5656
int RenderToImage(const char* text, int text_length, Pix** pix);

0 commit comments

Comments
 (0)