Blame SOURCES/0001-implement-pdf-export-of-underline-for-outlined-font.patch

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