2025-07-06 20:43:53 +03:00
|
|
|
#pragma once
|
|
|
|
|
#include <include/core/SkFontMgr.h>
|
|
|
|
|
#include <include/core/SkTypeface.h>
|
|
|
|
|
#include <include/core/SkFont.h>
|
|
|
|
|
#include <unordered_map>
|
|
|
|
|
#include <Eigen/Dense>
|
2025-10-15 16:33:24 +03:00
|
|
|
#include <modules/skparagraph/include/FontCollection.h>
|
2025-07-06 20:43:53 +03:00
|
|
|
|
|
|
|
|
using namespace Eigen;
|
|
|
|
|
|
|
|
|
|
struct FontData {
|
|
|
|
|
FontData();
|
2025-11-11 19:52:45 +03:00
|
|
|
sk_sp<SkFontMgr> defaultFontMgr;
|
|
|
|
|
sk_sp<SkFontMgr> localFontMgr;
|
2025-10-15 16:33:24 +03:00
|
|
|
sk_sp<skia::textlayout::FontCollection> collection;
|
2025-07-06 20:43:53 +03:00
|
|
|
std::unordered_map<std::string, sk_sp<SkTypeface>> map;
|
2025-11-16 10:42:01 +03:00
|
|
|
bool fallbackOnEmoji = false;
|
|
|
|
|
const std::vector<SkString>& get_default_font_families() const;
|
|
|
|
|
void push_default_font_families(std::vector<SkString>& fontFamilies) const;
|
2025-07-06 20:43:53 +03:00
|
|
|
~FontData();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Vector2f get_str_font_bounds(const SkFont& font, const std::string& str);
|