Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
font_collection.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_LIB_UI_TEXT_FONT_COLLECTION_H_
6#define FLUTTER_LIB_UI_TEXT_FONT_COLLECTION_H_
7
8#include <memory>
9#include <vector>
10
11#include "flutter/assets/asset_manager.h"
12#include "flutter/fml/macros.h"
13#include "flutter/fml/memory/ref_ptr.h"
15#include "txt/font_collection.h"
16
17namespace flutter {
18
20 public:
22
23 virtual ~FontCollection();
24
25 std::shared_ptr<txt::FontCollection> GetFontCollection() const;
26
27 void SetupDefaultFontManager(uint32_t font_initialization_data);
28
29 // Virtual for testing.
30 virtual void RegisterFonts(
31 const std::shared_ptr<AssetManager>& asset_manager);
32
33 void RegisterTestFonts();
34
35 static void LoadFontFromList(Dart_Handle font_data_handle,
37 const std::string& family_name);
38
39 private:
40 std::shared_ptr<txt::FontCollection> collection_;
41 sk_sp<txt::DynamicFontManager> dynamic_font_manager_;
42
44};
45
46} // namespace flutter
47
48#endif // FLUTTER_LIB_UI_TEXT_FONT_COLLECTION_H_
std::shared_ptr< txt::FontCollection > GetFontCollection() const
virtual void RegisterFonts(const std::shared_ptr< AssetManager > &asset_manager)
static void LoadFontFromList(Dart_Handle font_data_handle, Dart_Handle callback, const std::string &family_name)
void SetupDefaultFontManager(uint32_t font_initialization_data)
struct _Dart_Handle * Dart_Handle
Definition dart_api.h:258
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27