File indexing completed on 2025-02-02 04:11:04
0001 /* 0002 * SPDX-FileCopyrightText: 2019-2023 Mattia Basaglia <dev@dragon.best> 0003 * 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "asset.hpp" 0010 #include "model/custom_font.hpp" 0011 0012 namespace glaxnimate::model { 0013 0014 0015 class EmbeddedFont : public Asset 0016 { 0017 GLAXNIMATE_OBJECT(EmbeddedFont) 0018 0019 GLAXNIMATE_PROPERTY(QByteArray, data, {}, &EmbeddedFont::on_data_changed) 0020 GLAXNIMATE_PROPERTY(QString, source_url, {}) 0021 GLAXNIMATE_PROPERTY(QString, css_url, {}) 0022 0023 Q_PROPERTY(QString family READ family) 0024 Q_PROPERTY(QString style_name READ style_name) 0025 Q_PROPERTY(int database_index READ database_index) 0026 0027 public: 0028 EmbeddedFont(model::Document* document); 0029 EmbeddedFont(model::Document* document, CustomFont custom_font); 0030 0031 QIcon instance_icon() const override; 0032 QString type_name_human() const override; 0033 QString object_name() const override; 0034 bool remove_if_unused(bool clean_lists) override; 0035 0036 0037 QString family() const { return custom_font_.family(); } 0038 QString style_name() const { return custom_font_.style_name(); } 0039 int database_index() const { return custom_font_.database_index(); } 0040 const CustomFont& custom_font() const { return custom_font_; } 0041 0042 private: 0043 void on_data_changed(); 0044 0045 CustomFont custom_font_; 0046 }; 0047 0048 } // namespace glaxnimate::model