From 7284fd9f0b82406e8d78136a0318998221d7d310 Mon Sep 17 00:00:00 2001 From: Stefan Kebekus Date: Mon, 11 Sep 2000 08:24:06 +0000 Subject: [PATCH] further robustified font searching svn path=/trunk/kdegraphics/kdvi/; revision=63516 --- dviwin.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/dviwin.cpp b/dviwin.cpp index 254a9d4b5..9d14a03f9 100644 --- a/dviwin.cpp +++ b/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;