FontLoader: issue with multiple fonts of same family



  • Hi all,

    In my app i'd like to use a font that i have in 3 weight ( Light, Normal, Medium ) and in italic as well.

    In my Main.qml I did the following:
    @
    FontLoader
    {
    source: "qrc:/fonts/family-Light.ttf"
    }
    FontLoader
    {
    source: "qrc:/fonts/family-LightItalic.ttf"
    }
    FontLoader
    {
    source: "qrc:/fonts/family-Regular.ttf"
    }
    FontLoader
    {
    source: "qrc:/fonts/family-RegularItalic.ttf"
    }
    FontLoader
    {
    source: "qrc:/fonts/family-Medium.ttf"
    }
    FontLoader
    {
    source: "qrc:/fonts/family-MediumItalic.ttf"
    }
    @

    For test purposes I did a simple column with 6 Text that are as followed:

    @
    Text
    {
    text: "Example"
    font.pointSize: 40
    font.family: "family"
    font.weight: Light/Regular/Medium
    font.italic: true/false
    }
    @

    The app starts well, all fonts are loaded but there is no difference between light and regular ( even though rtf files are different ) they are both with the regular font. If I comment the regular FontLoader then it is the light font that is used for both light and regular.

    I don't know what is going wrong with either my small app or my fonts but it seems that it can not load both at the same time.
    I also tried to load in a different order, surprisingly if I load regular before light, they use regular and if I load light before regular then they use light.

    It seems like Qt interprets both fonts as the same one...

    If anyone has an idea on what is going wrong..I would really appreciate it.
    Thanks :)



  • looks like a bug to me, If you are sure please submit a bug


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.