From a9fa817b6876814b6ebc45c2534a769e1fa84cac Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sun, 22 Dec 2013 01:02:19 +0200 Subject: fdo#67370: Hyphens are not visible in tagged PDF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One requirement of tagged PDF is to represent automatically inserted hyphens using the soft hyphen (U+00AD) character, so we were doing this by simply passing that character to text layout code when exporting a tagged PDF (which is the literal suggestion of old PDF specification). This is wrong, though, since the soft hyphen is a control character and should not have a visible output by itself (and fonts might not even have a visible glyph there), but this happened to work because non of the layout engines we are using treated soft hyphen specially and was just showing whatever glyph the font had there. This broke with the switch to HarfBuzz since it will not show any visible glyph for Unicode control characters (by default), which is the right thing to do. Latest versions of PDF spec suggest using either ToUnicode mapping or an ActualText text entry to encode the soft hyphen instead, I found it easier to use ActualText since we already have code that handles non-standard hyphenation using it already. Change-Id: I88deadf3a806f69775b2e0ccff2f9b2f61a0f2e2 Reviewed-on: https://gerrit.libreoffice.org/7170 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- sw/source/core/text/txthyph.cxx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'sw/source/core/text/txthyph.cxx') diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx index 909f2ad42469..0a83abd94fb7 100644 --- a/sw/source/core/text/txthyph.cxx +++ b/sw/source/core/text/txthyph.cxx @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -370,16 +369,9 @@ sal_Bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess ) * virtual SwHyphPortion::GetExpTxt() *************************************************************************/ -sal_Bool SwHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const +sal_Bool SwHyphPortion::GetExpTxt( const SwTxtSizeInfo &/*rInf*/, OUString &rTxt ) const { - // #i16816# tagged pdf support - const sal_Unicode cChar = rInf.GetVsh() && - rInf.GetVsh()->GetViewOptions()->IsPDFExport() && - SwTaggedPDFHelper::IsExportTaggedPDF( *rInf.GetOut() ) ? - 0xad : - '-'; - - rTxt = OUString(cChar); + rTxt = "-"; return sal_True; } -- cgit v1.2.3