summaryrefslogtreecommitdiff
path: root/vcl/source/font
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2017-02-01 10:32:32 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2017-02-01 10:38:12 +0200
commit55916dfc59f05537c4e6fece77aef3cc1dbef34c (patch)
treea7bdb34d55c86ab5bce56bd650f888869ca83245 /vcl/source/font
parent22fa901db20e9b01f381fdeb48126697c1ef3680 (diff)
An env var to disable font lookup
To be used in layout tests. Change-Id: I551b87786a4ad4ab34a22c458561109270fb4a31
Diffstat (limited to 'vcl/source/font')
-rw-r--r--vcl/source/font/PhysicalFontCollection.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx
index 49082a15ccdb..7682bc53cb13 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -1003,6 +1003,17 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamily( FontSelectPattern& r
if( !Count() )
return nullptr;
+ if (getenv("SAL_NO_FONT_LOOKUP") != nullptr)
+ {
+ // Hard code the use of Liberation Sans and skip font search.
+ sal_Int32 nIndex = 0;
+ rFSD.maTargetName = GetNextFontToken(rFSD.GetFamilyName(), nIndex);
+ rFSD.maSearchName = "liberationsans";
+ PhysicalFontFamily* pFont = ImplFindFontFamilyBySearchName(rFSD.maSearchName);
+ assert(pFont);
+ return pFont;
+ }
+
bool bMultiToken = false;
sal_Int32 nTokenPos = 0;
OUString& aSearchName = rFSD.maSearchName; // TODO: get rid of reference