Move font related types to src/app/fonts

This commit is contained in:
David Capello 2025-03-03 22:36:11 -03:00
parent ce989684d0
commit 2706d2d75a
20 changed files with 53 additions and 46 deletions

2
laf

@ -1 +1 @@
Subproject commit db9cb0de00067e34139c6f8ff4847cd572d68b31
Subproject commit d05217849afaa833baee761e425d59acd1b9828f

View File

@ -1,5 +1,5 @@
# Aseprite
# Copyright (C) 2018-2024 Igara Studio S.A.
# Copyright (C) 2018-2025 Igara Studio S.A.
# Copyright (C) 2001-2018 David Capello
# Generate a ui::Widget for each widget in a XML file
@ -98,11 +98,11 @@ add_library(app-lib ${generated_files})
# These specific-platform files should be in an external library
# (e.g. "base" or "os").
if(WIN32)
target_sources(app-lib PRIVATE font_path_win.cpp)
target_sources(app-lib PRIVATE fonts/font_path_win.cpp)
elseif(APPLE)
target_sources(app-lib PRIVATE font_path_osx.mm)
target_sources(app-lib PRIVATE fonts/font_path_osx.mm)
else()
target_sources(app-lib PRIVATE font_path_unix.cpp)
target_sources(app-lib PRIVATE fonts/font_path_unix.cpp)
endif()
# This defines a specific webp decoding utility function for using
@ -544,8 +544,9 @@ target_sources(app-lib PRIVATE
file_system.cpp
filename_formatter.cpp
flatten.cpp
font_info.cpp
font_path.cpp
fonts/font_data.cpp
fonts/font_info.cpp
fonts/font_path.cpp
gui_xml.cpp
i18n/strings.cpp
i18n/xml_translator.cpp
@ -669,7 +670,6 @@ target_sources(app-lib PRIVATE
ui/search_entry.cpp
ui/select_accelerator.cpp
ui/selection_mode_field.cpp
ui/skin/font_data.cpp
ui/skin/skin_part.cpp
ui/skin/skin_property.cpp
ui/skin/skin_slider_property.cpp

View File

@ -18,6 +18,7 @@
#include "app/extensions.h"
#include "app/file/file.h"
#include "app/file_selector.h"
#include "app/fonts/font_data.h"
#include "app/i18n/strings.h"
#include "app/ini_file.h"
#include "app/launcher.h"
@ -34,7 +35,6 @@
#include "app/ui/rgbmap_algorithm_selector.h"
#include "app/ui/sampling_selector.h"
#include "app/ui/separator_in_view.h"
#include "app/ui/skin/font_data.h"
#include "app/ui/skin/skin_theme.h"
#include "app/util/render_text.h"
#include "base/convert_to.h"

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2020-2024 Igara Studio S.A.
// Copyright (C) 2020-2025 Igara Studio S.A.
// Copyright (C) 2001-2017 David Capello
//
// This program is distributed under the terms of
@ -9,7 +9,7 @@
#include "config.h"
#endif
#include "app/ui/skin/font_data.h"
#include "app/fonts/font_data.h"
#include "text/font.h"
#include "text/font_mgr.h"
@ -18,7 +18,7 @@
#include <set>
namespace app { namespace skin {
namespace app {
FontData::FontData(text::FontType type)
: m_type(type)
@ -73,4 +73,4 @@ text::FontRef FontData::getFont(text::FontMgrRef& fontMgr, int size)
return getFont(fontMgr, size, ui::guiscale());
}
}} // namespace app::skin
} // namespace app

View File

@ -1,12 +1,12 @@
// Aseprite
// Copyright (C) 2020-2024 Igara Studio S.A.
// Copyright (C) 2020-2025 Igara Studio S.A.
// Copyright (C) 2017 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifndef APP_UI_SKIN_FONT_DATA_H_INCLUDED
#define APP_UI_SKIN_FONT_DATA_H_INCLUDED
#ifndef APP_FONTS_FONT_DATA_H_INCLUDED
#define APP_FONTS_FONT_DATA_H_INCLUDED
#pragma once
#include "base/disable_copying.h"
@ -15,7 +15,7 @@
#include <map>
namespace app { namespace skin {
namespace app {
// TODO should we merge this with FontInfo?
class FontData {
@ -46,6 +46,6 @@ private:
DISABLE_COPYING(FontData);
};
}} // namespace app::skin
} // namespace app
#endif

View File

@ -8,7 +8,8 @@
#include "config.h"
#endif
#include "app/font_info.h"
#include "app/fonts/font_info.h"
#include "app/pref/preferences.h"
#include "base/fs.h"
#include "base/split_string.h"

View File

@ -4,8 +4,8 @@
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifndef APP_UI_FONT_INFO_H_INCLUDED
#define APP_UI_FONT_INFO_H_INCLUDED
#ifndef APP_FONTS_FONT_INFO_H_INCLUDED
#define APP_FONTS_FONT_INFO_H_INCLUDED
#pragma once
#include "base/convert_to.h"

View File

@ -1,12 +1,12 @@
// Aseprite
// Copyright (c) 2024 Igara Studio S.A.
// Copyright (c) 2024-2025 Igara Studio S.A.
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#include "tests/app_test.h"
#include "app/font_info.h"
#include "app/fonts/font_info.h"
using namespace app;
using namespace std::literals;

View File

@ -1,4 +1,5 @@
// Aseprite
// Copyright (C) 2025 Igara Studio S.A.
// Copyright (C) 2017-2018 David Capello
//
// This program is distributed under the terms of
@ -8,7 +9,7 @@
#include "config.h"
#endif
#include "app/font_path.h"
#include "app/fonts/font_path.h"
#include "base/fs.h"

View File

@ -4,8 +4,8 @@
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifndef APP_FONT_PATH_H_INCLUDED
#define APP_FONT_PATH_H_INCLUDED
#ifndef APP_FONTS_FONT_PATH_H_INCLUDED
#define APP_FONTS_FONT_PATH_H_INCLUDED
#pragma once
#include "base/paths.h"

View File

@ -1,4 +1,5 @@
// Aseprite
// Copyright (C) 2025 Igara Studio S.A.
// Copyright (C) 2017-2018 David Capello
//
// This program is distributed under the terms of
@ -8,7 +9,7 @@
#include "config.h"
#endif
#include "app/font_path.h"
#include "app/fonts/font_path.h"
#include "base/fs.h"

View File

@ -1,4 +1,5 @@
// Aseprite
// Copyright (C) 2025 Igara Studio S.A.
// Copyright (C) 2017-2018 David Capello
//
// This program is distributed under the terms of
@ -8,7 +9,7 @@
#include "config.h"
#endif
#include "app/font_path.h"
#include "app/fonts/font_path.h"
#include "base/fs.h"

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2019 Igara Studio S.A.
// Copyright (C) 2019-2025 Igara Studio S.A.
// Copyright (C) 2017-2018 David Capello
//
// This program is distributed under the terms of
@ -9,7 +9,7 @@
#include "config.h"
#endif
#include "app/font_path.h"
#include "app/fonts/font_path.h"
#include "base/fs.h"
#include "base/string.h"

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (c) 2022-2024 Igara Studio S.A.
// Copyright (c) 2022-2025 Igara Studio S.A.
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -11,7 +11,7 @@
#include "app/ui/editor/select_text_box_state.h"
#include "app/app.h"
#include "app/font_info.h"
#include "app/fonts/font_info.h"
#include "app/ui/context_bar.h"
#include "app/ui/editor/editor.h"
#include "app/ui/editor/writing_text_state.h"

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2022-2024 Igara Studio S.A.
// Copyright (C) 2022-2025 Igara Studio S.A.
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -14,7 +14,7 @@
#include "app/color_utils.h"
#include "app/commands/command.h"
#include "app/extra_cel.h"
#include "app/font_info.h"
#include "app/fonts/font_info.h"
#include "app/pref/preferences.h"
#include "app/site.h"
#include "app/tx.h"

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (c) 2024 Igara Studio S.A.
// Copyright (c) 2024-2025 Igara Studio S.A.
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -8,7 +8,7 @@
#define APP_UI_FONT_ENTRY_H_INCLUDED
#pragma once
#include "app/font_info.h"
#include "app/fonts/font_info.h"
#include "app/ui/button_set.h"
#include "app/ui/search_entry.h"
#include "ui/box.h"

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2020-2024 Igara Studio S.A.
// Copyright (C) 2020-2025 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
@ -13,13 +13,13 @@
#include "app/app.h"
#include "app/file_selector.h"
#include "app/font_info.h"
#include "app/font_path.h"
#include "app/fonts/font_data.h"
#include "app/fonts/font_info.h"
#include "app/fonts/font_path.h"
#include "app/i18n/strings.h"
#include "app/match_words.h"
#include "app/recent_files.h"
#include "app/ui/separator_in_view.h"
#include "app/ui/skin/font_data.h"
#include "app/ui/skin/skin_theme.h"
#include "app/util/conversion_to_surface.h"
#include "app/util/render_text.h"

View File

@ -14,14 +14,14 @@
#include "app/app.h"
#include "app/console.h"
#include "app/extensions.h"
#include "app/font_info.h"
#include "app/font_path.h"
#include "app/fonts/font_data.h"
#include "app/fonts/font_info.h"
#include "app/fonts/font_path.h"
#include "app/modules/gui.h"
#include "app/pref/preferences.h"
#include "app/resource_finder.h"
#include "app/ui/app_menuitem.h"
#include "app/ui/keyboard_shortcuts.h"
#include "app/ui/skin/font_data.h"
#include "app/ui/skin/skin_property.h"
#include "app/ui/skin/skin_slider_property.h"
#include "app/util/render_text.h"

View File

@ -29,11 +29,13 @@ class Entry;
class Graphics;
} // namespace ui
namespace app { namespace skin {
namespace app {
class FontData;
using FontDataMap = std::map<std::string, FontData*>;
namespace skin {
class ThemeFont {
public:
ThemeFont() {}
@ -227,6 +229,7 @@ private:
int m_preferredUIScaling;
};
}} // namespace app::skin
} // namespace skin
} // namespace app
#endif

View File

@ -11,7 +11,7 @@
#include "app/util/render_text.h"
#include "app/font_info.h"
#include "app/fonts/font_info.h"
#include "app/ui/skin/skin_theme.h"
#include "base/fs.h"
#include "doc/blend_funcs.h"