22#include <QScopedPointer>
57 static FontsDB*
inst();
60 const QVector<FontDBEntry*>
getStore()
const;
61 const QHash<QString, FontDBEntry*>
getInd()
const;
82 QScopedPointer<FontSearch, QScopedPointerDeleteLater>
search()
const;
90 QString str,
int maxLen = 11,
const bool autoEnd =
true)
const;
95 const int maxLen = 11)
const;
99 const QString
expandStr(
const QString msg,
const int maxLen,
100 const QString rival,
const QString player)
const;
105 Q_INVOKABLE
int countSizeOf(
const QString val)
const;
111 void qmlProtect(
const QQmlEngine*
const engine)
const;
114 void qmlRegister()
const;
120 QVector<FontDBEntry*> store;
121 QHash<QString, FontDBEntry*> ind;
124 void splice(QVector<int>& out,
const QString in,
const int position)
const;
A chainable filter ("finder") over the font glyphs.
const QHash< QString, FontDBEntry * > getInd() const
Name->glyph index.
FontDBEntry * getIndAt(const QString val) const
Glyph by name key (for QML).
static FontsDB * inst()
< Number of font glyphs.
FontSearch * searchRaw() const
Raw finder for QML (caller must delete; see note).
FontDBEntry * getStoreAt(const int ind) const
Glyph by store index (for QML).
void load()
Load glyphs from JSON.
const QVector< int > convertToCode(QString str, int maxLen=11, const bool autoEnd=true) const
String -> font codes (see note; expensive).
void index()
Build the name->glyph index.
int countSizeOfExpanded(const QString val) const
Rendered length after expandStr (expensive).
FontDBEntry * fontAt(int ind) const
Alias for getStoreAt (1-based-friendly UI accessor).
int countSizeOf(const QString val) const
Rendered length of val (expensive).
int getStoreSize() const
Glyph count.
const QString convertFromCode(const QVector< int > codes, const int maxLen=11) const
Font codes -> string (fast).
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
int fontCount() const
Alias for getStoreSize.
const QString expandStr(const QString msg, const int maxLen, const QString rival, const QString player) const
Expand English text to in-game form (substitutes rival/player).
const FontDBEntry * getStoreByVal(int ind) const
Glyph by its font-code value.
const QVector< FontDBEntry * > getStore() const
All glyphs.
QScopedPointer< FontSearch, QScopedPointerDeleteLater > search() const
C++-owned finder (smart pointer).
Import/export macro for the db library, plus the central list of DB entry pointer types declared opaq...
#define DB_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
One in-game font character: its code, output text, and classification flags.