Again, xfig lost fonts

xfig has a long-standing weakness - sometimes it cannot grab the right fonts.

In my opensuse 13.2, after some changes in hardware (replaced graphics card and monitor), xfig does not work with fonts correctly. The fonts shown on screen are stretched too much, meanwhile in pdf export they are correct.

An older thread on similar problem in opensuse 11.3 does not help.

Any hints?

Would sound like a display DPI issue to me.

Is your graphics driver working correctly (which one are you using)?
Is your monitor and its DPI working correctly?
What does this say?

xdpyinfo |egrep "resol|dime"

Oh, and I think your title is a bit misleading…
IIUYC, xfig didn’t “lose” the fonts at all. :wink:

Yes, maybe it is a DPI issue.

The look of LibreOffice is also confused: menu’s icons, menu’s texts are in wrong places. Same for a newly-created user.

However, all parts of drawings in xfig that do not contain text are correct.

The graphics driver is the latest from Nvidia. Works correctly.

The monitor works correctly. Cannot say whether its DPI works correctly.


xdpyinfo |egrep "resol|dime"
  dimensions:    1920x1200 pixels (554x350 millimeters)
  resolution:    88x87 dots per inch

The values seem to be sane at least.
Are the reported dimensions correct? I.e. does the screen have a native resolution of 1920x1200, and is its size 554x350 millimeters?
Have you manually changed the resolution in your desktop’s settings, or via nvidia-settings?

Also, which Desktop are you using?
In KDE you can override the DPI values used for fonts in “Application Appearance”->“Fonts”. Try to toggle that setting.

The reported values for the monitor are correct.

I haven’t chaged anything in nvidia-setings.

Have since then reinstalled the nvidia driver.

I use KDE. The Forced DPI was not set. Setting it to different values (96, 88) has no effect on the defects after restart.

xfig as the name suggests relies on the X fonts; it sounds as if the text related parameters being passed to X following the hardware installation are wrong.

I did a fresh install.

xfig was working correctly with nouveau.

When I installed the nvidia driver, xfig got broken again. Namely, the letters and gaps between the letters are stretched in horizontal direction on the screen about 30% more than they should. As a result, the text in a pdf drawing does not fit there where it is visible in the xfig’s window.

Does anybody run an xfig successfully with nvidia driver installed?

xorg.conf and nvidia-settings do not contain anything about fonts.

Ubuntu users say that a package called gsfonts-x11 must be installed. But there is no such package in opensuse.

All other things work.

I don’t use the nvidia driver.

xorg.conf and nvidia-settings do not contain anything about fonts.

The Xorg font settings are not in there, but you could of course change the resolution and/or DPI there.

But AFAIK KDE’s font settings should affect Xorg’s settings as well.

Maybe this would help?
https://wiki.archlinux.org/index.php/font_configuration#Troubleshooting

Ubuntu users say that a package called gsfonts-x11 must be installed. But there is no such package in opensuse.

There is ghostscript-fonts-std and ghostscript-fonts-other. But missing fonts cannot really be your problem I’d say, as it works fine with nouveau…
Maybe it would be interesting to compare the DPI value when nouveau is in use and set the same for the nvidia driver?

I have the ghostscript-fonts-std and ghostscript-fonts-other installed.

When I change DPI in KDE’s “Configure Desktop”, all programs’ fonts change besides xfig’s. Neither the menu font nor my text fonts change in xfig. It looks like xfig ignores the DPI and works pixels, not millimeters.

How can I uninstall or disable the nvidia driver?

Go to yast search for it and uninstall all files that have nvidia in the name

With difficulty, I resolved the issue.

I tried xfig in Gnome, where it worked. But the monitor’s sizes and DPI were reported differently from those in KDE.

I found the sizes of the monitor in its manual. As it appears, both KDE and Gnome reported it wrongly. They were off by a few percent. The calculated DPI, however, was correct.

I installed again the Nvidia driver, let it create xorg.conf. There, I made two additions to Monitor section:


Section "Monitor"
    Identifier     "Monitor0"
    DisplaySize     518  324  # In millimeters
    Option         "DPI" "94 x 94"
    ....

(DisplaySize and DPI can only be integer numbers; otherwise I would have given decimals for better accuracy.)

Rebooted, and xfig works!

This was a big deal of work me - I worked on it for several days. Tried nouveau, old Nvidia driver, variety of font installations, renaming and repositioning of fonts, issuing various commands to manipulate fonts, reinstalling xfig and other packages, removing the Nvidia driver, deleting xorg.conf, changing font DPI in KDE (this has no effect on xfig), reinstalling the OS, installing old version of xfig, etc.

However, there are a few questions for me left, only out of curiosity:

  • Where do KDE, Gnome and other components of graphical system pick up information about hardware, and why each picks up different numbers?

  • Why xfig worked correctly in Gnome even though the X server had slightly wrong information about the monitor?

  • Why is it that the error in monitor’s size was a few percent, but the error in fonts’ sizes was about 30%?

  • Is it so difficult to deal with fractional numbers in xorg.conf? Both sizes and DPI are by their nature irrational numbers. (This is a reminder for those who wrote the relevant parts of the X system ;).)

Thanks to all who helped. Especially useful was the xdpyinfo |egrep “resol|dime”

command.