Skip to content

How to change the font family #2

@adjivas

Description

@adjivas

Hello,

It is possible to configure the font family?

For the sub-example gui_raster, I have naively tried to add a font according to the QFontDatabase Class without any success.

#include <QtGui>
#include <QFontDatabase>
#include <stdio.h>

#include "rasterwindow.h"

int main(int argc, char **argv)
{
    QGuiApplication app(argc, argv);
    QFontDatabase fontDB;

    int id = fontDB.addApplicationFont(":/fonts/Neko-SourceCodePro-Regular.ttf");
    printf("id: %d \n", id); // return  -1
    RasterWindow window;
    window.showFullScreen();
 
    return app.exec();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions