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