Menu

#6 xfig rotating text problem

xfig
closed
nobody
None
2023-08-25
2016-12-14
No

Hello. I suspect this may be an installation issue, but I can not find a discussion elsewhere on the web.

I am running 5.3.2c on Ubuntu 16.04. I can see on screen all the ps and latex fonts at angle=0.0, but the text goes blank when I rotate from 0.0 (including 90.0). The text is correctly rotated in the exported PDF file.

Am I missing some font files? Here is my font list from xset
Font Path:
/usr/share/fonts/X11/misc,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins

If there are no obvious solutions, is it possible compiling 3.2.6 will help?

Below are the results of some tests I ran using: XFIG_LC_CTYPE=C xfig -deb test5.fig

Conditions:
New file, no objects, create text at 12pt and zoom=1: text appears at angle = 90, 180, 270, 360.

set rotation angle=45: text appears only at 90, 180, 270, 0. No text at 45, 135, etc.

set zoom=2: text appears only at angle 0.

set zoom =1, text at 13pt:
font fnd: Loading font --times-medium-r-normal--14------ISO8859-*
but, text appears at 0, 90, 180 etc but not at 45, 135 etc.

set text at 20 pt: a font fnd: but a warning
Warning: translation table syntax error: Missing '(' while parsing action sequence
'arning: ... found while parsing ':~Ctrl<key>1: insert-string(1)
Warning: String to TranslationTable conversion encountered errors
remove depth 50, count=0
Text[50] count=0
No objects
Loading font --times-medium-r-normal--22------ISO8859-*
However, no text appears at either 90 etc or 45 etc.; only at 0 degrees.</key>

Set text back to 12pt: Same warning about TranslationTable. Text appears only at 0, 90, etc.

Thanks for any help.

Discussion

  • tkl

    tkl - 2016-12-14

    This issue seems to be related to issues outside of xfig. Here, I had the opportunity to try xfig3.2.5c on ubuntu 16.06.1. Text is drawn properly at 45 degrees and zoom factors other than 1. The Translation Table warning is a different issue.
    I am afraid that installing a newer version would not help. I believe, you could install xfig3.2.6 by first installing libpng16-16, apt-get install libpng16-16, and then manually downloading and installing the package for ubuntu 16.10, e.g., here for amd. This would be simpler than downloading the newest sources and compiling them. With the downside, that in the latter case two versions could co-exist, one in /usr/share/bin and the other in /usr/local/share/bin.
    Let me know, if you would like to investigate the issue closer. As a first step, one would have to uncomment the DEBUG_PRINT* macros in w_rottext.c and re-compile.

     
    • James Haefner

      James Haefner - 2016-12-15

      Thanks for the quick reply. It does sound like a problem at my end, as I thought. I will first try a complete removal of my current xfig, then do a new package install of 3.2.5c. If that doesn't work, I'll try installing the 3.2.6 package from ubuntu 16.10, as per the suggestion above. If that fails, I'll consider compiling 3.2.6 from source.

       
  • James Haefner

    James Haefner - 2016-12-16

    A fresh install of 3.2.5c on ubuntu 6.04 did not change anything. At zoom=1 there is rotation at 90, 180, 270. But at zoom=2 there is screen text only at 0, while the exported pdf file has it correctly rotated. Surely this means that transfig (presumably) knows what to do but my X font server does not. If so, I'm skeptical that installing the package 3.2.6 will succeed. Any suggestions to try before I attempt to use 3.2.6?

     
  • tkl

    tkl - 2016-12-16

    First, you are correct that the export to any format is done by a different program, fig2dev to be precise. The graphical user interface, xfig, creates files in fig-format. When exporting, xfig calls fig2dev, which converts the saved fig-file to various formats. So, drawing in xfig and exporting are entirely independent.

    In xfig, text is rotated by first creating an X-image with horizontal text, then the image is rotated and a new image is created. The rotation is computed by xfig in the function XRotCreateTextItem() in w_rottext.c. This routine uses a shortcut when rotating by a multiple of pi/2. Also, this routine is unchanged beween versions 3.2.5c and 3.2.6. To conclude, the only reason I can presently find why rotation works in one case and not in another is, that an X image can not be allocated. If memory would be an issue, this could be tested by rotating a single letter on an otherwise blank canvas. The possibility to rotate by multiples of pi/2 puzzles me, and I do not have an explanation for that. I am unfortunately not too familiar with X, therefore I am sorry but I do not have a better suggestion.

     
  • Fabiano Baroni

    Fabiano Baroni - 2018-08-13

    Hello,

    I was wondering if there was any update on this problem.

    I'm having the same problem with xfig 3.2.5 on Ubuntu 16.04.5 LTS. Updating to 3.2.7a did not solve the problem.

    On my laptop I have an older version of Ubuntu (12.04.5 LTS), there xfig 3.2.5b displays rotated text without any issue. Hence, the issue seems definitely due to something external from xfig (X11 or some font issue, I don't know). However, it is a pretty serious issue since it makes xfig nearly unusable (at least for my purposes).

    Thank you for any suggestion, best regards

     
    • tkl

      tkl - 2018-08-13

      Dear Fabiano,

      unfortunately, I still do not know the origin of the problem with
      displaying rotated text under ubuntu 16.04. It does not seem to be a
      font issue, since the font is found. Currently, I do not have access to
      a computer with ubuntu 16.04, hence for some time I cannot look into
      that issue.

       

      Last edit: tkl 2018-08-15
  • Fabiano Baroni

    Fabiano Baroni - 2018-08-14

    Ok, thank you for your feedback. Maybe I just need to update to Ubuntu 18.04 and that should solve the problem?

    Thank you, best

     
    • tkl

      tkl - 2018-08-15

      It might help, but I am not sure. Since I could not reproduce the problem on an installation of Ubuntu 16.04 I had access to, this issue is probably not linked to a specific release of the operating system. Is yours a stock install of ubuntu 16.04? Can it be related to the graphic driver / graphic card? The installation of 16.04 where xfig worked flawless was on quite modern hardware.

       
  • Fabiano Baroni

    Fabiano Baroni - 2018-08-15

    My graphic card is fairly modern (Intel HD Graphics 530 (Skylake GT2)), and I installed ubuntu 16.04 directly (I did not upgrade to it from a previous version).

    I might try updating to 18.04 then. Many thanks,

     
    • James Haefner

      James Haefner - 2018-08-15

      I too am still interested in a solution. Fabiano's mention that his 16.04 is a fresh install (not an upgrade) suggests that there are not configuration issues causing the problem. These might have been carried over from a previous install/upgrade, but not if he started from a newly partitoned drive. I also question that there is an issue w/ the graphics card. A program similar to xfig is "ipe". It does rotations of all of its drawing objects (text, rectangles, etc) just fine. I assume but do not know to what extent it relies on X-windows to do its drawing. I would switch to ipe from xfig, but xfig's UI is much cleaner and ipe can't import xfig files, as far as I know. [UPDATE: ipe can import some fig files using the external program "figttoipe":
      http://ipe.otfried.org/manual/manual_57.html ]

      (There are some known bugs in the 16.04 X windows distribution that might be fixed in 18.04 which would be another reason for upgrading.)

       

      Last edit: James Haefner 2018-08-15
  • tkl

    tkl - 2018-08-23

    I had the opportunity to run ubuntu 16.04.5 live from an USB-stick, on two different machines, but could not reproduce the issue. Text was drawn at angles (15°, 30 °) and at different zoom factors. Having installed no further fonts, a fall-back fixed font (6x13, in my case) was rendered, but at least something, maybe with the wrong font, maybe at a wrong size, was rendered. I am sorry, but I am unable to give any informed suggestion on how to fix the issue.

    The walkthrough in the ubuntu live system is

    # add " universe" at the end of the relevant repository line
    sudo vi /etc/apt/sources.list
    sudo apt update
    sudo apt install --no-install-recommends xfig
    xfig -deb   # works, but uses fixed font 6x13
    sudo apt install --no-install-recommends xfonts-100dpi
    xset fp+ /usr/share/fonts/X11/100dpi
    xset fp rehash
    xfig -deb   # works, renders fonts correctly
    
     
  • tkl

    tkl - 2023-08-25
    • status: open --> closed
    • xfig / fig2dev: --> xfig
     
  • tkl

    tkl - 2023-08-25

    With all X font text rotation routines deleted from xfig, and drawing fonts using the xft library, the issues described above can not apply any longer.

     

Log in to post a comment.

MongoDB Logo MongoDB