GWicke has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324747

Change subject: Add fontconfig file for the pdf render service
......................................................................

Add fontconfig file for the pdf render service

Enable font hinting by installing the default electron-render-service
.fonts.conf [1] in the service user's home directory. Alternatively, we
could mess with the global configuration, but this seemed to be the
simpler approach, and is confirmed to work in labs.

[1]: https://github.com/msokk/electron-render-service/blob/master/.fonts.conf

Change-Id: I35789b89d50260ca79aa97576836f4b35463a776
---
A modules/pdfrender/files/fonts.conf
M modules/pdfrender/manifests/init.pp
2 files changed, 38 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/47/324747/1

diff --git a/modules/pdfrender/files/fonts.conf 
b/modules/pdfrender/files/fonts.conf
new file mode 100644
index 0000000..fdc875b
--- /dev/null
+++ b/modules/pdfrender/files/fonts.conf
@@ -0,0 +1,29 @@
+<?xml version='1.0'?>
+<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
+<fontconfig>
+ <match target="font">
+  <edit mode="assign" name="rgba">
+   <const>rgb</const>
+  </edit>
+ </match>
+ <match target="font">
+  <edit mode="assign" name="hinting">
+   <bool>true</bool>
+  </edit>
+ </match>
+ <match target="font">
+  <edit mode="assign" name="hintstyle">
+   <const>hintslight</const>
+  </edit>
+ </match>
+ <match target="font">
+  <edit mode="assign" name="antialias">
+   <bool>true</bool>
+  </edit>
+ </match>
+  <match target="font">
+    <edit mode="assign" name="lcdfilter">
+      <const>lcddefault</const>
+    </edit>
+  </match>
+</fontconfig>
diff --git a/modules/pdfrender/manifests/init.pp 
b/modules/pdfrender/manifests/init.pp
index a1a48ca..afefbc9 100644
--- a/modules/pdfrender/manifests/init.pp
+++ b/modules/pdfrender/manifests/init.pp
@@ -100,6 +100,15 @@
         before => Base::Service_unit['pdfrender'],
     }
 
+    file { '${home_dir}/.fonts.conf':
+        ensure => present,
+        owner  => 'pdfrender',
+        group  => 'pdfrender',
+        mode   => '0444',
+        source => 'puppet:///modules/pdfrender/fonts.conf',
+        before => Base::Service_unit['pdfrender'],
+    }
+
     systemd::syslog { 'pdfrender':
         readable_by => 'all',
         base_dir    => $::service::configuration::log_dir,

-- 
To view, visit https://gerrit.wikimedia.org/r/324747
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35789b89d50260ca79aa97576836f4b35463a776
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: GWicke <gwi...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to