2024-08-25 04:08:24 +00:00
|
|
|
#include <QFont>
|
|
|
|
#include <QList>
|
|
|
|
#include <QPaintDevice>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
|
|
|
#include "qfont.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qfont.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
extern void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QFont_new() {
|
|
|
|
return new QFont();
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QFont_new2(const char* family, size_t family_Strlen) {
|
|
|
|
QString family_QString = QString::fromUtf8(family, family_Strlen);
|
|
|
|
return new QFont(family_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QFont_new3(QFont* font, QPaintDevice* pd) {
|
|
|
|
return new QFont(*font, pd);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QFont_new4(QFont* font, QPaintDevice* pd) {
|
|
|
|
return new QFont(*font, pd);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QFont_new5(QFont* font) {
|
|
|
|
return new QFont(*font);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QFont_new6(const char* family, size_t family_Strlen, int pointSize) {
|
|
|
|
QString family_QString = QString::fromUtf8(family, family_Strlen);
|
|
|
|
return new QFont(family_QString, static_cast<int>(pointSize));
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QFont_new7(const char* family, size_t family_Strlen, int pointSize, int weight) {
|
|
|
|
QString family_QString = QString::fromUtf8(family, family_Strlen);
|
|
|
|
return new QFont(family_QString, static_cast<int>(pointSize), static_cast<int>(weight));
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QFont_new8(const char* family, size_t family_Strlen, int pointSize, int weight, bool italic) {
|
|
|
|
QString family_QString = QString::fromUtf8(family, family_Strlen);
|
|
|
|
return new QFont(family_QString, static_cast<int>(pointSize), static_cast<int>(weight), italic);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_Swap(QFont* self, QFont* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFont_Family(const QFont* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->family();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetFamily(QFont* self, const char* family, size_t family_Strlen) {
|
|
|
|
QString family_QString = QString::fromUtf8(family, family_Strlen);
|
|
|
|
self->setFamily(family_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFont_Families(const QFont* self, char*** _out, int** _out_Lengths, size_t* _out_len) {
|
|
|
|
QStringList ret = self->families();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QStringList from C++ memory to manually-managed C memory
|
|
|
|
char** __out = static_cast<char**>(malloc(sizeof(char*) * ret.length()));
|
|
|
|
int* __out_Lengths = static_cast<int*>(malloc(sizeof(int) * ret.length()));
|
|
|
|
for (size_t i = 0, e = ret.length(); i < e; ++i) {
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret[i].toUtf8();
|
|
|
|
__out[i] = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(__out[i], b.data(), b.length());
|
|
|
|
__out_Lengths[i] = b.length();
|
|
|
|
}
|
|
|
|
*_out = __out;
|
|
|
|
*_out_Lengths = __out_Lengths;
|
|
|
|
*_out_len = ret.length();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetFamilies(QFont* self, char** families, uint64_t* families_Lengths, size_t families_len) {
|
|
|
|
QList<QString> families_QList;
|
|
|
|
families_QList.reserve(families_len);
|
|
|
|
for(size_t i = 0; i < families_len; ++i) {
|
|
|
|
families_QList.push_back(QString::fromUtf8(families[i], families_Lengths[i]));
|
|
|
|
}
|
|
|
|
self->setFamilies(families_QList);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFont_StyleName(const QFont* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->styleName();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetStyleName(QFont* self, const char* styleName, size_t styleName_Strlen) {
|
|
|
|
QString styleName_QString = QString::fromUtf8(styleName, styleName_Strlen);
|
|
|
|
self->setStyleName(styleName_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFont_PointSize(const QFont* self) {
|
|
|
|
return self->pointSize();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetPointSize(QFont* self, int pointSize) {
|
|
|
|
self->setPointSize(static_cast<int>(pointSize));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFont_PointSizeF(const QFont* self) {
|
|
|
|
return self->pointSizeF();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetPointSizeF(QFont* self, double pointSizeF) {
|
|
|
|
self->setPointSizeF(static_cast<qreal>(pointSizeF));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFont_PixelSize(const QFont* self) {
|
|
|
|
return self->pixelSize();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetPixelSize(QFont* self, int pixelSize) {
|
|
|
|
self->setPixelSize(static_cast<int>(pixelSize));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFont_Weight(const QFont* self) {
|
|
|
|
return self->weight();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetWeight(QFont* self, int weight) {
|
|
|
|
self->setWeight(static_cast<int>(weight));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFont_Bold(const QFont* self) {
|
|
|
|
return self->bold();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetBold(QFont* self, bool bold) {
|
|
|
|
self->setBold(bold);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QFont_SetStyle(QFont* self, uintptr_t style) {
|
|
|
|
self->setStyle(static_cast<QFont::Style>(style));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QFont_Style(const QFont* self) {
|
|
|
|
QFont::Style ret = self->style();
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFont_Italic(const QFont* self) {
|
|
|
|
return self->italic();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetItalic(QFont* self, bool b) {
|
|
|
|
self->setItalic(b);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFont_Underline(const QFont* self) {
|
|
|
|
return self->underline();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetUnderline(QFont* self, bool underline) {
|
|
|
|
self->setUnderline(underline);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFont_Overline(const QFont* self) {
|
|
|
|
return self->overline();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetOverline(QFont* self, bool overline) {
|
|
|
|
self->setOverline(overline);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFont_StrikeOut(const QFont* self) {
|
|
|
|
return self->strikeOut();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetStrikeOut(QFont* self, bool strikeOut) {
|
|
|
|
self->setStrikeOut(strikeOut);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFont_FixedPitch(const QFont* self) {
|
|
|
|
return self->fixedPitch();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetFixedPitch(QFont* self, bool fixedPitch) {
|
|
|
|
self->setFixedPitch(fixedPitch);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFont_Kerning(const QFont* self) {
|
|
|
|
return self->kerning();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetKerning(QFont* self, bool kerning) {
|
|
|
|
self->setKerning(kerning);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QFont_StyleHint(const QFont* self) {
|
|
|
|
QFont::StyleHint ret = self->styleHint();
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QFont_StyleStrategy(const QFont* self) {
|
|
|
|
QFont::StyleStrategy ret = self->styleStrategy();
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetStyleHint(QFont* self, uintptr_t param1) {
|
|
|
|
self->setStyleHint(static_cast<QFont::StyleHint>(param1));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetStyleStrategy(QFont* self, uintptr_t s) {
|
|
|
|
self->setStyleStrategy(static_cast<QFont::StyleStrategy>(s));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFont_Stretch(const QFont* self) {
|
|
|
|
return self->stretch();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetStretch(QFont* self, int stretch) {
|
|
|
|
self->setStretch(static_cast<int>(stretch));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFont_LetterSpacing(const QFont* self) {
|
|
|
|
return self->letterSpacing();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QFont_LetterSpacingType(const QFont* self) {
|
|
|
|
QFont::SpacingType ret = self->letterSpacingType();
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetLetterSpacing(QFont* self, uintptr_t typeVal, double spacing) {
|
|
|
|
self->setLetterSpacing(static_cast<QFont::SpacingType>(typeVal), static_cast<qreal>(spacing));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFont_WordSpacing(const QFont* self) {
|
|
|
|
return self->wordSpacing();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetWordSpacing(QFont* self, double spacing) {
|
|
|
|
self->setWordSpacing(static_cast<qreal>(spacing));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QFont_SetCapitalization(QFont* self, uintptr_t capitalization) {
|
|
|
|
self->setCapitalization(static_cast<QFont::Capitalization>(capitalization));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QFont_Capitalization(const QFont* self) {
|
|
|
|
QFont::Capitalization ret = self->capitalization();
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetHintingPreference(QFont* self, uintptr_t hintingPreference) {
|
|
|
|
self->setHintingPreference(static_cast<QFont::HintingPreference>(hintingPreference));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QFont_HintingPreference(const QFont* self) {
|
|
|
|
QFont::HintingPreference ret = self->hintingPreference();
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFont_RawMode(const QFont* self) {
|
|
|
|
return self->rawMode();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetRawMode(QFont* self, bool rawMode) {
|
|
|
|
self->setRawMode(rawMode);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFont_ExactMatch(const QFont* self) {
|
|
|
|
return self->exactMatch();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_OperatorAssign(QFont* self, QFont* param1) {
|
|
|
|
self->operator=(*param1);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFont_OperatorEqual(const QFont* self, QFont* param1) {
|
|
|
|
return self->operator==(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFont_OperatorNotEqual(const QFont* self, QFont* param1) {
|
|
|
|
return self->operator!=(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFont_OperatorLesser(const QFont* self, QFont* param1) {
|
|
|
|
return self->operator<(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFont_IsCopyOf(const QFont* self, QFont* param1) {
|
|
|
|
return self->isCopyOf(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_SetRawName(QFont* self, const char* rawName, size_t rawName_Strlen) {
|
|
|
|
QString rawName_QString = QString::fromUtf8(rawName, rawName_Strlen);
|
|
|
|
self->setRawName(rawName_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFont_RawName(const QFont* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->rawName();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFont_Key(const QFont* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->key();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFont_ToString(const QFont* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->toString();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFont_FromString(QFont* self, const char* param1, size_t param1_Strlen) {
|
|
|
|
QString param1_QString = QString::fromUtf8(param1, param1_Strlen);
|
|
|
|
return self->fromString(param1_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_Substitute(const char* param1, size_t param1_Strlen, char** _out, int* _out_Strlen) {
|
|
|
|
QString param1_QString = QString::fromUtf8(param1, param1_Strlen);
|
|
|
|
QString ret = QFont::substitute(param1_QString);
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_Substitutes(const char* param1, size_t param1_Strlen, char*** _out, int** _out_Lengths, size_t* _out_len) {
|
|
|
|
QString param1_QString = QString::fromUtf8(param1, param1_Strlen);
|
2024-08-29 07:01:51 +00:00
|
|
|
QStringList ret = QFont::substitutes(param1_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QStringList from C++ memory to manually-managed C memory
|
|
|
|
char** __out = static_cast<char**>(malloc(sizeof(char*) * ret.length()));
|
|
|
|
int* __out_Lengths = static_cast<int*>(malloc(sizeof(int) * ret.length()));
|
|
|
|
for (size_t i = 0, e = ret.length(); i < e; ++i) {
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret[i].toUtf8();
|
|
|
|
__out[i] = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(__out[i], b.data(), b.length());
|
|
|
|
__out_Lengths[i] = b.length();
|
|
|
|
}
|
|
|
|
*_out = __out;
|
|
|
|
*_out_Lengths = __out_Lengths;
|
|
|
|
*_out_len = ret.length();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_Substitutions(char*** _out, int** _out_Lengths, size_t* _out_len) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QStringList ret = QFont::substitutions();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QStringList from C++ memory to manually-managed C memory
|
|
|
|
char** __out = static_cast<char**>(malloc(sizeof(char*) * ret.length()));
|
|
|
|
int* __out_Lengths = static_cast<int*>(malloc(sizeof(int) * ret.length()));
|
|
|
|
for (size_t i = 0, e = ret.length(); i < e; ++i) {
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret[i].toUtf8();
|
|
|
|
__out[i] = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(__out[i], b.data(), b.length());
|
|
|
|
__out_Lengths[i] = b.length();
|
|
|
|
}
|
|
|
|
*_out = __out;
|
|
|
|
*_out_Lengths = __out_Lengths;
|
|
|
|
*_out_len = ret.length();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_InsertSubstitution(const char* param1, size_t param1_Strlen, const char* param2, size_t param2_Strlen) {
|
|
|
|
QString param1_QString = QString::fromUtf8(param1, param1_Strlen);
|
|
|
|
QString param2_QString = QString::fromUtf8(param2, param2_Strlen);
|
|
|
|
QFont::insertSubstitution(param1_QString, param2_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_InsertSubstitutions(const char* param1, size_t param1_Strlen, char** param2, uint64_t* param2_Lengths, size_t param2_len) {
|
|
|
|
QString param1_QString = QString::fromUtf8(param1, param1_Strlen);
|
|
|
|
QList<QString> param2_QList;
|
|
|
|
param2_QList.reserve(param2_len);
|
|
|
|
for(size_t i = 0; i < param2_len; ++i) {
|
|
|
|
param2_QList.push_back(QString::fromUtf8(param2[i], param2_Lengths[i]));
|
|
|
|
}
|
|
|
|
QFont::insertSubstitutions(param1_QString, param2_QList);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_RemoveSubstitutions(const char* param1, size_t param1_Strlen) {
|
|
|
|
QString param1_QString = QString::fromUtf8(param1, param1_Strlen);
|
|
|
|
QFont::removeSubstitutions(param1_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_Initialize() {
|
|
|
|
QFont::initialize();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_Cleanup() {
|
|
|
|
QFont::cleanup();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_CacheStatistics() {
|
|
|
|
QFont::cacheStatistics();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFont_DefaultFamily(const QFont* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->defaultFamily();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFont_LastResortFamily(const QFont* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->lastResortFamily();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFont_LastResortFont(const QFont* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->lastResortFont();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QFont* QFont_Resolve(const QFont* self, QFont* param1) {
|
|
|
|
QFont ret = self->resolve(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QFont*>(new QFont(ret));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
unsigned int QFont_Resolve2(const QFont* self) {
|
|
|
|
return self->resolve();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFont_ResolveWithMask(QFont* self, unsigned int mask) {
|
|
|
|
self->resolve(static_cast<uint>(mask));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QFont_SetStyleHint2(QFont* self, uintptr_t param1, uintptr_t param2) {
|
|
|
|
self->setStyleHint(static_cast<QFont::StyleHint>(param1), static_cast<QFont::StyleStrategy>(param2));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QFont_Delete(QFont* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|