Results 1 to 6 of 6

Thread: QFontDatabase::addApplicationFontFromData && addApplicationFont returns -1

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question Re: QFontDatabase::addApplicationFontFromData && addApplicationFont returns -1

    Hi

    the readAll() function in qiodevice is unable to read ttf files.

    The lines

    QFile res(fileInfo.absoluteFilePath());
    QByteArray data = res.readAll();

    data gets the correct content of the file is a pdf file or any other file. But it always gets o when trying to read a ttf file. Anyone has any clue.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: QFontDatabase::addApplicationFontFromData && addApplicationFont returns -1

    the readAll() function in qiodevice is unable to read ttf files.
    You are mistaken. Since you are not opening the file at all this readAll() call will return zero bytesl regardless of the file content.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.