summaryrefslogtreecommitdiff
path: root/chromium/base/test/fontconfig_util_linux.cc
blob: 4f6c1c7134933011412d5d8b54b53638c01db22b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/test/fontconfig_util_linux.h"

#include <fontconfig/fontconfig.h>

#include <memory>

#include "base/base_paths.h"
#include "base/check.h"
#include "base/environment.h"
#include "base/files/file_path.h"
#include "base/path_service.h"

namespace base {

void SetUpFontconfig() {
  FilePath dir_module;
  CHECK(PathService::Get(DIR_MODULE, &dir_module));

  std::unique_ptr<Environment> env(Environment::Create());
  CHECK(env->SetVar("FONTCONFIG_SYSROOT", dir_module.value().c_str()));
}

}  // namespace base