[Libreoffice-commits] core.git: 2 commits - svtools/source

Caolán McNamara caolanm at redhat.com
Sat Sep 13 02:19:37 PDT 2014


 svtools/source/misc/sampletext.cxx |   27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

New commits:
commit 6ceff3f7deb1a6b66c0119c73b797a925f8fbee7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Sep 13 10:18:00 2014 +0100

    Related: fdo#82259 GungSeo has no OS/2 table
    
    Change-Id: Idf2431927d8f501f87301d01a7bb884f1445125f

diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx
index c4a7598..2749f6f 100644
--- a/svtools/source/misc/sampletext.cxx
+++ b/svtools/source/misc/sampletext.cxx
@@ -32,6 +32,11 @@ static UScriptCode lcl_getHardCodedScriptNameForFont (const OutputDevice &rDevic
         // but in fact it's a Traditional Chinese font.
         return USCRIPT_TRADITIONAL_HAN;
     }
+    else if (rName == "GungSeo")
+    {
+        // "GungSeo" has no OS/2 table, but we know it's a Korean font.
+        return USCRIPT_KOREAN;
+    }
     else if (rName.startsWith("Bangla "))
     {
         // "Bangla Sangam MN" claims it supports MALAYALAM, but it doesn't
commit aa9abb373eafb92bb2558ff49748766a8bb8cef0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Sep 13 10:13:37 2014 +0100

    do HardCodedScriptName before getting Font Capabilities
    
    Change-Id: I3f3f14b3b24abbbdb40f8eb6655d42b12d920999

diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx
index 1472c01..c4a7598 100644
--- a/svtools/source/misc/sampletext.cxx
+++ b/svtools/source/misc/sampletext.cxx
@@ -1247,22 +1247,19 @@ namespace
 
 OUString makeShortRepresentativeTextForSelectedFont(OutputDevice &rDevice)
 {
-    vcl::FontCapabilities aFontCapabilities;
-    if (!rDevice.GetFontCapabilities(aFontCapabilities))
-        return OUString();
+    UScriptCode eScript = lcl_getHardCodedScriptNameForFont(rDevice);
+    if (eScript == USCRIPT_INVALID_CODE)
+    {
+        vcl::FontCapabilities aFontCapabilities;
+        if (!rDevice.GetFontCapabilities(aFontCapabilities))
+            return OUString();
 
 #if OSL_DEBUG_LEVEL > 2
-    fprintf(stderr, "font is %s\n",
-        OUStringToOString(rDevice.GetFont().GetName(), RTL_TEXTENCODING_UTF8).getStr());
-    lcl_dump_unicode_coverage(aFontCapabilities.maUnicodeRange);
-    lcl_dump_codepage_coverage(aFontCapabilities.maCodePageRange);
+        lcl_dump_unicode_coverage(aFontCapabilities.maUnicodeRange);
+        lcl_dump_codepage_coverage(aFontCapabilities.maCodePageRange);
 #endif
 
-    aFontCapabilities.maUnicodeRange &= getCommonLatnSubsetMask();
-
-    UScriptCode eScript = lcl_getHardCodedScriptNameForFont (rDevice);
-
-    if (eScript == USCRIPT_INVALID_CODE) {
+        aFontCapabilities.maUnicodeRange &= getCommonLatnSubsetMask();
 
         //If this font is probably tuned to display a single non-Latin
         //script and the font name is itself in Latin, then show a small
@@ -1272,7 +1269,6 @@ OUString makeShortRepresentativeTextForSelectedFont(OutputDevice &rDevice)
             return OUString();
 
         eScript = attemptToDisambiguateHan(eScript, rDevice);
-
     }
 
     OUString sSampleText = makeShortRepresentativeTextForScript(eScript);


More information about the Libreoffice-commits mailing list