My XFig is 3.2.9, and this is how I created test2.fig, the file that breaks fig2dev
1. open test1.fig with XFig 2. add the text "Below a dimension line with user text" somewhere 3. select "Polyline drawing" in the left toolbar 4. click the button at the right of the bottom toolbar "Dimension line\nline tick=1" 5. in the pop-up window that allows to you to define dimension lines properties, select the option "User defined text" at the bottom 6. draw a dimension line (shift-left click, left click to end) 7. there is a popup, asking for the user text to place in the dimension box of the dimension line, I often see 9.5cm, I always see a "very negative" y coordinate 8. save as test2.fig (all these strange numbers inside!) 9. fig2dev sees these strange negative numbers and cannot reasonably move on. I add that I see the same problem on Debian Sid and on Suse Tumbleweed (i.e., the other computer that I've mentioned in my previous mail) so it's likely an upstream problem. Thank you for your time ፨ g On Fri, Aug 23, 2024 at 5:39 PM Roland Rosenfeld <rol...@debian.org> wrote: > Hi Giacomo! > > On Fri, 23 Aug 2024, Giacomo Boffi wrote: > > > after a more thorough investigation I'd say it's not fig2dev but > > it's XFig itself. The current fig2dev works ok, as Roland found, on > > all my old .fig files, and works OK with new .fig files as well, > > unless I use a dimension line > > > with user defined text: > > 1. the interaction is awkward, sometimes the dimension line is not > > visible, > > 2. using fig2dev on the saved file leads to the problems that I've > > described > > I attach two files, a generic test1.fig in which I placed some > > random stuff, and test2.fig, the same but with an additional > > dimension line. > > As far as I can see, not the dimension line is the problem but line 46 > of test2.fig: > > 4 1 0 48 -1 0 12 -0.0000 4 118 685 1440 -2147483648 user text\001 > > Here the -2147483648 triggers the problem, this parameter is the y > coordinate of the text (type integer). Since sub_type=1 here, this is > the lower center. Seems that this may be some integer overflow, since > this number is -2^31. > If I change this entry to a smaller value, the file can be converted. > BTW: this text line "user text" usually isn't visible in xfig, since > it's outside the visual pane. > > The interesting question is, how exactly did it happen, that this > entry was created (sounds like a bug in xfig) and why fig2dev doesn't > handle -2^31 correctly here. > > > When I insert the dimension line, I see a wrong y position in the > > pop-up (see test2.png in attachment) and a spurious 9.5cm on the > > canvas. > > I just noticed, that we are talking about 2 different dimension > lines. The 5.5cm one, which already exists in test1.fig and a new > dimension line with the text "user text", that was added in > test2.fig. In this new dimension line (which is a compound object) we > have multiple numbers near -2^31, which does not make much sense to me: > > # Dimension line: User-defined text > 6 225 -2147483610 2655 135 > ^^^^^^^^^^^ > # main dimension line > 2 1 0 1 0 4 50 -1 -1 4.000 0 0 -1 1 1 2 > 1 1 1.00 60.00 120.00 > 1 1 1.00 60.00 120.00 > 225 -2147483648 2655 -2147483648 > ^^^^^^^^^^^ ^^^^^^^^^^^ > # text box > 2 3 0 0 0 7 49 -1 20 0.000 0 0 -1 0 0 5 > 1038 -119 1038 119 1842 119 1842 -119 1038 -119 > # tick > 2 1 0 1 0 4 50 -1 -1 4.000 0 0 -1 0 0 2 > 225 -2147483648 225 -2147483529 > ^^^^^^^^^^^ ^^^^^^^^^^^ > # tick > 2 1 0 1 0 4 50 -1 -1 4.000 0 0 -1 0 0 2 > 2655 -2147483648 2655 -2147483529 > ^^^^^^^^^^^ ^^^^^^^^^^^ > # fixed text > 4 1 0 48 -1 0 12 -0.0000 4 118 685 1440 -2147483648 user text\001 > ^^^^^^^^^^^ > -6 > > So where the hell should this dimension line be placed with this y > coordinates? > > In contrast to your screenshot I do not see this "9.5 cm" in test2.fig > nor is it shown in the right upper position of the figure, when I open > test2.fig in xfig. > > > I imagine that this bug report against fig2dev must be > > closed, and a bug report against xfig must be filed, but at the > > moment I'm using another PC w/o Debian/reportbug and I wonder if, > > after confirmation, you can file an appropriate bug report. > > It would be good if you could tell me how you created the above broken > dimension line. I tried this myself using xfig 3.2.9-3 but all > dimension lines that I crated had "normal" dimensions and could be > converted to PDF. > How do you create them? I did by using the polyline tool, press > shift, left-click on the starting point, (optionally: release shift), > and left-click on the end point. > Did you do something different? > Or did you so some modification of the dimension line and/or some > parts of the compound around it after creating it (which one > exactly?). At least the "user text" instead of someting like "9.5 cm" > looks unusual... > > Greetings > Roland >