作図ソフト dia の改良版
修訂 | d65fef0f6ed63df5cbdb6fdfccbf361fe20cba07 (tree) |
---|---|
時間 | 2004-05-16 08:48:12 |
作者 | Lars Clausen <lclausen@src....> |
Commiter | Lars Clausen |
Fig import font prob.
@@ -1,4 +1,7 @@ | ||
1 | 1 | 2004-05-15 Lars Clausen <lars@raeder.dk> |
2 | + | |
3 | + * plug-ins/xfig/xfig-import.c: Handle default fonts and illegal | |
4 | + fonts better (#138655) | |
2 | 5 | |
3 | 6 | * doc/pl/Makefile.am (EXTRA_DIST): Also include all xml files here. |
4 | 7 |
@@ -1270,7 +1270,27 @@ fig_read_text(FILE *file, DiagramData *dia) { | ||
1270 | 1270 | tprop->attr.alignment = sub_type; |
1271 | 1271 | tprop->attr.position.x = x/FIG_UNIT; |
1272 | 1272 | tprop->attr.position.y = y/FIG_UNIT; |
1273 | - tprop->attr.font = dia_font_new_from_legacy_name(fig_fonts[font]); | |
1273 | + | |
1274 | + if (font_flags & 4) { | |
1275 | + switch (font) { | |
1276 | + case 0: tprop->attr.font = dia_font_new_from_legacy_name("Times-Roman"); break; | |
1277 | + case 1: tprop->attr.font = dia_font_new_from_legacy_name("Times-Roman"); break; | |
1278 | + case 2: tprop->attr.font = dia_font_new_from_legacy_name("Times-Bold"); break; | |
1279 | + case 3: tprop->attr.font = dia_font_new_from_legacy_name("Times-Italic"); break; | |
1280 | + case 4: tprop->attr.font = dia_font_new_from_legacy_name("Helvetica"); break; | |
1281 | + case 5: tprop->attr.font = dia_font_new_from_legacy_name("Courier"); break; | |
1282 | + default: message_warning("Can't find LaTeX font nr. %d, using sans\n", font); | |
1283 | + tprop->attr.font = dia_font_new_from_legacy_name("Helvetica"); | |
1284 | + } | |
1285 | + } else { | |
1286 | + if (font == -1) font = "Times Roman"; /* "Default font" - wazzat? */ | |
1287 | + if (font < 0 || font > 34) { | |
1288 | + message_warning("Can't find Postscript font nr. %d, using sans\n", font); | |
1289 | + tprop->attr.font = dia_font_new_from_legacy_name("Helvetica"); | |
1290 | + } else { | |
1291 | + tprop->attr.font = dia_font_new_from_legacy_name(fig_fonts[font]); | |
1292 | + } | |
1293 | + } | |
1274 | 1294 | tprop->attr.height = font_size*3.54/72.0; |
1275 | 1295 | tprop->attr.color = fig_color(color); |
1276 | 1296 | newobj->ops->set_props(newobj, props); |