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

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