Skip to content

Commit

Permalink
Patch by Yuri Chornoivan to make the rest of LogError message transla…
Browse files Browse the repository at this point in the history
…table.
  • Loading branch information
michal-n committed Aug 14, 2012
1 parent 2f0ac45 commit 6428f59
Show file tree
Hide file tree
Showing 20 changed files with 88 additions and 86 deletions.
2 changes: 1 addition & 1 deletion fontforge/bezctx_ff.c
Expand Up @@ -23,7 +23,7 @@ static void
nancheck(bezctx_ff *bc) {

if ( !bc->gotnans ) {
LogError("Spiros did not converge" );
LogError(_("Spiros did not converge") );
bc->gotnans = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion fontforge/dumppfa.c
Expand Up @@ -629,7 +629,7 @@ static void dumpPattern(void (*dumpchar)(int ch,void *data), void *data,
/* and can't live in the content stream, so they are done elsewhere */
} else {
if ( pattern_sc==NULL )
LogError("No glyph named %s, used as a pattern in %s\n", pat->pattern, sc->name);
LogError(_("No glyph named %s, used as a pattern in %s\n"), pat->pattern, sc->name);
PatternSCBounds(pattern_sc,&b);

dumpf(dumpchar,data, "<<\n" );
Expand Down
4 changes: 2 additions & 2 deletions fontforge/featurefile.c
Expand Up @@ -90,7 +90,7 @@ static void dump_glyphbyname(FILE *out, SplineFont *sf, char *name) {
SplineChar *sc = SFGetChar(sf,-1,name);

if ( sc==NULL )
LogError( "No glyph named %s.", name );
LogError(_("No glyph named %s."), name );
if ( sc==NULL || sc->parent->cidmaster==NULL )
fprintf( out, "\\%s", name );
else
Expand Down Expand Up @@ -128,7 +128,7 @@ static void dump_glyphnamelist(FILE *out, SplineFont *sf, char *names) {
ch = *pt; *pt = '\0';
sc2 = SFGetChar(sf,-1,start);
if ( sc2==NULL ) {
LogError( "No CID named %s", start);
LogError(_("No CID named %s"), start);
nm = start;
} else {
sprintf( cidbuf, "\\%d", sc2->orig_pos );
Expand Down
4 changes: 2 additions & 2 deletions fontforge/freetype.c
Expand Up @@ -195,15 +195,15 @@ return( false );
/* Here we are compiled with an old library, so if the dynamic one is new we fail */
if ( FreeTypeAtLeast(2,3,5)) {
if ( !complained ) {
LogError("This version of FontForge expects freetype 2.3.4 or less.");
LogError(_("This version of FontForge expects freetype 2.3.4 or less."));
complained = true;
}
return( false );
}
#else
if ( !FreeTypeAtLeast(2,3,5)) {
if ( !complained ) {
LogError("This version of FontForge expects freetype 2.3.5 or more.");
LogError(_("This version of FontForge expects freetype 2.3.5 or more."));
complained = true;
}
return( false );
Expand Down
28 changes: 14 additions & 14 deletions fontforge/fvfonts.c
Expand Up @@ -316,7 +316,7 @@ static AnchorPoint *AnchorPointsDuplicate(AnchorPoint *base,SplineChar *sc) {
break;
cur->anchor = ac;
if ( ac==NULL ) {
LogError( "No matching AnchorClass for %s", base->anchor->name);
LogError(_("No matching AnchorClass for %s"), base->anchor->name);
chunkfree(cur,sizeof(AnchorPoint));
} else {
if ( head==NULL )
Expand Down Expand Up @@ -1433,69 +1433,69 @@ static void LayerInterpolate(Layer *to,Layer *base,Layer *other,real amount,Spli
if ( base->dofill==other->dofill )
to->dofill = base->dofill;
else
LogError( "Different settings on whether to fill in layer %d of %s\n", lc, sc->name );
LogError(_("Different settings on whether to fill in layer %d of %s\n"), lc, sc->name );
if ( base->fill_brush.col==COLOR_INHERITED && other->fill_brush.col==COLOR_INHERITED )
to->fill_brush.col = COLOR_INHERITED;
else if ( base->fill_brush.col!=COLOR_INHERITED && other->fill_brush.col!=COLOR_INHERITED )
to->fill_brush.col = InterpColor( base->fill_brush.col,other->fill_brush.col, amount );
else
LogError( "Different settings on whether to inherit fill color in layer %d of %s\n", lc, sc->name );
LogError(_("Different settings on whether to inherit fill color in layer %d of %s\n"), lc, sc->name );
if ( base->fill_brush.opacity<0 && other->fill_brush.opacity<0 )
to->fill_brush.opacity = WIDTH_INHERITED;
else if ( base->fill_brush.opacity>=0 && other->fill_brush.opacity>=0 )
to->fill_brush.opacity = base->fill_brush.opacity + amount*(other->fill_brush.opacity-base->fill_brush.opacity);
else
LogError( "Different settings on whether to inherit fill opacity in layer %d of %s\n", lc, sc->name );
LogError(_("Different settings on whether to inherit fill opacity in layer %d of %s\n"), lc, sc->name );
if ( base->stroke_pen.brush.col==COLOR_INHERITED && other->stroke_pen.brush.col==COLOR_INHERITED )
to->stroke_pen.brush.col = COLOR_INHERITED;
else if ( base->stroke_pen.brush.col!=COLOR_INHERITED && other->stroke_pen.brush.col!=COLOR_INHERITED )
to->stroke_pen.brush.col = InterpColor( base->stroke_pen.brush.col,other->stroke_pen.brush.col, amount );
else
LogError( "Different settings on whether to inherit fill color in layer %d of %s\n", lc, sc->name );
LogError(_("Different settings on whether to inherit fill color in layer %d of %s\n"), lc, sc->name );
if ( base->stroke_pen.brush.opacity<0 && other->stroke_pen.brush.opacity<0 )
to->stroke_pen.brush.opacity = WIDTH_INHERITED;
else if ( base->stroke_pen.brush.opacity>=0 && other->stroke_pen.brush.opacity>=0 )
to->stroke_pen.brush.opacity = base->stroke_pen.brush.opacity + amount*(other->stroke_pen.brush.opacity-base->stroke_pen.brush.opacity);
else
LogError( "Different settings on whether to inherit stroke opacity in layer %d of %s\n", lc, sc->name );
LogError(_("Different settings on whether to inherit stroke opacity in layer %d of %s\n"), lc, sc->name );
if ( base->stroke_pen.width<0 && other->stroke_pen.width<0 )
to->stroke_pen.width = WIDTH_INHERITED;
else if ( base->stroke_pen.width>=0 && other->stroke_pen.width>=0 )
to->stroke_pen.width = base->stroke_pen.width + amount*(other->stroke_pen.width-base->stroke_pen.width);
else
LogError( "Different settings on whether to inherit stroke width in layer %d of %s\n", lc, sc->name );
LogError(_("Different settings on whether to inherit stroke width in layer %d of %s\n"), lc, sc->name );
if ( base->stroke_pen.linecap==other->stroke_pen.linecap )
to->stroke_pen.linecap = base->stroke_pen.linecap;
else
LogError( "Different settings on stroke linecap in layer %d of %s\n", lc, sc->name );
LogError(_("Different settings on stroke linecap in layer %d of %s\n"), lc, sc->name );
if ( base->stroke_pen.linejoin==other->stroke_pen.linejoin )
to->stroke_pen.linejoin = base->stroke_pen.linejoin;
else
LogError( "Different settings on stroke linejoin in layer %d of %s\n", lc, sc->name );
LogError(_("Different settings on stroke linejoin in layer %d of %s\n"), lc, sc->name );
if ( base->fill_brush.gradient!=NULL || other->fill_brush.gradient!=NULL ||
base->stroke_pen.brush.gradient!=NULL || other->stroke_pen.brush.gradient!=NULL )
LogError( "I can't even imagine how to attempt to interpolate gradients in layer %d of %s\n", lc, sc->name );
LogError(_("I can't even imagine how to attempt to interpolate gradients in layer %d of %s\n"), lc, sc->name );
#if 0
if ( base->fill_brush.pattern!=NULL && other->fill_brush.pattern!=NULL &&
strcmp(base->fill_brush.pattern,other->fill_brush.pattern)==0 )
to->fill_brush.pattern = copy(base->fill_brush.pattern);
else
#endif
if ( base->fill_brush.pattern!=NULL || other->fill_brush.pattern!=NULL )
LogError( "Different fill patterns in layer %d of %s\n", lc, sc->name );
LogError(_("Different fill patterns in layer %d of %s\n"), lc, sc->name );
#if 0
if ( base->stroke_pen.brush.pattern!=NULL && other->stroke_pen.brush.pattern!=NULL &&
strcmp(base->stroke_pen.brush.pattern,other->stroke_pen.brush.pattern)==0 )
to->stroke_pen.brush.pattern = copy(base->stroke_pen.brush.pattern);
else
#endif
if ( base->stroke_pen.brush.pattern!=NULL || other->stroke_pen.brush.pattern!=NULL )
LogError( "Different stroke patterns in layer %d of %s\n", lc, sc->name );
LogError(_("Different stroke patterns in layer %d of %s\n"), lc, sc->name );

to->splines = SplineSetsInterpolate(base->splines,other->splines,amount,sc);
to->refs = InterpRefs(base->refs,other->refs,amount,sc);
if ( base->images!=NULL || other->images!=NULL )
LogError( "I can't even imagine how to attempt to interpolate images in layer %d of %s\n", lc, sc->name );
LogError(_("I can't even imagine how to attempt to interpolate images in layer %d of %s\n"), lc, sc->name );
}
#endif

Expand Down Expand Up @@ -1524,7 +1524,7 @@ return( NULL );
if ( base->parent->multilayer && other->parent->multilayer ) {
int lc = base->layer_cnt;
if ( lc!=other->layer_cnt ) {
LogError( "Different numbers of layers in %s\n", base->name );
LogError(_("Different numbers of layers in %s\n"), base->name );
if ( other->layer_cnt<lc ) lc = other->layer_cnt;
}
if ( lc>2 ) {
Expand Down
2 changes: 1 addition & 1 deletion fontforge/fvimportbdf.c
Expand Up @@ -1238,7 +1238,7 @@ return( 0 );
}
}
if ( ftell(pk)!=char_end ) {
LogError( "The character, %d, was not read properly (or pk file is in bad format)\n At %ld should be %d, off by %ld\n", cc, ftell(pk), char_end, ftell(pk)-char_end );
LogError(_("The character, %d, was not read properly (or pk file is in bad format)\n At %ld should be %d, off by %ld\n"), cc, ftell(pk), char_end, ftell(pk)-char_end );
fseek(pk,char_end,SEEK_SET);
}
/* printf( "\n" ); */
Expand Down
24 changes: 12 additions & 12 deletions fontforge/parsettf.c
Expand Up @@ -1991,7 +1991,7 @@ return;
LogError(_("A point in GID %d is outside the glyph bounding box\n"), sc->orig_pos );
info->bad_glyph_data = true;
if ( !(info->openflags&of_fontlint) )
LogError(" Subsequent errors will not be reported.\n" );
LogError(_(" Subsequent errors will not be reported.\n") );
info->gbbcomplain = true;
}
}
Expand All @@ -2014,7 +2014,7 @@ return;
LogError(_("A point in GID %d is outside the glyph bounding box\n"), sc->orig_pos );
info->bad_glyph_data = true;
if ( !(info->openflags&of_fontlint) )
LogError(" Subsequent errors will not be reported.\n" );
LogError(_(" Subsequent errors will not be reported.\n") );
info->gbbcomplain = true;
}
}
Expand Down Expand Up @@ -2225,7 +2225,7 @@ return( sc );
LogError(_("Glyph bounding box data exceeds font bounding box data for GID %d\n"), gid );
info->bad_glyph_data = true;
if ( !(info->openflags&of_fontlint) )
LogError(" Subsequent errors will not be reported.\n" );
LogError(_(" Subsequent errors will not be reported.\n") );
info->bbcomplain = true;
}
}
Expand Down Expand Up @@ -3161,7 +3161,7 @@ static void readcffprivate(FILE *ttf, struct topdicts *td, struct ttfinfo *info)

while ( ftell(ttf)<end ) {
if ( feof(ttf) ) {
LogError("End of file found when reading private dictionary.\n" );
LogError(_("End of file found when reading private dictionary.\n") );
break;
}
sp = 0;
Expand Down Expand Up @@ -4047,22 +4047,22 @@ static void readttfwidths(FILE *ttf,struct ttfinfo *info) {
if ( lastwidth>info->advanceWidthMax && info->hhea_start!=0 ) {
if ( !info->wdthcomplain || (info->openflags&of_fontlint)) {
if ( info->fontname!=NULL && sc->name!=NULL )
LogError("In %s, the advance width (%d) for glyph %s is greater than the maximum (%d)\n",
LogError(_("In %s, the advance width (%d) for glyph %s is greater than the maximum (%d)\n"),
info->fontname, lastwidth, sc->name, info->advanceWidthMax );
else
LogError("In GID %d the advance width (%d) is greater than the stated maximum (%d)\n",
LogError(_("In GID %d the advance width (%d) is greater than the stated maximum (%d)\n"),
i, lastwidth, info->advanceWidthMax );
if ( !(info->openflags&of_fontlint) )
LogError(" Subsequent errors will not be reported.\n" );
LogError(_(" Subsequent errors will not be reported.\n") );
info->wdthcomplain = true;
}
}
if ( check_width_consistency && sc->width!=lastwidth ) {
if ( info->fontname!=NULL && sc->name!=NULL )
LogError("In %s, in glyph %s, 'CFF ' advance width (%d) and\n 'hmtx' width (%d) do not match. (Subsequent mismatches will not be reported)\n",
LogError(_("In %s, in glyph %s, 'CFF ' advance width (%d) and\n 'hmtx' width (%d) do not match. (Subsequent mismatches will not be reported)\n"),
info->fontname, sc->name, sc->width, lastwidth );
else
LogError("In GID %d, 'CFF ' advance width (%d) and 'hmtx' width (%d) do not match.\n (Subsequent mismatches will not be reported)\n",
LogError(_("In GID %d, 'CFF ' advance width (%d) and 'hmtx' width (%d) do not match.\n (Subsequent mismatches will not be reported)\n"),
i, sc->width, lastwidth );
info->bad_metrics = true;
check_width_consistency = false;
Expand Down Expand Up @@ -4174,7 +4174,7 @@ return( enc );

static int badencoding(struct ttfinfo *info) {
if ( !info->bad_cmap ) {
LogError("Bad encoding information in 'cmap' table.");
LogError(_("Bad encoding information in 'cmap' table."));
info->bad_cmap = true;
}
return( -1 );
Expand Down Expand Up @@ -5090,10 +5090,10 @@ static void readttfos2metrics(FILE *ttf,struct ttfinfo *info) {
}

if ( info->os2_version==0 ) {
LogError("Windows will reject fonts with an OS/2 version number of 0\n");
LogError(_("Windows will reject fonts with an OS/2 version number of 0\n"));
info->bad_os2_version = true;
} else if ( info->os2_version==1 && info->cff_start!=0 ) {
LogError("Windows will reject otf (cff) fonts with an OS/2 version number of 1\n");
LogError(_("Windows will reject otf (cff) fonts with an OS/2 version number of 1\n"));
info->bad_os2_version = true;
}
}
Expand Down
6 changes: 3 additions & 3 deletions fontforge/parsettfatt.c
Expand Up @@ -5508,7 +5508,7 @@ return;
if ( variants!=0 )
ttf_math_read_variants(ttf,info,info->math_start+variants,justinuse);
if ( ftell(ttf)>info->g_bounds ) {
LogError("MATH table extends beyond table bounds");
LogError(_("MATH table extends beyond table bounds"));
info->bad_ot = true;
}
info->g_bounds = 0;
Expand Down Expand Up @@ -5632,7 +5632,7 @@ return;
tot = coordcnt = getushort(ttf);
if ( coordcnt!=curBase->baseline_cnt ) {
info->bad_ot = true;
LogError( "!!!!! Coord count (%d) for '%c%c%c%c' script does not match base tag count (%d) in 'BASE' table\n",
LogError(_("!!!!! Coord count (%d) for '%c%c%c%c' script does not match base tag count (%d) in 'BASE' table\n"),
coordcnt,
bs[i].tag>>24, bs[i].tag>>16, bs[i].tag>>8, bs[i].tag,
curBase->baseline_cnt );
Expand All @@ -5650,7 +5650,7 @@ return;
curScript->baseline_pos[j] = (short) getushort(ttf);
if ( format!=1 && format!=2 && format!=3 ) {
info->bad_ot = true;
LogError("!!!!! Bad Base Coord format (%d) for '%c%c%c%c' in '%c%c%c%c' script in 'BASE' table\n",
LogError(_("!!!!! Bad Base Coord format (%d) for '%c%c%c%c' in '%c%c%c%c' script in 'BASE' table\n"),
format,
curBase->baseline_tags[j]>>24, curBase->baseline_tags[j]>>16, curBase->baseline_tags[j]>>8, curBase->baseline_tags[j],
bs[i].tag>>24, bs[i].tag>>16, bs[i].tag>>8, bs[i].tag );
Expand Down
14 changes: 7 additions & 7 deletions fontforge/parsettfbmf.c
Expand Up @@ -95,7 +95,7 @@ return;
/* metrics from EBLC */
/* Do nothing here */
if ( metrics==NULL ) {
LogError( "Unexpected use of bitmap format 5, no metrics are appearant\n" );
LogError(_("Unexpected use of bitmap format 5, no metrics are appearant\n"));
info->bad_embedded_bitmap = true;
/*fseek(ttf,len,SEEK_CUR);*/
return;
Expand All @@ -104,17 +104,17 @@ return;
/* format 3 is obsolete */
/* format 4 is compressed apple and I'm not supporting it (Nor is MS) */
if ( imageformat==3 && !info->obscomplain ) {
LogError( "This font contains bitmaps in the obsolete format 3 (And I can't read them)\n" );
LogError(_("This font contains bitmaps in the obsolete format 3 (And I can't read them)\n") );
info->bad_embedded_bitmap = true;
info->obscomplain = true;
} else if ( imageformat==4 ) {
/* Apple doesn't describe it (fully) in their spec. */
/* MS doesn't support it (and doesn't describe) */
/* Adobe doesn't describe it (and says MS doesn't support it) */
LogError( "This font contains bitmaps in Apple's compressed format 4 (And I don't support that)\n" );
LogError(_("This font contains bitmaps in Apple's compressed format 4 (And I don't support that)\n"));
info->cmpcomplain = true;
} else if ( !info->unkcomplain ) {
LogError( "This font contains bitmaps in a format %d that I've never heard of\n", imageformat );
LogError(_("This font contains bitmaps in a format %d that I've never heard of\n"), imageformat );
info->bad_embedded_bitmap = true;
info->unkcomplain = true;
}
Expand Down Expand Up @@ -267,7 +267,7 @@ static void BdfCRefFixup(BDFFont *bdf, int gid, int *warned, struct ttfinfo *inf
prev = head;
} else if ( !*warned ) {
/* Glyphs aren't named yet */
LogError("Glyph %d in bitmap strike %d pixels refers to a missing glyph (%d)",
LogError(_("Glyph %d in bitmap strike %d pixels refers to a missing glyph (%d)"),
gid, bdf->pixelsize, head->gid );
info->bad_embedded_bitmap = true;
*warned = true;
Expand Down Expand Up @@ -369,7 +369,7 @@ static void readttfbitmapfont(FILE *ttf,struct ttfinfo *info,
last = getushort(ttf);
moreoff = getlong(ttf);
if ( last<first ) {
LogError( "Bad format of subtable %d (of %d) in bloc/EBLC of strike with pixelsize=%d. First=%d, last=%d.\n",
LogError(_("Bad format of subtable %d (of %d) in bloc/EBLC of strike with pixelsize=%d. First=%d, last=%d.\n"),
j, head->numIndexSubTables, bdf->pixelsize, first, last );
info->bad_embedded_bitmap = true;
continue;
Expand Down Expand Up @@ -461,7 +461,7 @@ static void readttfbitmapfont(FILE *ttf,struct ttfinfo *info,
free(glyphs);
break;
default:
LogError("Didn't understand index format: %d\n", indexformat );
LogError(_("Didn't understand index format: %d\n"), indexformat );
info->bad_embedded_bitmap = true;
break;
}
Expand Down
4 changes: 2 additions & 2 deletions fontforge/plugins.c
Expand Up @@ -57,13 +57,13 @@ void LoadPlugin(char *dynamic_lib_name) {
}
plugin = dlopen(dynamic_lib_name,RTLD_LAZY);
if ( plugin==NULL ) {
LogError("Failed to dlopen: %s\n%s", dynamic_lib_name, dlerror());
LogError(_("Failed to dlopen: %s\n%s"), dynamic_lib_name, dlerror());
free(freeme);
return;
}
init = (int (*)(void)) dlsym(plugin,"FontForgeInit");
if ( init==NULL ) {
LogError("Failed to find init function in %s", dynamic_lib_name);
LogError(_("Failed to find init function in %s"), dynamic_lib_name);
dlclose(plugin);
free(freeme);
return;
Expand Down
2 changes: 1 addition & 1 deletion fontforge/print.c
Expand Up @@ -536,7 +536,7 @@ static void pdf_BrushCheck(PI *pi,struct glyph_res *gr,struct brush *brush,
int lenpos, lenstart, len;

if ( pattern_sc==NULL )
LogError("No glyph named %s, used as a pattern in %s\n", pat->pattern, sc->name);
LogError(_("No glyph named %s, used as a pattern in %s\n"), pat->pattern, sc->name);
PatternSCBounds(pattern_sc,&b);

if ( gr->pattern_cnt>=gr->pattern_max ) {
Expand Down

0 comments on commit 6428f59

Please sign in to comment.