summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fonts/fonts.conf.osx68
-rw-r--r--fonts/fonts.conf.windows (renamed from fonts/fonts.conf)0
-rw-r--r--platform/osx/make_dmg.sh1
-rw-r--r--platform/windows/wscript2
-rw-r--r--src/lib/util.cc2
5 files changed, 71 insertions, 2 deletions
diff --git a/fonts/fonts.conf.osx b/fonts/fonts.conf.osx
new file mode 100644
index 000000000..4dc37c084
--- /dev/null
+++ b/fonts/fonts.conf.osx
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<fontconfig>
+
+<cachedir>~/.fontconfig</cachedir>
+<cachedir prefix="xdg">fontconfig</cachedir>
+
+<!--
+ Artificial oblique for fonts without an italic or oblique version
+ -->
+
+ <match target="font">
+ <!-- check to see if the font is roman -->
+ <test name="slant">
+ <const>roman</const>
+ </test>
+ <!-- check to see if the pattern requested non-roman -->
+ <test target="pattern" name="slant" compare="not_eq">
+ <const>roman</const>
+ </test>
+ <!-- multiply the matrix to slant the font -->
+ <edit name="matrix" mode="assign">
+ <times>
+ <name>matrix</name>
+ <matrix><double>1</double><double>0.2</double>
+ <double>0</double><double>1</double>
+ </matrix>
+ </times>
+ </edit>
+ <!-- pretend the font is oblique now -->
+ <edit name="slant" mode="assign">
+ <const>oblique</const>
+ </edit>
+ <!-- and disable embedded bitmaps for artificial oblique -->
+ <edit name="embeddedbitmap" mode="assign">
+ <bool>false</bool>
+ </edit>
+ </match>
+
+<!--
+ Synthetic emboldening for fonts that do not have bold face available
+ -->
+
+ <match target="font">
+ <!-- check to see if the font is just regular -->
+ <test name="weight" compare="less_eq">
+ <const>medium</const>
+ </test>
+ <!-- check to see if the pattern requests bold -->
+ <test target="pattern" name="weight" compare="more">
+ <const>medium</const>
+ </test>
+ <!--
+ set the embolden flag
+ needed for applications using cairo, e.g. gucharmap, gedit, ...
+ -->
+ <edit name="embolden" mode="assign">
+ <bool>true</bool>
+ </edit>
+ <!--
+ set weight to bold
+ needed for applications using Xft directly, e.g. Firefox, ...
+ -->
+ <edit name="weight" mode="assign">
+ <const>bold</const>
+ </edit>
+ </match>
+</fontconfig>
diff --git a/fonts/fonts.conf b/fonts/fonts.conf.windows
index 2b1c0ae4d..2b1c0ae4d 100644
--- a/fonts/fonts.conf
+++ b/fonts/fonts.conf.windows
diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh
index b9cdaec2d..4afb54700 100644
--- a/platform/osx/make_dmg.sh
+++ b/platform/osx/make_dmg.sh
@@ -129,6 +129,7 @@ function copy_resources {
cp $ROOT/32/src/dcpomatic/fonts/LiberationSans-Regular.ttf "$dest"
cp $ROOT/32/src/dcpomatic/fonts/LiberationSans-Italic.ttf "$dest"
cp $ROOT/32/src/dcpomatic/fonts/LiberationSans-Bold.ttf "$dest"
+ cp $ROOT/32/src/dcpomatic/fonts/fonts.conf.osx "$dest"/fonts.conf
cp $ROOT/32/src/dcpomatic/graphics/splash.png "$dest"
cp $ROOT/32/src/dcpomatic/graphics/zoom.png "$dest"
cp $ROOT/32/src/dcpomatic/graphics/zoom_all.png "$dest"
diff --git a/platform/windows/wscript b/platform/windows/wscript
index baca6b553..a6b705496 100644
--- a/platform/windows/wscript
+++ b/platform/windows/wscript
@@ -294,7 +294,7 @@ SetOutPath "$INSTDIR"
File "%resources%/../../fonts/LiberationSans-Regular.ttf"
File "%resources%/../../fonts/LiberationSans-Italic.ttf"
File "%resources%/../../fonts/LiberationSans-Bold.ttf"
-File "%resources%/../../fonts/fonts.conf"
+File /oname=fonts.conf "%resources%/../../fonts/fonts.conf.windows"
File "%graphics%/splash.png"
File "%graphics%/zoom.png"
File "%graphics%/zoom_all.png"
diff --git a/src/lib/util.cc b/src/lib/util.cc
index c20891464..340af1ea8 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -379,7 +379,7 @@ dcpomatic_setup ()
Pango::init ();
dcp::init ();
-#ifdef DCPOMATIC_WINDOWS
+#if defined(DCPOMATIC_WINDOWS) || defined(DCPOMATIC_OSX)
/* Render something to fontconfig to create its cache */
list<StringText> subs;
dcp::SubtitleString ss(