infinipaint/src/FontData.hpp

24 lines
747 B
C++
Raw Normal View History

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>
#include <modules/skparagraph/include/FontCollection.h>
2025-07-06 20:43:53 +03:00
using namespace Eigen;
struct FontData {
FontData();
sk_sp<SkFontMgr> defaultFontMgr;
sk_sp<SkFontMgr> localFontMgr;
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);