Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. FontLoader: Load Entire Family Font Files
Forum Updated to NodeBB v4.3 + New Features

FontLoader: Load Entire Family Font Files

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sypter
    wrote on last edited by
    #1

    How can i load 4 font files with the same font type name?
    I have trebuchet.ttf, trebucheti.ttf, trebuchetb.ttf and trebuchetbi.ttf and all of them have "Trebuchet MS" as their font type name.
    When i use FontLoader i initially test if the font has been loaded before so it doesn't end up failing:

    @
    FontLoader{
    id: trebuchet
    }

    Component.onCompleted:{
    var families = Qt.fontFamilies().toString();
    if (families.match(/Trebuchet MS/i)) {
    trebuchet.name = "Trebuchet MS";
    } else {
    trebuchet.source = "fonts/trebuchet.ttf";
    }
    }
    @

    The problem is that they all use "Trebuchet MS" as their font type name, and that will end up making all fontloaders pointing to the default Trebuchet MS.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved