further robustified font searching

svn path=/trunk/kdegraphics/kdvi/; revision=63516
remotes/origin/kdvi-2.0
Stefan Kebekus 26 years ago
parent 15f4593d4e
commit 7284fd9f0b
  1. 20
      dviwin.cpp

@ -338,17 +338,21 @@ void dviWindow::setFile( const QString & fname )
// "kpathsea" directory is incompatible with the "texmf.cnf" that is
// included in the TeX-distribution on the machine where kdvi is
// run.
char *hardcoded_paths = ":/var/lib/texmf/pk//:/usr/share/texmf/fonts/vf//";
char *Ptr;
if (FontPath.length() == 0)
Ptr = "/var/lib/texmf/pk//";
else {
Ptr = new char[FontPath.length()+21];
strncpy(Ptr,FontPath.latin1(),FontPath.length());
strncpy(Ptr,":/var/lib/texmf/pk//",20);
Ptr[FontPath.length()+21] = 0;
if (FontPath.length() == 0) {
Ptr = new char[strlen(hardcoded_paths)];
strcpy(Ptr,hardcoded_paths+1);
} else {
Ptr = new char[FontPath.length()+strlen(hardcoded_paths)+2];
strcpy(Ptr,FontPath.latin1());
strcpy(Ptr+strlen(Ptr),hardcoded_paths);
}
kdDebug() << "Ptr: " << Ptr << endl;
kpse_format_info[kpse_pk_format].override_path
= kpse_format_info[kpse_gf_format].override_path
= kpse_format_info[kpse_vf_format].override_path
= kpse_format_info[kpse_any_glyph_format].override_path
= kpse_format_info[kpse_tfm_format].override_path
= Ptr;

Loading…
Cancel
Save