implement export of underline in outlined font for simple case

f41
Caolán McNamara 7 years ago
parent 680b05a0f4
commit ff660f4c63

@ -0,0 +1,48 @@
From 778d1008a683acc25bd01f12387ae3d86ad3619c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Fri, 20 Jul 2018 14:49:17 +0100
Subject: [PATCH] implement pdf export of underline for outlined font
just the simplest case of a straight solid line which is outlined,
i.e. border in font color and filled with white
Change-Id: I7d670a543475b6457cb2827e74a05bba6c4a91ea
---
vcl/source/gdi/pdfwriter_impl.cxx | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index f623344d06e0..3071fb1371f4 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -7408,6 +7408,27 @@ void PDFWriterImpl::drawStraightTextLine( OStringBuffer& aLine, long nWidth, Fon
if ( !nLineHeight )
return;
+ // outline attribute ?
+ if (m_aCurrentPDFState.m_aFont.IsOutline() && eTextLine == LINESTYLE_SINGLE)
+ {
+ appendStrokingColor(aColor, aLine); // stroke with text color
+ aLine.append( " " );
+ Color aNonStrokeColor(COL_WHITE); // fill with white
+ appendNonStrokingColor(aNonStrokeColor, aLine);
+ aLine.append( "\n" );
+ aLine.append( "0.25 w \n" ); // same line thickness as in drawLayout
+
+ // draw rectangle instead
+ aLine.append( "0 " );
+ m_aPages.back().appendMappedLength( static_cast<sal_Int32>(-nLinePos * 1.5), aLine );
+ aLine.append( " " );
+ m_aPages.back().appendMappedLength( static_cast<sal_Int32>(nWidth), aLine, false );
+ aLine.append( ' ' );
+ m_aPages.back().appendMappedLength( static_cast<sal_Int32>(nLineHeight), aLine );
+ aLine.append( " re h B\n" );
+ return;
+ }
+
m_aPages.back().appendMappedLength( static_cast<sal_Int32>(nLineHeight), aLine );
aLine.append( " w " );
appendStrokingColor( aColor, aLine );
--
2.17.0

@ -64,7 +64,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice Name: libreoffice
Epoch: 1 Epoch: 1
Version: %{libo_version}.1 Version: %{libo_version}.1
Release: 4%{?libo_prerelease}%{?dist} Release: 5%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and MPLv2.0 and CC0 License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and MPLv2.0 and CC0
URL: http://www.libreoffice.org/ URL: http://www.libreoffice.org/
@ -280,6 +280,7 @@ Patch9: 0001-We-use-ICU-61-now.patch
Patch10: 0001-Upgrade-to-ICU-62.1.patch Patch10: 0001-Upgrade-to-ICU-62.1.patch
Patch11: 0001-Use-ICU_MAJOR-instead-of-hard-coded-Upgrade-to-ICU-6.patch Patch11: 0001-Use-ICU_MAJOR-instead-of-hard-coded-Upgrade-to-ICU-6.patch
Patch12: covscan.patch Patch12: covscan.patch
Patch13: 0001-implement-pdf-export-of-underline-for-outlined-font.patch
%if 0%{?rhel} %if 0%{?rhel}
# not upstreamed # not upstreamed
@ -2325,6 +2326,9 @@ done
%{_includedir}/LibreOfficeKit %{_includedir}/LibreOfficeKit
%changelog %changelog
* Fri Jul 20 2018 Caolán McNamara <caolanm@redhat.com> - 1:6.0.6.1-5
- implement export of underline in outlined font for simple case
* Wed Jul 18 2018 Caolán McNamara <caolanm@redhat.com> - 1:6.0.6.1-4 * Wed Jul 18 2018 Caolán McNamara <caolanm@redhat.com> - 1:6.0.6.1-4
- Resolves: rhbz#1602589 fix covscan issues - Resolves: rhbz#1602589 fix covscan issues

Loading…
Cancel
Save