Commit 124fbbd7 authored by Jérome Perrin's avatar Jérome Perrin

Revert "software/cloudooo: fix font selection"

This reverts commit 5a6bec0e.
parent 53f2c088
...@@ -61,10 +61,15 @@ fonts = ...@@ -61,10 +61,15 @@ fonts =
${ipaex-fonts:location} ${ipaex-fonts:location}
${liberation-fonts:location} ${liberation-fonts:location}
${ocrb-fonts:location} ${ocrb-fonts:location}
${dejavu-fonts:location} # XXX These fonts have always been missing in cloudooo, but we want
${libreoffice-bin:location}/share/fonts/ # keep compatibility a little bit more.
# ${dejavu-fonts:location}
# ${libreoffice-bin:location}/share/fonts/
# XXX fonts-include also have always been missing, which causes wrong
# font selections in cloudooo, such as using a serif fonts for Arial
fontconfig-includes = fontconfig-includes =
${fontconfig:location}/etc/fonts/conf.d # ${fontconfig:location}/etc/fonts/conf.d
freetype = ${freetype:location} freetype = ${freetype:location}
glib = ${glib:location} glib = ${glib:location}
......
...@@ -102,7 +102,8 @@ class HTMLtoPDFConversionFontTestMixin: ...@@ -102,7 +102,8 @@ class HTMLtoPDFConversionFontTestMixin:
def test(self): def test(self):
actual_font_mapping_mapping = {} actual_font_mapping_mapping = {}
for font in self.expected_font_mapping: for font, expected_substitution in sorted(
self.expected_font_mapping.items()):
src_html = ''' src_html = '''
<style> <style>
p {{ font-family: "{font}"; font-size: 20pt; }} p {{ font-family: "{font}"; font-size: 20pt; }}
...@@ -133,30 +134,30 @@ class TestWkhtmlToPDF(HTMLtoPDFConversionFontTestMixin, CloudOooTestCase): ...@@ -133,30 +134,30 @@ class TestWkhtmlToPDF(HTMLtoPDFConversionFontTestMixin, CloudOooTestCase):
__partition_reference__ = 'wk' __partition_reference__ = 'wk'
pdf_producer = 'Qt 4.8.7' pdf_producer = 'Qt 4.8.7'
expected_font_mapping = { expected_font_mapping = {
'Arial': 'LiberationSans', 'Arial Black': 'Roboto-Medium',
'Arial Black': 'LiberationSans', 'Arial': 'Roboto-Medium',
'Avant Garde': 'LiberationSans', 'Avant Garde': 'Roboto-Medium',
'Bookman': 'LiberationSans', 'Bookman': 'Roboto-Medium',
'Carlito': 'Carlito', 'Carlito': 'Roboto-Medium',
'Comic Sans MS': 'LiberationSans', 'Comic Sans MS': 'Roboto-Medium',
'Courier New': 'LiberationSans', 'Courier New': 'Roboto-Medium',
'DejaVu Sans': 'DejaVuSans', 'DejaVu Sans Condensed': 'Roboto-Medium',
'DejaVu Sans Condensed': 'LiberationSans', 'DejaVu Sans ExtraLight': 'Roboto-Medium',
'DejaVu Sans ExtraLight': 'LiberationSans', 'DejaVu Sans Mono': 'Roboto-Medium',
'DejaVu Sans Mono': 'DejaVuSansMono', 'DejaVu Sans': 'Roboto-Medium',
'DejaVu Serif': 'DejaVuSerif', 'DejaVu Serif Condensed': 'Roboto-Medium',
'DejaVu Serif Condensed': 'LiberationSans', 'DejaVu Serif': 'Roboto-Medium',
'Garamond': 'LiberationSans', 'Garamond': 'Roboto-Medium',
'Gentium Basic': 'GentiumBasic', 'Gentium Basic': 'Roboto-Medium',
'Gentium Book Basic': 'GentiumBookBasic', 'Gentium Book Basic': 'Roboto-Medium',
'Georgia': 'LiberationSans', 'Georgia': 'Roboto-Medium',
'Helvetica': 'LiberationSans', 'Helvetica': 'Roboto-Medium',
'IPAex Gothic': 'LiberationSans', 'Impact': 'Roboto-Medium',
'IPAex Mincho': 'LiberationSans', 'IPAex Gothic': 'Roboto-Medium',
'Impact': 'LiberationSans', 'IPAex Mincho': 'Roboto-Medium',
'Liberation Mono': 'LiberationMono', 'Liberation Mono': 'LiberationMono',
'Liberation Sans Narrow': 'Roboto-Medium',
'Liberation Sans': 'LiberationSans', 'Liberation Sans': 'LiberationSans',
'Liberation Sans Narrow': 'LiberationSansNarrow',
'Liberation Serif': 'LiberationSerif', 'Liberation Serif': 'LiberationSerif',
'Linux LibertineG': 'LiberationSans', 'Linux LibertineG': 'LiberationSans',
'OpenSymbol': set(['DejaVuSans', 'OpenSymbol']), # XXX why ?? 'OpenSymbol': set(['DejaVuSans', 'OpenSymbol']), # XXX why ??
...@@ -191,44 +192,44 @@ class TestLibreoffice(HTMLtoPDFConversionFontTestMixin, CloudOooTestCase): ...@@ -191,44 +192,44 @@ class TestLibreoffice(HTMLtoPDFConversionFontTestMixin, CloudOooTestCase):
__partition_reference__ = 'lo' __partition_reference__ = 'lo'
pdf_producer = 'LibreOffice 5.2' pdf_producer = 'LibreOffice 5.2'
expected_font_mapping = { expected_font_mapping = {
'Arial': 'LiberationSans', 'Arial Black': 'LinuxLibertineG',
'Arial Black': 'DejaVuSans', 'Arial': 'LinuxLibertineG',
'Avant Garde': 'DejaVuSans', 'Avant Garde': 'LinuxLibertineG',
'Bookman': 'DejaVuSans', 'Bookman': 'LinuxLibertineG',
'Carlito': 'Carlito', 'Carlito': 'Carlito',
'Comic Sans MS': 'DejaVuSans', 'Comic Sans MS': 'LinuxLibertineG',
'Courier New': 'LiberationMono', 'Courier New': 'LinuxLibertineG',
'DejaVu Sans': 'DejaVuSans',
'DejaVu Sans Condensed': 'DejaVuSansCondensed', 'DejaVu Sans Condensed': 'DejaVuSansCondensed',
'DejaVu Sans ExtraLight': 'DejaVuSans', 'DejaVu Sans ExtraLight': 'LinuxLibertineG',
'DejaVu Sans Mono': 'DejaVuSansMono', 'DejaVu Sans Mono': 'DejaVuSansMono',
'DejaVu Serif': 'DejaVuSerif', 'DejaVu Sans': 'DejaVuSans',
'DejaVu Serif Condensed': 'DejaVuSerifCondensed', 'DejaVu Serif Condensed': 'DejaVuSerifCondensed',
'Garamond': 'DejaVuSerif', 'DejaVu Serif': 'DejaVuSerif',
'Garamond': 'LinuxLibertineG',
'Gentium Basic': 'GentiumBasic', 'Gentium Basic': 'GentiumBasic',
'Gentium Book Basic': 'GentiumBookBasic', 'Gentium Book Basic': 'GentiumBookBasic',
'Georgia': 'DejaVuSerif', 'Georgia': 'LinuxLibertineG',
'Helvetica': 'LiberationSans', 'Helvetica': 'LinuxLibertineG',
'Impact': 'LinuxLibertineG',
'IPAex Gothic': 'IPAexGothic', 'IPAex Gothic': 'IPAexGothic',
'IPAex Mincho': 'IPAexMincho', 'IPAex Mincho': 'IPAexMincho',
'Impact': 'DejaVuSans',
'Liberation Mono': 'LiberationMono', 'Liberation Mono': 'LiberationMono',
'Liberation Sans': 'LiberationSans',
'Liberation Sans Narrow': 'LiberationSansNarrow', 'Liberation Sans Narrow': 'LiberationSansNarrow',
'Liberation Sans': 'LiberationSans',
'Liberation Serif': 'LiberationSerif', 'Liberation Serif': 'LiberationSerif',
'Linux LibertineG': 'LinuxLibertineG', 'Linux LibertineG': 'LinuxLibertineG',
'OpenSymbol': 'OpenSymbol', 'OpenSymbol': 'OpenSymbol',
'Palatino': 'DejaVuSerif', 'Palatino': 'LinuxLibertineG',
'Roboto Black': 'Roboto-Black', 'Roboto Black': 'Roboto-Black',
'Roboto Condensed Light': 'RobotoCondensed-Light', 'Roboto Condensed Light': 'RobotoCondensed-Light',
'Roboto Condensed Regular': 'DejaVuSans', 'Roboto Condensed Regular': 'LinuxLibertineG',
'Roboto Light': 'Roboto-Light', 'Roboto Light': 'Roboto-Light',
'Roboto Medium': 'Roboto-Medium', 'Roboto Medium': 'Roboto-Medium',
'Roboto Thin': 'Roboto-Thin', 'Roboto Thin': 'Roboto-Thin',
'Times New Roman': 'LiberationSerif', 'Times New Roman': 'LinuxLibertineG',
'Trebuchet MS': 'DejaVuSans', 'Trebuchet MS': 'LinuxLibertineG',
'Verdana': 'DejaVuSans', 'Verdana': 'LinuxLibertineG',
'ZZZdefault fonts when no match': 'DejaVuSans' 'ZZZdefault fonts when no match': 'LinuxLibertineG',
} }
def _convert_html_to_pdf(self, src_html): def _convert_html_to_pdf(self, src_html):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment