Hello Pierre and all,
Somewhat related to this is that we have been getting AbiWord Unix font
warnings upon start-up since 0.9.5. It turns out that AbiWord was trying to
add fontpaths like
/usr/share/AbiSuite/fonts/zh-TW
to X, but as you know, the fonts.dir in CJK font subdirs
(e.g. zh-TW, zh-CN, ja, ko) use a special format to include PostScript
names, XLFD and metric information, so X can't handle these fonts.dir
anyway. Included is a patch to prevent AbiWord from adding these
non-X-standard fonts.dir if the subdir names start with "zh", "ko" or
"ja". Since AbiWord has always handled these CJK fonts.dir internally,
this patch does not affect useability, but does get rid of the Unix font
warnings when users start AbiWord under a CJK locale.
Another small change in the patch is to change this:
%%DocumentNeededResources font NimbusRomNo9L-Regu font font NimbusRomNo9L-Regu
font
to this:
%%DocumentNeededResources: font NimbusRomNo9L-Regu NimbusRomNo9L-Regu
According to the on-line guides that I could find, there appears to be
a colon, and the keyword "font" is only used once.
Also there are two small typo fixes in the comments. :-)
Please apply these patches if they look alright. Many thanks!
Anthony
--
Anthony Fok Tung-Ling
ThizLinux Laboratory <[EMAIL PROTECTED]> http://www.thizlinux.com/
Debian Chinese Project <[EMAIL PROTECTED]> http://www.debian.org/intl/zh/
Come visit Our Lady of Victory Camp! http://www.olvc.ab.ca/
Index: src/af/gr/unix/gr_UnixGraphics.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/gr/unix/gr_UnixGraphics.cpp,v
retrieving revision 1.127
diff -u -r1.127 gr_UnixGraphics.cpp
--- src/af/gr/unix/gr_UnixGraphics.cpp 2001/12/09 20:39:47 1.127
+++ src/af/gr/unix/gr_UnixGraphics.cpp 2001/12/11 02:02:46
@@ -346,7 +346,7 @@
// is that measureString() uses remapping to get past zero-width
// character cells.
- if(c == 0x200B || c == 0xFEFF) // 0-with spaces
+ if(c == 0x200B || c == 0xFEFF) // 0-width spaces
return 0;
if (!m_pFontManager)
Index: src/af/xap/unix/xap_UnixFontManager.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/xap/unix/xap_UnixFontManager.cpp,v
retrieving revision 1.59
diff -u -r1.59 xap_UnixFontManager.cpp
--- src/af/xap/unix/xap_UnixFontManager.cpp 2001/12/04 00:28:36 1.59
+++ src/af/xap/unix/xap_UnixFontManager.cpp 2001/12/11 02:02:49
@@ -327,8 +327,12 @@
break;
}
}
+
+ bool bCJK = false;
+ if(!UT_strnicmp(*subdir, "zh", 2) ||
+!UT_strnicmp(*subdir, "ja", 2) || !UT_strnicmp(*subdir, "ko", 2))
+ bCJK = true;
- if(!bFound)
+ if(!bFound && !bCJK)
{
//str+= "rubbish"; // to force error
while testing
*newFontPath_ptr++ =
UT_strdup(str.c_str());
Index: src/af/xap/unix/xap_UnixPSGraphics.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/xap/unix/xap_UnixPSGraphics.cpp,v
retrieving revision 1.81
diff -u -r1.81 xap_UnixPSGraphics.cpp
--- src/af/xap/unix/xap_UnixPSGraphics.cpp 2001/12/09 20:40:22 1.81
+++ src/af/xap/unix/xap_UnixPSGraphics.cpp 2001/12/11 02:02:51
@@ -1187,7 +1187,8 @@
for (k=0; k<kLimit; k++)
{
- vec.addItem((void *) "font");
+ if (k == 0)
+ vec.addItem((void *) "font");
PSFont * psf = (PSFont *)m_vecFontList.getNthItem(k);
if(!psf->getUnixFont()->is_CJK_font())
vec.addItem(psf->getMetricsData()->gfi->fontName);
@@ -1195,7 +1196,7 @@
// TODO add any other resources here
- m_ps->formatComment("DocumentNeededResources",&vec);
+ m_ps->formatComment("DocumentNeededResources:",&vec);
}
void PS_Graphics::_emit_IncludeResource(void)
Index: src/af/xap/xp/xap_EncodingManager.h
===================================================================
RCS file: /cvsroot/abi/src/af/xap/xp/xap_EncodingManager.h,v
retrieving revision 1.28
diff -u -r1.28 xap_EncodingManager.h
--- src/af/xap/xp/xap_EncodingManager.h 2001/11/27 23:48:27 1.28
+++ src/af/xap/xp/xap_EncodingManager.h 2001/12/11 02:02:52
@@ -29,7 +29,7 @@
struct ABI_EXPORT XAP_LangInfo
{
- /*no memeber can have NULL value. If string is empty, then value is
+ /*no member can have NULL value. If string is empty, then value is
not defined. All fields are strings to simplify searches.
*/
enum fieldidx { longname_idx, /*this field is not empty*/