#pragma once #include #include #include #include #define BG_WIDTH 3508 #define BG_HEIGHT 2481 struct NameInfo_t { QString name1; QString name2; QString name_eng; QString bg_path; bool is_number_bg; int bg_type; }; enum Name_Type_e { Name_zh = 0, Name_eng, Name_zh_eng }; class INameCreater : public QObject { public: INameCreater(); ~INameCreater(); void setEnglishFont(const QFont& font) { eng_Font = QFont(font); } QFont EnglisthFont() const { return eng_Font; } protected: void saveToImage(const QString& filename, QGraphicsScene* scene); QList getNameByFile(Name_Type_e type, const QString& filename); QList getNameByFileContent(Name_Type_e type, const QByteArray& conetent); virtual void generaImageFromCSV(Name_Type_e type, const QString& filename, const QByteArray& filecontent, const QFont& font, const QColor& font_color); int getFontSizebyStr(const QFont& font, int max_font_size, int max_label_width, const QString& str); private: QFont eng_Font; };