]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
added support for CJK fonts 199/head
authorSambhav Dusad <sambhavdusad24@gmail.com>
Mon, 3 Feb 2020 21:00:07 +0000 (02:30 +0530)
committerSambhav Dusad <sambhavdusad24@gmail.com>
Mon, 3 Feb 2020 21:00:07 +0000 (02:30 +0530)
charset/pdf.utf-8.simple
filter/texttopdf.c

index 1280f25c8893548fea8e811a1c635befffa47591..f7d3adf71ed7a259aa1a9129ea4f571303550056 100644 (file)
@@ -30,3 +30,4 @@ charset utf8
 
 0000 04FF ltor single monospace monospace:bold monospace:oblique monospace:bold:oblique
 0500 05FF rtol single monospace
+3000 9FFF ltor double ARPLUmingCN
index 55a8309cad38ee9d550f6a47c31f8f7a6de60d1b..50a0876c9c021ec3394c200e9b3f4363d343ef5c 100644 (file)
@@ -39,9 +39,9 @@
 int     UTF8 = 1;               /* Use UTF-8 encoding? */
 #endif /* CUPS_1_4 */
 
-EMB_PARAMS *font_load(const char *font);
+EMB_PARAMS *font_load(const char *font, int fontwidth);
 
-EMB_PARAMS *font_load(const char *font)
+EMB_PARAMS *font_load(const char *font, int fontwidth)
 {
   OTF_FILE *otf;
 
@@ -74,7 +74,7 @@ EMB_PARAMS *font_load(const char *font)
        FcPatternGetString  (candidates->fonts[i], FC_FONTFORMAT, 0, &fontformat);
        FcPatternGetInteger (candidates->fonts[i], FC_SPACING,    0, &spacing);
 
-       if ( (fontformat)&&(spacing == FC_MONO) ) {
+       if ( (fontformat)&&((spacing == FC_MONO) || (fontwidth == 2)) ) {    // check for monospace or double width fonts
          if (strcmp((const char *)fontformat, "TrueType") == 0) {
            fontname = FcPatternFormat (candidates->fonts[i], (const FcChar8 *)"%{file|cescape}/%{index}");
            break;
@@ -554,7 +554,7 @@ WriteProlog(const char *title,              /* I - Title of job */
               }
 
             if (k==num_fonts) {  // not found
-             fonts[num_fonts] = Fonts[NumFonts][i] = font_load(valptr);
+             fonts[num_fonts] = Fonts[NumFonts][i] = font_load(valptr, Widths[NumFonts]);
               if (!fonts[num_fonts]) { // font missing/corrupt, replace by first
                 fprintf(stderr,"WARNING: Ignored bad font \"%s\"\n",valptr);
                 break;
@@ -738,7 +738,7 @@ WriteProlog(const char *title,              /* I - Title of job */
               }
 
             if (k==num_fonts) {  // not found
-             fonts[num_fonts] = Fonts[NumFonts][i] = font_load(valptr);
+             fonts[num_fonts] = Fonts[NumFonts][i] = font_load(valptr, Widths[NumFonts]);
               if (!fonts[num_fonts]) { // font missing/corrupt, replace by first
                 fprintf(stderr,"WARNING: Ignored bad font \"%s\"\n",valptr);
                 break;