summaryrefslogtreecommitdiff
path: root/svtools/source/misc/sampletext.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-09-13 10:13:37 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-09-13 10:19:05 +0100
commitaa9abb373eafb92bb2558ff49748766a8bb8cef0 (patch)
treea46e01dd3086cf79413e6f5e1532c3d964ec53bc /svtools/source/misc/sampletext.cxx
parentdeeeb88f37170860366ef5ba25c96016917e1f30 (diff)
do HardCodedScriptName before getting Font Capabilities
Change-Id: I3f3f14b3b24abbbdb40f8eb6655d42b12d920999
Diffstat (limited to 'svtools/source/misc/sampletext.cxx')
-rw-r--r--svtools/source/misc/sampletext.cxx22
1 files changed, 9 insertions, 13 deletions
diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx
index 1472c015b35b..c4a75988c289 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);