*** Description of problem: There is a problem using scalable fonts in XFig. Basically, with a "virgin" FC-3, -4 or -5 installation, the URW scalable fonts are not found, and so the on-screen display is severely limited for text objects at zooms different to 1 and for text-sizes other than the default. XFig can still be used, but positioning text objects accurately in relation to other objects becomes impossible. Related to this is the total absence of the AvantGarde fonts from XFig's display. Other, apparently similar, font problems are mentioned in bugs 56940, 116542 and 195468, but my problem seemed different enough to create a new bug-report. *** Version-Release number of selected component (if applicable): My version is xfig-3.2.4-17.2, but FC-3's releases have it too, and I believe that xfig-3.2.4-21.1 from devel has it too. *** How reproducible: Very *** Steps to Reproduce: 1. Start XFig 2. Change zoomlevel to 3 3. Select 15-pt TimesItalic 4. Put in some text, and see that it looks wonky. *** Solution Going over the sources, you'll find that the fonts are all hard-coded into the file u_fonts.c. Basically Xfig will try to find the font you selected by looking through a list provided in u_fonts.c . The trouble is that the URW fonts are named differently to the fonts provided in earlier Red Hat distributions (6.2, for example). So you have the right fonts on your system, but XFig looks for them with the wrong names. The author of Xfig recommends the installation of the Adobe fonts, but I really think for such a simple problem there must a simpler solution! I've got a patch attached that patches u_fonts.c with the names of the correct URW fonts, and als patches w_drawprim.c . In the latter file, some jiggery-pokery is done to ensure that the zapf dingbats font is found, but on virgin FC distributions this font will be named -urw-dingbats. It's a silly solution, I know. XFig's font-handling really ought to be made more general, but I can't think how.
Created attachment 138229 [details] Patch to fix Xfig's scalable fonts handling
Created attachment 138230 [details] Patch to fix XFig's scalable font handling
*** Bug 56490 has been marked as a duplicate of this bug. ***
Thanks for the patch! I've incorporated it into xfig-3.2.5-5, which should show up in updates-testing for both F-7 and F-8 in the next couple of days. When xfig-3.2.5-5 becomes available, the updates system will add a comment here to notify you of this. Then you can install it with this command: yum --enablerepo=updates-testing update xfig Note when testing on F-8, that there might be a problem with your font configuration there, do: "/usr/share/fonts/default/Type1" and if there is no fonts.dir file there, run this as root: mkfontdir /usr/share/fonts/default/Type1 And then do: "xset fp rehash" to reload X's font configuration.
xfig-3.2.5-5.fc7 has been pushed to the Fedora 7 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update xfig'
xfig-3.2.5-5.fc8 has been pushed to the Fedora 8 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update xfig'
Dear Hans & Co The patch I submitted earlier was a dirty hack, designed to get XFig running on my system as quickly as possible. It's not a complete solution to the problem at all. For example, I don't expect the patched XFig to work on all other distributions. I'd like to get some ideas from you guys for a more civilized fix. I REALLY don't like the fact that the fonts are hard-coded in as they are. Here are some suggestions for more civilized behaviour: 1. we put a two-column text file somewhere that XFig can read, containing the names of the standard XFig fonts (say Times-Roman, Times-Bold, ...) on the left and the URW font names (say -urw-times-medium-r-normal--0-0-0-0-p-0-iso8859-1, etc.) on the right. Then struct _xfstruct x_fontinfo can be initialized from this file. This way, users have the option to specify different display fonts without having to recompile the program, and XFig would then be portable from one distro to another without the need to recompile. (Down side: exposure to the nut behind the wheel) 2. A configuration program, similar to the existing XFig font dialog might be provided to produce the text file in (1), perhaps using xfontsel to select the fonts. So you might start this hypothetical XfigFontConf, click on the button that says "Helvetica Bold"; this brings up XFontSel, perhaps primed some of the relevant information via the -pattern option, and allows the user to select the relevant font. (Down side: Seems fool-proof, but they're sure to improve the fools. Also, now there are two programs to maintain...) 3. As a further refinement, we might build this hypothetical XfigfontConf into XFig, which can already detect missing scalable fonts (it gives error messages, if I recall, if you select a missing font). Of course, all of these have pitfalls. Remember, these select DISPLAY fonts, not the fonts that end up in PostScript files, etc., which are themselves also hard-coded. Does anybody have any better ideas? I must say, the font-handling in X does seem to be extremely complicated from the user's perspective, compared to certain other operating $ystems... Regards, FN
(In reply to comment #7) > Dear Hans & Co > > The patch I submitted earlier was a dirty hack, designed to get XFig running on > my system as quickly as possible. It's not a complete solution to the problem > at all. For example, I don't expect the patched XFig to work on all other > distributions. I'd like to get some ideas from you guys for a more civilized fix. > Well since this is the Fedora package its not meant to work on other distro's OTOH, if they have the urw-fonts installed it should work fine. I've checked the .fig files and they do not contain the font-names, so this will not cause import / export problems when moving to other versions / spins of xfig. So while I agree this is not perfect, as long as we require urw-fonts (and we do) this works just fine. I've read your proposed solutions but they seem to cause more pain then they fix. Our current fixed version "just works (tm)", without needing any tweaking, I think that is as good as it gets, without getting unnecessary complicated.
xfig-3.2.5-5.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.
It's a bug in urw-fonts which adds to the pain: #401641. A workaround until a update is released is the following: # As root: $ rpm -e --nodeps urw-fonts # There must be two yum steps $ yum install xorg-x11-font-utils $ yum install urw-fonts # X user $ xset fp rehash With this fix, and xfig-3.2.4-5 package thing works. BTW: thanks for Xaw3d version, Hans!
xfig-3.2.5-5.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.