GNOME Bugzilla – Bug 70327
Failure to import Applixware sheet: "Unknown font modifier"
Last modified: 2009-08-15 18:40:50 UTC
I've been having problems importing an Applixware spreadsheet. I've managed to whittle the problem down to a 2-cell spreadsheet; I have two versions of this sheet, one which Gnumeric fails to import and one which it can import. The sheet looks like this: A1: empty B1: 0.0 The problem seems to lie in the formatting of cell A1. Version 1 of my test spreadsheet (which I'll attempt to attach as test1.as) has whatever formatting was leftover from the original spreadsheet that triggered the problem. Version 2 (test2.as) differs from version 1 only in that I have cleared everything from cell A1, ie. hit Ctrl-D on it (in Applixware!). This presumably clears all formatting and content from the cell. When I attempt to import test1.as to Gnumeric 1.0.2, I get an error dialog saying Parse error while reading Applix file. Unknown font modifier Importing test2.as works just fine. Not surprisingly the text diff between test1.as and test2.as is very small: --- test1.as Fri Feb 1 18:08:02 2002 +++ test2.as Fri Feb 1 18:08:02 2002 @@ -61 +60,0 @@ -<(CO2|TF0,fg|) > @@ -130 +129 @@ -Row List A !1: 0-0:3 +Row List A !1: 0-0:1 I imagine someone who reads Applixware files would understand this; I don't. ;-) Anyways, I'll attempt to attach the two test files to this bug report so someone can play with them and see if Gnumeric can be persuaded to import test1.as. It's just two cells, after all, and one of them's empty...
Created attachment 6580 [details] Applix spreadsheet that Gnumeric fails to import
Created attachment 6581 [details] Slight variation on test1.as which Gnumeric can import
Hmm, I'm going to need help from someone with Applix on this. The issue is the TF0. That indicates that the format is using font index '0' However, my guess was that the index was ONE based. TF1 is the lowest index that should have been possible. It would be very helpful if you can send me an applix workbook where each of lets say 5 cells uses a different font. Not just different sizes,or boldness. Different actual faces. This would help me track how the offset works. Once that is know the fix should be pretty trivial.
Created attachment 6678 [details] requested Applix spreadsheet: 5 cells, 5 fonts
OK, I've just uploaded 5fonts.as which, as requested, has 5 cells with 5 different typefaces: A1: helvetica A2: courier A3: avant garde A4: palatino A5: times Interestingly enough, Gnumeric imports this spreadsheet, but it gets the fonts wrong: helvetica -> Helvetica courier -> Helvetica avant garde -> Times palatino -> Morewingbats times -> Zapf Dingbats
Perfect, that clarifies things nicely. The index is 0 based rather than 1. The patch is trivial and will be in 1.0.5 scheduled for Mar 1. Index: applix-read.c =================================================================== RCS file: /cvs/gnome/gnumeric/plugins/applix/applix-read.c,v retrieving revision 1.40 diff -u -w -r1.40 applix-read.c --- applix-read.c 2002/01/10 21:30:05 1.40 +++ applix-read.c 2002/02/10 19:11:03 @@ -553,10 +553,10 @@ char *start = (sep += 2); int font_id = strtol (start, &sep, 10); - if (start == sep || font_id < 1 || font_id > (int)state->font_names->len) + if (start == sep || font_id < 0 || font_id >= (int)state->font_names->len) (void) applix_parse_error (state, "Unknown font modifier"); else { - char const *name = g_ptr_array_index (state->font_names, font_id-1); + char const *name = g_ptr_array_index (state->font_names, font_id); mstyle_set_font_name (style, name); } break;