RhythmGame 1.4.3
Loading...
Searching...
No Matches
Lr2FontImageProvider.h
Go to the documentation of this file.
1#pragma once
2
3#include <QImage>
4#include <QQuickImageProvider>
5#include <QSizeF>
6
7namespace resource_managers {
8
10{
11 QImage image;
13};
14
15// URL formats served:
16//
17// image://lr2font/<absolute-font-path>?text=<urlencoded-string>
18// Composes the entire bitmap-font string into one image. The provider keeps
19// font atlases cached through Lr2FontCache, but intentionally does not keep
20// a global cache of full strings: select screens can contain thousands of
21// high-cardinality titles that would evict useful pixmaps and churn memory.
22class Lr2FontImageProvider : public QQuickImageProvider
23{
24 public:
26
27 static Lr2RenderedFontText renderedText(const QString& fontPath,
28 const QString& text);
29 static QImage textImage(const QString& fontPath, const QString& text);
30 static QImage scaledTextImage(const QString& fontPath,
31 const QString& text,
32 const QSize& targetSize,
33 bool smooth = false);
34
35 QImage requestImage(const QString& id,
36 QSize* size,
37 const QSize& requestedSize) override;
38};
39
40} // namespace resource_managers
int size
Definition Lr2SkinParser.cpp:89
Definition Lr2FontImageProvider.h:23
QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override
Definition Lr2FontImageProvider.cpp:233
static QImage textImage(const QString &fontPath, const QString &text)
Definition Lr2FontImageProvider.cpp:212
static QImage scaledTextImage(const QString &fontPath, const QString &text, const QSize &targetSize, bool smooth=false)
Definition Lr2FontImageProvider.cpp:218
Lr2FontImageProvider()
Definition Lr2FontImageProvider.cpp:206
static Lr2RenderedFontText renderedText(const QString &fontPath, const QString &text)
Definition Lr2FontImageProvider.cpp:227
Classes and functions related to loading and managing resources such as charts, sounds,...
Definition ProfileArenaIdentityProvider.h:12
Definition Lr2FontImageProvider.h:10
QSizeF naturalSize
Definition Lr2FontImageProvider.h:12
QImage image
Definition Lr2FontImageProvider.h:11