[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - svtools/source

Caolán McNamara caolanm at redhat.com
Tue Aug 12 09:44:02 PDT 2014


 svtools/source/misc/sampletext.cxx |   38 +++++++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 6 deletions(-)

New commits:
commit bea80c70375fd370f080d65089fff54abfa73870
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 11 12:46:43 2014 +0100

    Related: fdo#82259 add Armenian preview text
    
    Change-Id: I3698b5cbf8c39e618faaae1321eaa4442f1b2827
    (cherry picked from commit 94753833b94dee42ce2e0e7e7f3f354c2a605730)
    
    Related: fdo#82259 stmary can render its own name, but unreadably
    
    Change-Id: Iedff28d1290efb38eb68f83757a0787d52e28859
    (cherry picked from commit 212f745c29c7399fa0d62a53d3836dc1e829e953)
    
    Related: fdo#82259 list Apple Color Emoji as a symbol font.
    
    Note that this is a blind fix, as I don’t have an OS X machine.
    
    Change-Id: I43a98fbbee06117b914eae332d48b2793a266bce
    Reviewed-on: https://gerrit.libreoffice.org/10812
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 25e81910d1b560c7ef05a907abbf80fb2c647d32)
    
    Related: fdo#82259 all the STIX fonts are really for symbols
    
    Change-Id: Id032f1b643199a57c6fc08ccf580a54ff2370861
    (cherry picked from commit b56bb5dce9a225bb0b8d6c57120da55e4cae7def)
    
    Resolves: fdo#82259 use same symbol strategy on all platforms
    
    Change-Id: Ia4f0a36c8a95849b7c8551b930873e912b673537
    (cherry picked from commit 16076f120340673ad64df1614206f0e13e3539d5)
    
    Related: fdo#82259 OpenSymbol doesn't have 0x2706 or 0x2704 so no preview
    
    Change-Id: I2164cb2c37c7b13759e47561002024fd2bb577f9
    (cherry picked from commit 662af47c3c1628700661a8d5ccfee784f7e2195b)
    
    Related: fdo#82259 esint10 can't render its name either
    
    Change-Id: Idcb881613900001f237cf343e7bc485c170e4385
    (cherry picked from commit 92f3e68cd107b48ca24563e27c36afa963f392e3)
    
    Related: fdo#82259 Show same preview for both Symbol variants
    
    Change-Id: Iafabbe5068a1817b5be717018536e0d31117c434
    (cherry picked from commit 198a775ebccc69e71b97f048d1d6c4b9651662ad)
    Reviewed-on: https://gerrit.libreoffice.org/10890
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx
index 28ccec9..dd26f80 100644
--- a/svtools/source/misc/sampletext.cxx
+++ b/svtools/source/misc/sampletext.cxx
@@ -22,8 +22,10 @@ bool isOpenSymbolFont(const Font &rFont)
 bool isSymbolFont(const Font &rFont)
 {
     return (rFont.GetCharSet() == RTL_TEXTENCODING_SYMBOL) ||
+            rFont.GetName().equalsIgnoreAsciiCase("Apple Color Emoji") ||
             rFont.GetName().equalsIgnoreAsciiCase("cmsy10") ||
             rFont.GetName().equalsIgnoreAsciiCase("cmex10") ||
+            rFont.GetName().equalsIgnoreAsciiCase("esint10") ||
             rFont.GetName().equalsIgnoreAsciiCase("feta26") ||
             rFont.GetName().equalsIgnoreAsciiCase("jsMath-cmsy10") ||
             rFont.GetName().equalsIgnoreAsciiCase("jsMath-cmex10") ||
@@ -38,6 +40,9 @@ bool isSymbolFont(const Font &rFont)
             rFont.GetName().equalsIgnoreAsciiCase("Letters Laughing") ||
             rFont.GetName().equalsIgnoreAsciiCase("MusiQwik") ||
             rFont.GetName().equalsIgnoreAsciiCase("MusiSync") ||
+            rFont.GetName().equalsIgnoreAsciiCase("stmary10") ||
+            rFont.GetName().equalsIgnoreAsciiCase("Symbol") ||
+            rFont.GetName().startsWith("STIX") ||
             isOpenSymbolFont(rFont);
 }
 
@@ -49,6 +54,20 @@ bool canRenderNameOfSelectedFont(OutputDevice &rDevice)
 
 OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice &rDevice)
 {
+    if (rDevice.GetFont().GetName() == "Symbol")
+    {
+        static const sal_Unicode aImplAppleSymbolText[] = {
+            0x03BC, 0x2202, 0x2211, 0x220F, 0x03C0, 0x222B, 0x03A9, 0x221A, 0};
+        OUString sSampleText(aImplAppleSymbolText);
+        bool bHasSampleTextGlyphs = (-1 == rDevice.HasGlyphs(rDevice.GetFont(), sSampleText));
+        //It's the Apple version
+        if (bHasSampleTextGlyphs)
+            return OUString(aImplAppleSymbolText);
+        static const sal_Unicode aImplAdobeSymbolText[] = {
+            0xF06D, 0xF0B6, 0xF0E5, 0xF0D5, 0xF070, 0xF0F2, 0xF057, 0xF0D6, 0};
+        return OUString(aImplAdobeSymbolText);
+    }
+
     const bool bOpenSymbol = isOpenSymbolFont(rDevice.GetFont());
 
     if (!bOpenSymbol)
@@ -62,11 +81,6 @@ OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice &rDevice)
 
             // start just above the PUA used by most symbol fonts
             sal_uInt32 cNewChar = 0xFF00;
-#ifdef MACOSX
-            // on MacOSX there are too many non-presentable symbols above the codepoint 0x0192
-            if( !bOpenSymbol )
-                cNewChar = 0x0192;
-#endif
 
             const int nMaxCount = sizeof(aText)/sizeof(*aText) - 1;
             int nSkip = aFontCharMap.GetCharCount() / nMaxCount;
@@ -92,7 +106,7 @@ OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice &rDevice)
     static const sal_Unicode aImplSymbolFontText[] = {
         0xF021,0xF032,0xF043,0xF054,0xF065,0xF076,0xF0B7,0xF0C8,0};
     static const sal_Unicode aImplStarSymbolText[] = {
-        0x2706,0x2704,0x270D,0xE033,0x2211,0x2288,0};
+        0x2702,0x2708,0x270D,0xE033,0x2211,0x2288,0};
     const sal_Unicode* pText = bOpenSymbol ? aImplStarSymbolText : aImplSymbolFontText;
     OUString sSampleText(pText);
     bool bHasSampleTextGlyphs = (-1 == rDevice.HasGlyphs(rDevice.GetFont(), sSampleText));
@@ -141,6 +155,15 @@ OUString makeShortRepresentativeTextForScript(UScriptCode eScript)
             sSampleText = OUString(aArab, SAL_N_ELEMENTS(aArab));
             break;
         }
+        case USCRIPT_ARMENIAN:
+        {
+            const sal_Unicode aArmenian[] = {
+                0x0561, 0x0575, 0x0562, 0x0578, 0x0582, 0x0562, 0x0565,
+                0x0576
+            };
+            sSampleText = OUString(aArmenian, SAL_N_ELEMENTS(aArmenian));
+            break;
+        }
         case USCRIPT_DEVANAGARI:
         {
             const sal_Unicode aDeva[] = {
@@ -504,6 +527,9 @@ OUString makeRepresentativeTextForLanguage(LanguageType eLang)
     OUString sRet;
     switch( eLang & LANGUAGE_MASK_PRIMARY )
     {
+        case LANGUAGE_ARMENIAN & LANGUAGE_MASK_PRIMARY:
+            sRet = makeRepresentativeTextForScript(USCRIPT_ARMENIAN);
+            break;
         case LANGUAGE_CHINESE & LANGUAGE_MASK_PRIMARY:
             sRet = makeRepresentativeTextForScript(USCRIPT_HAN);
             break;


More information about the Libreoffice-commits mailing list