diff --git a/CHANGES.rst b/CHANGES.rst index 78f946d..a7506b6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,7 @@ +0.4.12 (2018-06-07) +------------------- +- Add font option in RichText + 0.4.11 (2018-05-16) ------------------- - Better tabs and spaces management for MS Word 2016 diff --git a/docxtpl/__init__.py b/docxtpl/__init__.py index 90e1a6f..fa1bd35 100644 --- a/docxtpl/__init__.py +++ b/docxtpl/__init__.py @@ -5,7 +5,7 @@ Created : 2015-03-12 @author: Eric Lapouyade ''' -__version__ = '0.4.11' +__version__ = '0.4.12' from lxml import etree from docx import Document @@ -425,7 +425,7 @@ class RichText(object): if strike: prop += u'' if font: - prop += u''.format(font, font) + prop += u''.format(font=font) self.xml += u'' if prop: diff --git a/tests/richtext.py b/tests/richtext.py index 781e0e7..881df08 100644 --- a/tests/richtext.py +++ b/tests/richtext.py @@ -27,6 +27,10 @@ rt.add('\n1st line') rt.add('\n2nd line') rt.add('\n3rd line') rt.add('\n\n') +rt.add('\nFonts :\n',underline=True) +rt.add('Arial\n',font='Arial') +rt.add('Courier New\n',font='Courier New') +rt.add('Times New Roman\n',font='Times New Roman') context = { 'example' : rt, diff --git a/tests/test_files/cellbg.docx b/tests/test_files/cellbg.docx index 08226c0..54762d2 100644 Binary files a/tests/test_files/cellbg.docx and b/tests/test_files/cellbg.docx differ diff --git a/tests/test_files/dynamic_table.docx b/tests/test_files/dynamic_table.docx index fe2c11f..c79613f 100644 Binary files a/tests/test_files/dynamic_table.docx and b/tests/test_files/dynamic_table.docx differ diff --git a/tests/test_files/embedded.docx b/tests/test_files/embedded.docx index 9fa3095..8469972 100644 Binary files a/tests/test_files/embedded.docx and b/tests/test_files/embedded.docx differ diff --git a/tests/test_files/embedded_embedded_docx.docx b/tests/test_files/embedded_embedded_docx.docx index 8313918..2919209 100644 Binary files a/tests/test_files/embedded_embedded_docx.docx and b/tests/test_files/embedded_embedded_docx.docx differ diff --git a/tests/test_files/escape.docx b/tests/test_files/escape.docx index 8638494..538e1a1 100644 Binary files a/tests/test_files/escape.docx and b/tests/test_files/escape.docx differ diff --git a/tests/test_files/header_footer.docx b/tests/test_files/header_footer.docx index 557cfbe..bfa2554 100644 Binary files a/tests/test_files/header_footer.docx and b/tests/test_files/header_footer.docx differ diff --git a/tests/test_files/header_footer_entities.docx b/tests/test_files/header_footer_entities.docx index 05a4518..bf06b55 100644 Binary files a/tests/test_files/header_footer_entities.docx and b/tests/test_files/header_footer_entities.docx differ diff --git a/tests/test_files/header_footer_image.docx b/tests/test_files/header_footer_image.docx index 04e21f6..726aa93 100644 Binary files a/tests/test_files/header_footer_image.docx and b/tests/test_files/header_footer_image.docx differ diff --git a/tests/test_files/header_footer_utf8.docx b/tests/test_files/header_footer_utf8.docx index ce5ac35..eac9916 100644 Binary files a/tests/test_files/header_footer_utf8.docx and b/tests/test_files/header_footer_utf8.docx differ diff --git a/tests/test_files/inline_image.docx b/tests/test_files/inline_image.docx index 5d2108b..226e461 100644 Binary files a/tests/test_files/inline_image.docx and b/tests/test_files/inline_image.docx differ diff --git a/tests/test_files/nested_for.docx b/tests/test_files/nested_for.docx index 4349236..46750b5 100644 Binary files a/tests/test_files/nested_for.docx and b/tests/test_files/nested_for.docx differ diff --git a/tests/test_files/order.docx b/tests/test_files/order.docx index 0b07c19..d837ed6 100644 Binary files a/tests/test_files/order.docx and b/tests/test_files/order.docx differ diff --git a/tests/test_files/replace_picture.docx b/tests/test_files/replace_picture.docx index 55ec90f..43512f2 100644 Binary files a/tests/test_files/replace_picture.docx and b/tests/test_files/replace_picture.docx differ diff --git a/tests/test_files/richtext.docx b/tests/test_files/richtext.docx index 4e712e7..c18c634 100644 Binary files a/tests/test_files/richtext.docx and b/tests/test_files/richtext.docx differ diff --git a/tests/test_files/richtext_and_if.docx b/tests/test_files/richtext_and_if.docx index fb12252..df7349c 100644 Binary files a/tests/test_files/richtext_and_if.docx and b/tests/test_files/richtext_and_if.docx differ diff --git a/tests/test_files/subdoc.docx b/tests/test_files/subdoc.docx index a291089..ffe3730 100644 Binary files a/tests/test_files/subdoc.docx and b/tests/test_files/subdoc.docx differ diff --git a/tests/test_files/vertical_merge.docx b/tests/test_files/vertical_merge.docx index 15a504c..ae1d5fd 100644 Binary files a/tests/test_files/vertical_merge.docx and b/tests/test_files/vertical_merge.docx differ diff --git a/tests/test_files/word2016.docx b/tests/test_files/word2016.docx index 99fa3af..721d2e2 100644 Binary files a/tests/test_files/word2016.docx and b/tests/test_files/word2016.docx differ