diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-07-20 14:49:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-07-20 17:16:11 +0200 |
commit | 4a627a5724c9a9a4e469921d032376703260fbff (patch) | |
tree | bb716100ba5e191d8a1273f852c91f2341b26477 /vcl | |
parent | 3c51047edc9209ca97e9d6611deb4258d5be71d2 (diff) |
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
Reviewed-on: https://gerrit.libreoffice.org/57778
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
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 ); |