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