Updated the LaTeX header for letters
authorRuben Rodriguez <ruben@fsf.org>
Thu, 1 Dec 2016 21:28:53 +0000 (16:28 -0500)
committerMichael McMahon <michael@fsf.org>
Fri, 20 Oct 2023 18:26:14 +0000 (14:26 -0400)
CRM/Utils/PDF/Utils.php

index 3488cc1e8a3650f465f716f25122a41d980f019c..c63497eb24b74b04808150ce59490bd63d6f4ec6 100644 (file)
@@ -43,18 +43,21 @@ class CRM_Utils_PDF_Utils {
     $head='\documentclass[12pt]{letter}
 \usepackage{url}
 \usepackage{ucs}
+\usepackage{array}
 \usepackage{graphicx}
 \usepackage[T1]{fontenc}
 \usepackage{fullpage}
 \usepackage{fontspec,xunicode}
 %% VERY IMPORTANT.  Configures supported languages and fonts to use for each one.
 \usepackage[Latin, Hebrew, Arabics, CJK, Diacritics]{ucharclasses}
-\setDefaultTransitions{\fontspec{FreeSerif}}{}
-\setTransitionsForLatin{\fontspec{FreeSerif}}{}
-\setTransitionsForArabics{\fontspec{FreeSerif}}{}
-\setTransitionsForCJK{\fontspec{WenQuanYi Zen Hei}}{}
-\setTransitionsForDiacritics{\fontspec{FreeSerif}}{}
-\setTransitionTo{Hebrew}{\fontspec{FreeSerif}}
+\newfontfamily{\normalfont}{FreeSerif}
+\newfontfamily{\cjkfont}{WenQuanYi Zen Hei}
+\setDefaultTransitions{\normalfont}{}
+\setTransitionsForLatin{\normalfont}{}
+\setTransitionsForArabics{\normalfont}{}
+\setTransitionsForCJK{\cjkfont}{}
+\setTransitionsForDiacritics{\normalfont}{}
+\setTransitionTo{Hebrew}{\normalfont}
 \setmainfont{FreeSerif}
 
 \newcommand{\fsfclosing}[1]{\par\nobreak\vspace{\parskip}
@@ -123,7 +126,8 @@ right  = 1.0in]{geometry}
       header('Content-Type: application/pdf');
       header('Content-Disposition: attachment; filename="' . $fileName . '"');
       echo $pdf;
-//      CRM_Utils_PDF_Utils::enqueuePDF($pdf);
+      // quidam: comment previous line and uncomment next one during printing
+      //CRM_Utils_PDF_Utils::enqueuePDF($pdf);
 
     }
   }
@@ -278,6 +282,7 @@ right  = 1.0in]{geometry}
       CRM_Utils_System::setHttpHeader('Content-Type', 'application/pdf');
       CRM_Utils_System::setHttpHeader('Content-Disposition', 'attachment; filename="' . $fileName . '"');
       echo $pdf;
+      // quidam: comment previous line and uncomment next one during printing
       //CRM_Utils_PDF_Utils::enqueuePDF($pdf);
 
     }