File xpdf-i18n.patch of Package xpdf

--- xpdf-3.01/doc/xpdf.1
+++ xpdf-3.01/doc/xpdf.1
@@ -221,7 +221,7 @@
 .BI \-font " font"
 .RB ( \-fn
 is equivalent.)
-.RB "[X resource: " xpdf*fontList ]
+.RB "[X resource: " xpdf*renderTable.fontName ]
 .PP
 The color and font options only affect the user interface elements,
 not the PDF display (the \'paper').
--- xpdf-3.01/doc/xpdf.cat
+++ xpdf-3.01/doc/xpdf.cat
@@ -206,7 +206,7 @@
               xpdf*Background]
 
        -font font
-              (-fn is equivalent.)  [X resource: xpdf*fontList]
+              (-fn is equivalent.)  [X resource: xpdf*renderTable.fontName]
 
        The color and font options only affect the user  interface
        elements, not the PDF display (the 'paper').
--- xpdf-3.01/doc/xpdf.hlp
+++ xpdf-3.01/doc/xpdf.hlp
@@ -208,7 +208,7 @@
               xpdf*Background]
 
        -font font
-              (-fn is equivalent.)  [X resource: xpdf*fontList]
+              (-fn is equivalent.)  [X resource: xpdf*renderTable.fontName]
 
        The  color and font options only affect the user interface
        elements, not the PDF display (the 'paper').
--- xpdf-3.01/xpdf/XPDFApp.cc
+++ xpdf-3.01/xpdf/XPDFApp.cc
@@ -7,6 +7,7 @@
 //========================================================================
 
 #include <aconf.h>
+#include <locale.h>
 
 #ifdef USE_GCC_PRAGMAS
 #pragma implementation
@@ -35,9 +36,25 @@
 //------------------------------------------------------------------------
 
 static String fallbackResources[] = {
+#if 0
   "*.zoomComboBox*fontList: -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1",
   "*XmTextField.fontList: -*-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1",
   "*.fontList: -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1",
+#else
+  "*renderTable:",
+  "*renderTable.fontType: FONT_IS_FONTSET",
+  "*renderTable.fontName: "
+  "     -efont-biwidth-medium-r-normal--14-*-*-*-*-*-*-*, "
+  "       -gnu-unifont-medium-r-normal--16-*-*-*-p-*-*-*, "
+  "  -adobe-helvetica-medium-r-normal-*-14-*-*-*-p-*-iso10646-1, "
+  "  -adobe-helvetica-medium-r-normal-*-14-*-*-*-p-*-iso8859-*, "
+  " -cronyx-helvetica-medium-r-normal-*-14-*-*-*-p-*-koi8-r, "
+  "         -*-lucida-medium-r-normal-*-14-*-*-*-p-*-iso8859-*, "
+  "              -*-*-medium-r-normal-*-14-*-*-*-p-*-*-*, "
+  "              -*-*-medium-r-normal-*-16-*-*-*-p-*-*-*, "
+  "                        -*-*-*-*-*-*-14-*-*-*-*-*-*-*, "
+  "                        -*-*-*-*-*-*-16-*-*-*-*-*-*-*,*",
+#endif
   "*XmTextField.translations: #override\\n"
   "  Ctrl<Key>a:beginning-of-line()\\n"
   "  Ctrl<Key>b:backward-character()\\n"
@@ -64,8 +81,13 @@
   {"-bg",            "*Background",      XrmoptionSepArg,  NULL},
   {"-geometry",      ".geometry",        XrmoptionSepArg,  NULL},
   {"-g",             ".geometry",        XrmoptionSepArg,  NULL},
+#if 0
   {"-font",          "*.fontList",       XrmoptionSepArg,  NULL},
   {"-fn",            "*.fontList",       XrmoptionSepArg,  NULL},
+#else
+  {"-font",          "*.renderTable.fontName",       XrmoptionSepArg,  NULL},
+  {"-fn",            "*.renderTable.fontName",       XrmoptionSepArg,  NULL},
+#endif  
   {"-title",         ".title",           XrmoptionSepArg,  NULL},
   {"-cmap",          ".installCmap",     XrmoptionNoArg,   (XPointer)"on"},
   {"-rgb",           ".rgbCubeSize",     XrmoptionSepArg,  NULL},
@@ -126,9 +148,12 @@
 #endif
 
 XPDFApp::XPDFApp(int *argc, char *argv[]) {
+  XtSetLanguageProc(NULL, NULL, NULL);
+  setlocale(LC_NUMERIC,"POSIX");
   appShell = XtAppInitialize(&appContext, xpdfAppName, xOpts, nXOpts,
 			     argc, argv, fallbackResources, NULL, 0);
   display = XtDisplay(appShell);
+
   screenNum = XScreenNumberOfScreen(XtScreen(appShell));
 #if XmVERSION > 1
   XtVaSetValues(XmGetXmDisplay(XtDisplay(appShell)),
--- xpdf-3.01/xpdf/XPDFViewer.cc
+++ xpdf-3.01/xpdf/XPDFViewer.cc
@@ -175,9 +175,9 @@
 
 XPDFViewer::~XPDFViewer() {
   delete core;
-  XmFontListFree(aboutBigFont);
-  XmFontListFree(aboutVersionFont);
-  XmFontListFree(aboutFixedFont);
+  XmRenderTableFree(aboutBigFont);
+  XmRenderTableFree(aboutVersionFont);
+  XmRenderTableFree(aboutFixedFont);
   closeWindow();
 #ifndef DISABLE_OUTLINE
   if (outlineLabels) {
@@ -1774,38 +1774,38 @@
 
   //----- fonts
   aboutBigFont =
-    createFontList("-*-times-bold-i-normal--20-*-*-*-*-*-iso8859-1");
+    createRenderTable("aboutBigFont", "-efont-biwidth-medium-i-normal--24-*-*-*-p-*-iso10646-1,-*-times-bold-i-normal--18-*-*-*-*-*-iso10646-1,-*-times-bold-i-normal--18-*-*-*-*-*-iso8859-*,-*-*-medium-i-normal--24-*-*-*-c-*-*-*,-*-*-medium-r-normal--24-*-*-*-c-*-*-*");
   aboutVersionFont =
-    createFontList("-*-times-medium-r-normal--16-*-*-*-*-*-iso8859-1");
+    createRenderTable("aboutVersionFont", "-efont-biwidth-medium-r-normal--14-*-*-*-p-*-iso10646-1,-*-times-medium-r-normal--14-*-*-*-*-*-iso10646-1,-*-times-medium-r-normal--14-*-*-*-*-*-iso8859-*,-*-*-medium-r-normal--14-*-*-*-c-*-*-*,-*-*-medium-r-normal--16-*-*-*-c-*-*-*");
   aboutFixedFont =
-    createFontList("-*-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1");
+    createRenderTable("aboutFixedFont", "-efont-biwidth-medium-r-normal--12-*-*-*-p-*-iso10646-1,-*-courier-medium-r-normal--12-*-*-*-*-*-iso10646-1,-*-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1,-*-*-medium-r-normal--12-*-*-*-c-*-*-*,-*-*-medium-r-normal--16-*-*-*-c-*-*-*");
 
   //----- heading
   n = 0;
   s = XmStringCreateLocalized("Xpdf");
   XtSetArg(args[n], XmNlabelString, s); ++n;
-  XtSetArg(args[n], XmNfontList, aboutBigFont); ++n;
+  XtSetArg(args[n], XmNrenderTable, aboutBigFont); ++n;
   label = XmCreateLabel(col, "h0", args, n);
   XmStringFree(s);
   XtManageChild(label);
   n = 0;
   s = XmStringCreateLocalized("Version " xpdfVersion);
   XtSetArg(args[n], XmNlabelString, s); ++n;
-  XtSetArg(args[n], XmNfontList, aboutVersionFont); ++n;
+  XtSetArg(args[n], XmNrenderTable, aboutVersionFont); ++n;
   label = XmCreateLabel(col, "h1", args, n);
   XmStringFree(s);
   XtManageChild(label);
   n = 0;
   s = XmStringCreateLocalized(xpdfCopyright);
   XtSetArg(args[n], XmNlabelString, s); ++n;
-  XtSetArg(args[n], XmNfontList, aboutVersionFont); ++n;
+  XtSetArg(args[n], XmNrenderTable, aboutVersionFont); ++n;
   label = XmCreateLabel(col, "h2", args, n);
   XmStringFree(s);
   XtManageChild(label);
   n = 0;
   s = XmStringCreateLocalized(" ");
   XtSetArg(args[n], XmNlabelString, s); ++n;
-  XtSetArg(args[n], XmNfontList, aboutVersionFont); ++n;
+  XtSetArg(args[n], XmNrenderTable, aboutVersionFont); ++n;
   label = XmCreateLabel(col, "h3", args, n);
   XmStringFree(s);
   XtManageChild(label);
@@ -1816,7 +1816,7 @@
   n = 0;
   s = XmStringCreateLocalized(" ");
   XtSetArg(args[n], XmNlabelString, s); ++n;
-  XtSetArg(args[n], XmNfontList, aboutVersionFont); ++n;
+  XtSetArg(args[n], XmNrenderTable, aboutVersionFont); ++n;
   label = XmCreateLabel(col, "h4", args, n);
   XmStringFree(s);
   XtManageChild(label);
@@ -1827,7 +1827,7 @@
     n = 0;
     s = XmStringCreateLocalized(aboutWinText[i]);
     XtSetArg(args[n], XmNlabelString, s); ++n;
-    XtSetArg(args[n], XmNfontList, aboutFixedFont); ++n;
+    XtSetArg(args[n], XmNrenderTable, aboutFixedFont); ++n;
     sprintf(buf, "t%d", i);
     label = XmCreateLabel(col, buf, args, n);
     XtManageChild(label);
@@ -2436,38 +2436,20 @@
 // Motif support
 //------------------------------------------------------------------------
 
-XmFontList XPDFViewer::createFontList(char *xlfd) {
-  XmFontList fontList;
-
-#if XmVersion <= 1001
-
-  XFontStruct *font;
-  String params;
-  Cardinal nParams;
-
-  font = XLoadQueryFont(display, xlfd);
-  if (font) {
-    fontList = XmFontListCreate(font, XmSTRING_DEFAULT_CHARSET);
-  } else {
-    params = (String)xlfd;
-    nParams = 1;
-    XtAppWarningMsg(app->getAppContext(),
-		    "noSuchFont", "CvtStringToXmFontList",
-		    "XtToolkitError", "No such font: %s",
-		    &params, &nParams);
-    fontList = NULL;
-  }
-
-#else
-
-  XmFontListEntry entry;
-
-  entry = XmFontListEntryLoad(display, xlfd,
-			      XmFONT_IS_FONT, XmFONTLIST_DEFAULT_TAG);
-  fontList = XmFontListAppendEntry(NULL, entry);
-  XmFontListEntryFree(&entry);
+XmRenderTable XPDFViewer::createRenderTable(char *tag, char *xlfd) {
+  XmRenderTable rendertable;
+  XmRendition rendition;
+  Arg args[10];
+  int n;
+  
+  n = 0;
+  XtSetArg (args[n], XmNfontName, xlfd); n++;
+  XtSetArg (args[n], XmNfontType, XmFONT_IS_FONTSET); n++;
+  rendition = XmRenditionCreate (win, tag, args, n);
+  
+  rendertable = XmRenderTableAddRenditions (NULL, &rendition, 1, XmMERGE_NEW);
 
-#endif
+  XmRenditionFree (rendition);
 
-  return fontList;
+  return rendertable;
 }
--- xpdf-3.01/xpdf/XPDFViewer.h
+++ xpdf-3.01/xpdf/XPDFViewer.h
@@ -182,7 +182,7 @@
 			    XtPointer callData);
 
   //----- Motif support
-  XmFontList createFontList(char *xlfd);
+  XmRenderTable createRenderTable(char *tag, char *xlfd);
 
   XPDFApp *app;
   GBool ok;
@@ -223,7 +223,7 @@
   Widget popupMenu;
 
   Widget aboutDialog;
-  XmFontList aboutBigFont, aboutVersionFont, aboutFixedFont;
+  XmRenderTable aboutBigFont, aboutVersionFont, aboutFixedFont;
 
   Widget openDialog;
   GBool openInNewWindow;
openSUSE Build Service is sponsored by