Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos
Commits
124fbbd7
Commit
124fbbd7
authored
May 02, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "software/cloudooo: fix font selection"
This reverts commit
5a6bec0e
.
parent
53f2c088
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
46 deletions
+52
-46
software/cloudooo/software-common.cfg
software/cloudooo/software-common.cfg
+8
-3
software/cloudooo/test/test.py
software/cloudooo/test/test.py
+44
-43
No files found.
software/cloudooo/software-common.cfg
View file @
124fbbd7
...
...
@@ -61,10 +61,15 @@ fonts =
${ipaex-fonts:location}
${liberation-fonts:location}
${ocrb-fonts:location}
${dejavu-fonts:location}
${libreoffice-bin:location}/share/fonts/
# XXX These fonts have always been missing in cloudooo, but we want
# 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:location}/etc/fonts/conf.d
#
${fontconfig:location}/etc/fonts/conf.d
freetype = ${freetype:location}
glib = ${glib:location}
...
...
software/cloudooo/test/test.py
View file @
124fbbd7
...
...
@@ -102,7 +102,8 @@ class HTMLtoPDFConversionFontTestMixin:
def
test
(
self
):
actual_font_mapping_mapping
=
{}
for
font
in
self
.
expected_font_mapping
:
for
font
,
expected_substitution
in
sorted
(
self
.
expected_font_mapping
.
items
()):
src_html
=
'''
<style>
p {{ font-family: "{font}"; font-size: 20pt; }}
...
...
@@ -133,30 +134,30 @@ class TestWkhtmlToPDF(HTMLtoPDFConversionFontTestMixin, CloudOooTestCase):
__partition_reference__
=
'wk'
pdf_producer
=
'Qt 4.8.7'
expected_font_mapping
=
{
'Arial
'
:
'LiberationSans
'
,
'Arial
Black'
:
'LiberationSans
'
,
'Avant Garde'
:
'
LiberationSans
'
,
'Bookman'
:
'
LiberationSans
'
,
'Carlito'
:
'
Carlito
'
,
'Comic Sans MS'
:
'
LiberationSans
'
,
'Courier New'
:
'
LiberationSans
'
,
'DejaVu Sans
'
:
'DejaVuSans
'
,
'DejaVu Sans
Condensed'
:
'LiberationSans
'
,
'DejaVu Sans
ExtraLight'
:
'LiberationSans
'
,
'DejaVu Sans
Mono'
:
'DejaVuSansMono
'
,
'DejaVu Serif
'
:
'DejaVuSerif
'
,
'DejaVu Serif
Condensed'
:
'LiberationSans
'
,
'Garamond'
:
'
LiberationSans
'
,
'Gentium Basic'
:
'
GentiumBasic
'
,
'Gentium Book Basic'
:
'
GentiumBookBasic
'
,
'Georgia'
:
'
LiberationSans
'
,
'Helvetica'
:
'
LiberationSans
'
,
'I
PAex Gothic'
:
'LiberationSans
'
,
'IPAex
Mincho'
:
'LiberationSans
'
,
'I
mpact'
:
'LiberationSans
'
,
'Arial
Black'
:
'Roboto-Medium
'
,
'Arial
'
:
'Roboto-Medium
'
,
'Avant Garde'
:
'
Roboto-Medium
'
,
'Bookman'
:
'
Roboto-Medium
'
,
'Carlito'
:
'
Roboto-Medium
'
,
'Comic Sans MS'
:
'
Roboto-Medium
'
,
'Courier New'
:
'
Roboto-Medium
'
,
'DejaVu Sans
Condensed'
:
'Roboto-Medium
'
,
'DejaVu Sans
ExtraLight'
:
'Roboto-Medium
'
,
'DejaVu Sans
Mono'
:
'Roboto-Medium
'
,
'DejaVu Sans
'
:
'Roboto-Medium
'
,
'DejaVu Serif
Condensed'
:
'Roboto-Medium
'
,
'DejaVu Serif
'
:
'Roboto-Medium
'
,
'Garamond'
:
'
Roboto-Medium
'
,
'Gentium Basic'
:
'
Roboto-Medium
'
,
'Gentium Book Basic'
:
'
Roboto-Medium
'
,
'Georgia'
:
'
Roboto-Medium
'
,
'Helvetica'
:
'
Roboto-Medium
'
,
'I
mpact'
:
'Roboto-Medium
'
,
'IPAex
Gothic'
:
'Roboto-Medium
'
,
'I
PAex Mincho'
:
'Roboto-Medium
'
,
'Liberation Mono'
:
'LiberationMono'
,
'Liberation Sans Narrow'
:
'Roboto-Medium'
,
'Liberation Sans'
:
'LiberationSans'
,
'Liberation Sans Narrow'
:
'LiberationSansNarrow'
,
'Liberation Serif'
:
'LiberationSerif'
,
'Linux LibertineG'
:
'LiberationSans'
,
'OpenSymbol'
:
set
([
'DejaVuSans'
,
'OpenSymbol'
]),
# XXX why ??
...
...
@@ -191,44 +192,44 @@ class TestLibreoffice(HTMLtoPDFConversionFontTestMixin, CloudOooTestCase):
__partition_reference__
=
'lo'
pdf_producer
=
'LibreOffice 5.2'
expected_font_mapping
=
{
'Arial
'
:
'LiberationSans
'
,
'Arial
Black'
:
'DejaVuSans
'
,
'Avant Garde'
:
'
DejaVuSans
'
,
'Bookman'
:
'
DejaVuSans
'
,
'Arial
Black'
:
'LinuxLibertineG
'
,
'Arial
'
:
'LinuxLibertineG
'
,
'Avant Garde'
:
'
LinuxLibertineG
'
,
'Bookman'
:
'
LinuxLibertineG
'
,
'Carlito'
:
'Carlito'
,
'Comic Sans MS'
:
'DejaVuSans'
,
'Courier New'
:
'LiberationMono'
,
'DejaVu Sans'
:
'DejaVuSans'
,
'Comic Sans MS'
:
'LinuxLibertineG'
,
'Courier New'
:
'LinuxLibertineG'
,
'DejaVu Sans Condensed'
:
'DejaVuSansCondensed'
,
'DejaVu Sans ExtraLight'
:
'
DejaVuSans
'
,
'DejaVu Sans ExtraLight'
:
'
LinuxLibertineG
'
,
'DejaVu Sans Mono'
:
'DejaVuSansMono'
,
'DejaVu S
erif'
:
'DejaVuSerif
'
,
'DejaVu S
ans'
:
'DejaVuSans
'
,
'DejaVu Serif Condensed'
:
'DejaVuSerifCondensed'
,
'Garamond'
:
'DejaVuSerif'
,
'DejaVu Serif'
:
'DejaVuSerif'
,
'Garamond'
:
'LinuxLibertineG'
,
'Gentium Basic'
:
'GentiumBasic'
,
'Gentium Book Basic'
:
'GentiumBookBasic'
,
'Georgia'
:
'DejaVuSerif'
,
'Helvetica'
:
'LiberationSans'
,
'Georgia'
:
'LinuxLibertineG'
,
'Helvetica'
:
'LinuxLibertineG'
,
'Impact'
:
'LinuxLibertineG'
,
'IPAex Gothic'
:
'IPAexGothic'
,
'IPAex Mincho'
:
'IPAexMincho'
,
'Impact'
:
'DejaVuSans'
,
'Liberation Mono'
:
'LiberationMono'
,
'Liberation Sans'
:
'LiberationSans'
,
'Liberation Sans Narrow'
:
'LiberationSansNarrow'
,
'Liberation Sans'
:
'LiberationSans'
,
'Liberation Serif'
:
'LiberationSerif'
,
'Linux LibertineG'
:
'LinuxLibertineG'
,
'OpenSymbol'
:
'OpenSymbol'
,
'Palatino'
:
'
DejaVuSerif
'
,
'Palatino'
:
'
LinuxLibertineG
'
,
'Roboto Black'
:
'Roboto-Black'
,
'Roboto Condensed Light'
:
'RobotoCondensed-Light'
,
'Roboto Condensed Regular'
:
'
DejaVuSans
'
,
'Roboto Condensed Regular'
:
'
LinuxLibertineG
'
,
'Roboto Light'
:
'Roboto-Light'
,
'Roboto Medium'
:
'Roboto-Medium'
,
'Roboto Thin'
:
'Roboto-Thin'
,
'Times New Roman'
:
'Li
berationSerif
'
,
'Trebuchet MS'
:
'
DejaVuSans
'
,
'Verdana'
:
'
DejaVuSans
'
,
'ZZZdefault fonts when no match'
:
'
DejaVuSans'
'Times New Roman'
:
'Li
nuxLibertineG
'
,
'Trebuchet MS'
:
'
LinuxLibertineG
'
,
'Verdana'
:
'
LinuxLibertineG
'
,
'ZZZdefault fonts when no match'
:
'
LinuxLibertineG'
,
}
def
_convert_html_to_pdf
(
self
,
src_html
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment