mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-06 16:09:30 +00:00
LibGfx+Userland: Move FontWeight enum into its own file
FontDatabase.h with its includes add up to quite a lot of code. In the next commit, compiled GML files are going to need to access the FontWeight enum, so let's allow them to do that without pulling in lots of other things. Also, change users to include FontWeight.h instead of FontDatabase.h where appropriate.
This commit is contained in:
parent
9b3f9c46b9
commit
3df3a85235
|
@ -354,6 +354,7 @@ static ErrorOr<String> generate_cpp(NonnullRefPtr<GUI::GML::GMLFile> gml, Lexica
|
|||
TRY(String::from_utf8("<AK/JsonValue.h>"sv)),
|
||||
TRY(String::from_utf8("<AK/NonnullRefPtr.h>"sv)),
|
||||
TRY(String::from_utf8("<AK/RefPtr.h>"sv)),
|
||||
TRY(String::from_utf8("<LibGfx/Font/FontWeight.h>"sv)),
|
||||
// For Gfx::ColorRole
|
||||
TRY(String::from_utf8("<LibGfx/SystemTheme.h>"sv)),
|
||||
TRY(String::from_utf8("<LibGUI/Widget.h>"sv)),
|
||||
|
|
|
@ -34,8 +34,8 @@
|
|||
#include <LibGUI/SeparatorWidget.h>
|
||||
#include <LibGUI/TabWidget.h>
|
||||
#include <LibGfx/Font/BitmapFont.h>
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
#include <LibGfx/Font/FontStyleMapping.h>
|
||||
#include <LibGfx/Font/FontWeight.h>
|
||||
#include <LibGfx/Font/OpenType/Font.h>
|
||||
#include <LibGfx/Font/Typeface.h>
|
||||
#include <LibGfx/Font/WOFF/Font.h>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include <LibGfx/BitmapMixer.h>
|
||||
#include <LibGfx/Filters/FastBoxBlurFilter.h>
|
||||
#include <LibGfx/Filters/LumaFilter.h>
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
#include <LibGfx/Font/FontWeight.h>
|
||||
|
||||
namespace PixelPaint::Filters {
|
||||
|
||||
|
|
|
@ -6,8 +6,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <LibGfx/Color.h>
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
#include <LibGfx/Font/FontWeight.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
|
||||
class Presentation;
|
||||
|
|
|
@ -11,26 +11,12 @@
|
|||
#include <AK/Function.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <LibGfx/Font/FontWeight.h>
|
||||
#include <LibGfx/Font/Typeface.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
namespace FontWeight {
|
||||
enum {
|
||||
Thin = 100,
|
||||
ExtraLight = 200,
|
||||
Light = 300,
|
||||
Regular = 400,
|
||||
Medium = 500,
|
||||
SemiBold = 600,
|
||||
Bold = 700,
|
||||
ExtraBold = 800,
|
||||
Black = 900,
|
||||
ExtraBlack = 950
|
||||
};
|
||||
}
|
||||
|
||||
class FontDatabase {
|
||||
public:
|
||||
static FontDatabase& the();
|
||||
|
|
24
Userland/Libraries/LibGfx/Font/FontWeight.h
Normal file
24
Userland/Libraries/LibGfx/Font/FontWeight.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Gfx::FontWeight {
|
||||
|
||||
enum {
|
||||
Thin = 100,
|
||||
ExtraLight = 200,
|
||||
Light = 300,
|
||||
Regular = 400,
|
||||
Medium = 500,
|
||||
SemiBold = 600,
|
||||
Bold = 700,
|
||||
ExtraBold = 800,
|
||||
Black = 900,
|
||||
ExtraBlack = 950
|
||||
};
|
||||
|
||||
}
|
|
@ -7,8 +7,8 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
#include <LibGfx/Font/FontStyleMapping.h>
|
||||
#include <LibGfx/Font/FontWeight.h>
|
||||
#include <LibWeb/CSS/StyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/AbstractImageStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/AngleStyleValue.h>
|
||||
|
|
Loading…
Reference in a new issue