blob: 19069c2b33a7c7d0851c35a2132a996960bbd78b (
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
28
29
30
31
32
33
|
// Copyright 2018 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.
#ifndef COMPONENTS_SERVICES_FONT_FONTCONFIG_MATCHING_H_
#define COMPONENTS_SERVICES_FONT_FONTCONFIG_MATCHING_H_
#include "base/files/file_path.h"
#include "base/optional.h"
namespace font_service {
// Searches FontConfig for a system font uniquely identified by full font name
// or postscript name. The matching algorithm tries to match both. Used for
// matching @font-face { src: local() } references in Blink.
class FontConfigLocalMatching {
public:
struct FontConfigMatchResult {
base::FilePath file_path;
unsigned ttc_index;
};
static base::Optional<FontConfigMatchResult>
FindFontByPostscriptNameOrFullFontName(const std::string& font_name);
private:
static base::Optional<FontConfigMatchResult> FindFontBySpecifiedName(
const char* fontconfig_parameter_name,
const std::string& font_name);
};
} // namespace font_service
#endif
|