Blame SOURCES/0001-don-t-strip-font-names-of-apparent-script-suffixes-a.patch

ebc4bd
From a771f5e490bb14d81378b57fa096c4a30b29fc28 Mon Sep 17 00:00:00 2001
ebc4bd
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
ebc4bd
Date: Mon, 26 Jan 2015 15:00:29 +0000
ebc4bd
Subject: [PATCH] don't strip font names of apparent script suffixes anymore
ebc4bd
ebc4bd
e.g. "CM Roman CE" should be left alone.
ebc4bd
ebc4bd
bump font cache id to invalidate old cached lists
ebc4bd
ebc4bd
I think this practice stems from Window 3.1/Word 95 where the encoding was
ebc4bd
included in the font name
ebc4bd
http://www.webcenter.ru/~kazarn/eng/fonts_ttf.htm#charsettbl Microsoft Office
ebc4bd
still generates RTF files with weird-ass Win 3.1 style fontnames but any actual
ebc4bd
existing fonts that happen to have names that fall into that pattern should be
ebc4bd
left alone now.
ebc4bd
ebc4bd
Change-Id: Ibb704048d63b33ce510d6b1076700c6e94a0af2a
ebc4bd
---
ebc4bd
 unotools/source/misc/fontdefs.cxx | 29 +----------------------------
ebc4bd
 1 file changed, 1 insertion(+), 28 deletions(-)
ebc4bd
ebc4bd
diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
ebc4bd
index 61f6a07..006ab90 100644
ebc4bd
--- a/unotools/source/misc/fontdefs.cxx
ebc4bd
+++ b/unotools/source/misc/fontdefs.cxx
ebc4bd
@@ -332,34 +332,7 @@ void GetEnglishSearchFontName( OUString& rName )
ebc4bd
     if ( i != nLen )
ebc4bd
         rName = rName.copy( 0, i );
ebc4bd
 
ebc4bd
-    // Remove Script at the end
ebc4bd
-    // Scriptname must be the last part of the fontname and
ebc4bd
-    // looks like "fontname (scriptname)". So there can only be a
ebc4bd
-    // script name at the and of the fontname, when the last char is ')'
ebc4bd
-    if ( (nLen >= 3) && rName[ nLen-1 ] == ')' )
ebc4bd
-    {
ebc4bd
-        int nOpen = 1;
ebc4bd
-        sal_Int32 nTempLen = nLen-2;
ebc4bd
-        while ( nTempLen )
ebc4bd
-        {
ebc4bd
-            if ( rName[ nTempLen ] == '(' )
ebc4bd
-            {
ebc4bd
-                nOpen--;
ebc4bd
-                if ( !nOpen )
ebc4bd
-                {
ebc4bd
-                    // Remove Space at the end
ebc4bd
-                    if ( nTempLen && (rName[ nTempLen-1 ] == ' ') )
ebc4bd
-                        nTempLen--;
ebc4bd
-                    rName = rName.copy( 0, nTempLen );
ebc4bd
-                    nLen = nTempLen;
ebc4bd
-                    break;
ebc4bd
-                }
ebc4bd
-            }
ebc4bd
-            if ( rName[ nTempLen ] == ')' )
ebc4bd
-                nOpen++;
ebc4bd
-            nTempLen--;
ebc4bd
-        }
ebc4bd
-    }
ebc4bd
+    nLen = rName.getLength();
ebc4bd
 
ebc4bd
     // remove all whitespaces and converts to lower case ASCII
ebc4bd
     // TODO: better transliteration to ASCII e.g. all digits
ebc4bd
-- 
ebc4bd
1.9.3
ebc4bd