get rid of the lib/xfonts hack

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10238 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2005-07-16 11:06:12 +00:00
parent f0492e4ba3
commit 4f96e3c41e
13 changed files with 25 additions and 146 deletions

View File

@ -1,3 +1,7 @@
2005-07-16 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* INSTALL: lib/xfonts is dead.
2005-07-15 <lgb@tandberg.net>
* configure.ac: set AWK to gawk and subsitute

View File

@ -96,12 +96,8 @@ maths symbols displayed properly. To find out, type:
at the console. Both RH8 and Debian unstable distributions are known
to use fontconfig.
If, however, your version of Qt does not use fontconfig, then the
/usr/local/share/lyx/xfonts directory (or equivalent) should be added to
the font path. This is done automatically by LyX if LyX is run on
the local machine, and the X server supports Postscript fonts. If, however,
you're running LyX remotely, then you'll have to do this step yourself.
'man xset' is your friend.
If, however, your version of Qt does not use fontconfig, then TeX
fonts should be added to the font path. 'man xset' is your friend.
* Other things to note

View File

@ -1,3 +1,8 @@
2005-07-16 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* Win32/packaging/package_lyxwin.sh:
* Win32/packaging/README: lib/xfonts is dead.
2005-07-07 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* FORMAT: document change to format 242.

View File

@ -34,8 +34,7 @@ the process:
* Remove all stuff generated by running configure. It makes sense on
your machine only, not for whoever is installing LyX. Specifically
xfonts/fonts.dir, xfonts/fonts.scale, doc/LaTeXConfig.lyx,
lyxrc.defaults, packages.lst and textclass.lst
doc/LaTeXConfig.lyx, lyxrc.defaults, packages.lst and textclass.lst
should all be removed.

View File

@ -17,7 +17,6 @@
# ensure that the generated .dvi file is usable.
# It removes all stuff generated by running configure:
# xfonts/
# doc/LaTeXConfig.lyx
# lyxrc.defaults
# packages.lst
@ -97,7 +96,6 @@ a\
# Strip the executables
(
cd "${LYX_INSTALL_DIR}/Resources/lyx"
rm -rf xfonts
for file in doc/LaTeXConfig.lyx lyxrc.defaults packages.lst textclass.lst
do
rm -f $file

View File

@ -6,4 +6,3 @@ lyxrc.defaults
listerrors
Literate.nw
configure
xfonts

View File

@ -896,30 +896,6 @@ $(srcdir)/configure: $(srcdir)/configure.m4
lyxrc.defaults: $(srcdir)/configure
$(SHELL) $<
install-xfonts:
test -f xfonts/fonts.dir || exit 0 ; \
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/xfonts ; \
files=`sed -e 's/^[0-9]*$$//' -e 's/^\([^ ]*\) .*$$/\1/' xfonts/fonts.dir` ; \
for i in $${files} ; do \
ln -f -s `kpsewhich $$i` $(DESTDIR)$(pkgdatadir)/xfonts/$$i ; \
done ; \
$(INSTALL_DATA) xfonts/fonts.dir $(DESTDIR)$(pkgdatadir)/xfonts/fonts.dir ; \
$(INSTALL_DATA) xfonts/fonts.scale $(DESTDIR)$(pkgdatadir)/xfonts/fonts.scale ; \
if test -f xfonts/PSres.upr ; then \
$(INSTALL_DATA) xfonts/PSres.upr $(DESTDIR)$(pkgdatadir)/xfonts/PSres.upr ; \
fi
uninstall-xfonts:
rm -rf $(DESTDIR)$(pkgdatadir)/xfonts
distclean-local:
rm -rf xfonts
install-data-local: install-xfonts
uninstall-local: uninstall-xfonts
install-data-hook:
$(CHMOD) 755 $(DESTDIR)$(pkgdatadir)/configure
for i in $(dist_scripts_DATA); do \

View File

@ -199,7 +199,7 @@ esac
#### Create the build directories if necessary
for dir in bind clipart doc examples help images kbd layouts reLyX \
scripts templates ui xfonts; do
scripts templates ui ; do
test ! -d $dir && mkdir $dir
done
@ -699,45 +699,10 @@ then
echo "\\cygwin_path_fix_needed $use_cygwin_path_fix" >> $outfile
fi
######## X FONTS
# create a fonts.dir file to make X fonts available to LyX
echo "checking for TeX fonts"
fontlist="cmex10 cmmi10 cmr10 cmsy10 eufm10 msam10 msbm10 wasy10"
rm -f xfonts/fonts.dir xfonts/fonts.scale xfonts/tmpfonts
num=0
touch xfonts/tmpfonts
for font in $fontlist ; do
MSG_CHECKING(for $font,+)
result=no
for ext in pfb pfa ttf ; do
if filepath=`kpsewhich $font.$ext` ; then
result="yes ($ext)"
rm -f xfonts/$font.$ext
ln -s $filepath xfonts 2>/dev/null
echo "$font.$ext -unknown-$font-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific" >>xfonts/tmpfonts
num=`expr $num + 1`
break
fi
done
MSG_RESULT($result)
done
if test ! $num = 0 ; then
echo $num >xfonts/fonts.scale
cat xfonts/tmpfonts >>xfonts/fonts.scale
cp xfonts/fonts.scale xfonts/fonts.dir
# create a resource list file for Display Postscript
(cd xfonts ; rm -f PSres.upr ; makepsres) 2>/dev/null || true
fi
rm -f xfonts/tmpfonts
# Remove superfluous files if we are not writing in the main lib
# directory
for file in $outfile textclass.lst packages.lst \
doc/LaTeXConfig.lyx xfonts/fonts.dir ; do
doc/LaTeXConfig.lyx ; do
# we rename the file first, so that we avoid comparing a file with itself
mv $file $file.new
if test -r "${srcdir}"/$file && diff $file.new "${srcdir}"/$file >/dev/null 2>/dev/null ;
@ -748,10 +713,6 @@ for file in $outfile textclass.lst packages.lst \
mv $file.new $file
fi
done
if test ! -r xfonts/fonts.dir ; then
echo "removing font links"
rm -f xfonts/*.pfb xfonts/fonts.scale
fi
# Final clean-up
if test $lyx_keep_temps = no ; then

View File

@ -218,4 +218,5 @@ src/support/userinfo.C
src/text.C
src/text2.C
src/text3.C
src/toc.C
src/vspace.C

View File

@ -1,3 +1,8 @@
2005-07-16 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* qfont_loader.C (addToFontPath): remove.
(available): do not try to call addToFontPath.
2005-07-14 Lars Gullik Bjønnes <larsbj@lyx.org>
* moc/Makefile.am: dist pch.h and mark PCH_FILE as a built file

View File

@ -53,29 +53,6 @@ using std::string;
void qfont_loader::addToFontPath()
{
#ifdef Q_WS_X11
string const dir = OnlyPath(LibFileSearch("xfonts", "fonts.dir"));
if (!dir.empty()) {
QWidget w;
int n;
char ** p = XGetFontPath(w.x11Display(), &n);
if (std::find(p, p + n, dir) != p + n)
return;
XFreeFontPath(p);
lyxerr[Debug::FONT] << "Adding " << dir
<< " to the font path." << endl;
string const command = "xset fp+ " + QuoteName(dir);
Systemcall s;
if (!s.startscript(Systemcall::Wait, command))
return;
lyxerr << "Unable to add " << dir << "to the font path."
<< endl;
}
#endif
}
void qfont_loader::initFontPath()
{
#ifdef Q_WS_MACX
@ -415,22 +392,6 @@ bool qfont_loader::available(LyXFont const & f)
return true;
}
// If the font is a tex symbol font and it is not available,
// we try to add the xfonts directory to the font path.
static bool first_time = true;
if (!first_time || family == LyXFont::SYMBOL_FAMILY
|| family == LyXFont::WASY_FAMILY)
return false;
first_time = false;
addToFontPath();
tmp = getSymbolFont(pat);
if (tmp.second) {
cache[family] = true;
return true;
}
// We don't need to set cache[family] to false, as it
//is initialized to false;
return false;
}

View File

@ -1,3 +1,8 @@
2005-07-16 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* xfont_loader.C (getFontinfo): do not call addFontPath.
(addFontPath): remove.
2005-07-13 <lgb@tandberg.net>
* forms/Makefile.am (distclean-local): pretend success also if

View File

@ -145,27 +145,6 @@ string const fontName(string const & family, string const & foundry)
return "-"+foundry+"-"+family;
}
bool addFontPath()
{
string const dir = OnlyPath(LibFileSearch("xfonts", "fonts.dir"));
if (!dir.empty()) {
int n;
char ** p = XGetFontPath(fl_get_display(), &n);
if (std::find(p, p + n, dir) != p + n)
return false;
lyxerr[Debug::FONT] << "Adding " << dir
<< " to the font path." << endl;
string const command = "xset fp+ " + dir;
Systemcall s;
if (!s.startscript(Systemcall::Wait, command))
return true;
lyxerr << "Unable to add " << dir << "to the font path."
<< endl;
}
return false;
}
} // namespace anon
// Get font info
@ -182,17 +161,7 @@ void xfont_loader::getFontinfo(LyXFont::FONT_FAMILY family,
// Special fonts
string pat = symbolPattern(family);
if (!pat.empty()) {
static bool first_time = true;
fontinfo[family][series][shape] = new FontInfo(pat);
if (family != LyXFont::SYMBOL_FAMILY &&
!fontinfo[family][series][shape]->exist() &&
first_time) {
first_time = false;
if (addFontPath()) {
delete fontinfo[family][series][shape];
fontinfo[family][series][shape] = new FontInfo(pat);
}
}
return;
}