I haven't tested this (except that AbiWord runs as usual) and I'm not sure I
made the made the patch right (it was almost totally full of HTML changes,
which I didn't make, so deleted). I copied the abi directory to the abidist
directory, changed the source, recompiled, and did a diff -c.

What this should do is fix what happens when the font path in Abiword.Profile
contains something like "fonts;ttfonts". Formerly, this was converted into
"/usr/local/AbiSuite/fonts;ttfonts". Now it is converted to the correct
"/usr/local/AbiSuite/fonts;/usr/local/AbiSuite/ttfonts".

Anyone want to get TrueType working?

phma
diff --recursive -c abi/abi/src/af/xap/unix/xap_UnixApp.cpp abidist/abi/src/af/xap/unix/xap_UnixApp.cpp
*** abi/abi/src/af/xap/unix/xap_UnixApp.cpp	Sun Aug 13 01:04:32 2000
--- abidist/abi/src/af/xap/unix/xap_UnixApp.cpp	Fri Aug  4 10:37:45 2000
***************
*** 176,182 ****
  UT_Bool XAP_UnixApp::_loadFonts(void)
  {
  	// create a font manager for our app to use
! 	int RelativePathsSoFar,RelativePathCount;
  	m_fontManager = new XAP_UnixFontManager();
  	UT_ASSERT(m_fontManager);
  
--- 176,182 ----
  UT_Bool XAP_UnixApp::_loadFonts(void)
  {
  	// create a font manager for our app to use
! 
  	m_fontManager = new XAP_UnixFontManager();
  	UT_ASSERT(m_fontManager);
  
***************
*** 188,210 ****
  	getPrefsValue(XAP_PREF_KEY_UnixFontPath,
  		      (const XML_Char**)&szPrefFontPath);
  	UT_ASSERT((szPrefFontPath) && (*szPrefFontPath));
! 	
! 	for (UT_uint32 i = RelativePathCount=0;szPrefFontPath[i];i++)
  	{
! 		RelativePathCount+=(i==0||szPrefFontPath[i-1]==';')&&szPrefFontPath[i]!='/';
  	}
! 	for (UT_uint32 i = RelativePathsSoFar=0;szPrefFontPath[i];i++)
! 		if ((i==0||szPrefFontPath[i-1]==';')&&szPrefFontPath[i]!='/')			// if relative path in prefs, prepend library directory.
! 		{
! 			szTemp = (char *)calloc(strlen(getAbiSuiteLibDir())+strlen(szPrefFontPath)+10,sizeof(char));
! 			strcpy(szTemp,szPrefFontPath);
! 			sprintf(szTemp+i,"%s/%s",getAbiSuiteLibDir(),szPrefFontPath+i);
! 			if (RelativePathsSoFar)
! 				free(szPrefFontPath);
! 			szPrefFontPath = szTemp;
! 			RelativePathsSoFar++;
! 		}
! 	UT_ASSERT(RelativePathsSoFar==RelativePathCount);
  	UT_DEBUGMSG(("Using FontPath from preferences [%s].\n",szPrefFontPath));
  	m_fontManager->setFontPath(szPrefFontPath);
  	FREEP(szTemp);
--- 188,201 ----
  	getPrefsValue(XAP_PREF_KEY_UnixFontPath,
  		      (const XML_Char**)&szPrefFontPath);
  	UT_ASSERT((szPrefFontPath) && (*szPrefFontPath));
! 
! 	if (*szPrefFontPath != '/')			// if relative path in prefs, prepend library directory.
  	{
! 		szTemp = (char *)calloc(strlen(getAbiSuiteLibDir())+strlen(szPrefFontPath)+10,sizeof(char));
! 		sprintf(szTemp,"%s/%s",getAbiSuiteLibDir(),szPrefFontPath);
! 		szPrefFontPath = szTemp;
  	}
! 
  	UT_DEBUGMSG(("Using FontPath from preferences [%s].\n",szPrefFontPath));
  	m_fontManager->setFontPath(szPrefFontPath);
  	FREEP(szTemp);

Reply via email to