Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Android - Poor Qml Text fields & emojis alignment



  • Given

    import QtQuick 2.12
    import QtQuick.Window 2.12
    
    Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
        Text{
            id:textOnly
            width:parent.widh
            height:40
        }
        TextInput {
            id: descInput
    
            horizontalAlignment: Text.AlignLeft
            cursorVisible: true
            anchors.top: textOnly.bottom
            //renderType: Text.NativeRendering
    
            width:parent.width
            height:200
            anchors.leftMargin: 10
            maximumLength: 8000
            wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
            verticalAlignment: Text.AlignLeft
            //font.pixelSize: 16
            font.family: "Segoe UI Emoji"
            text:"\n🙂asdasdasdasdas🙂🙂🙂🙂🙂🙂"
            //font.weight: Font.Medium
            //font.hintingPreference: Font.PreferNoHinting
        }
        Rectangle{
            anchors.top: descInput.bottom
            color:"red"
            height: 200
            width:parent.width
            MouseArea{
                anchors.fill: parent
                onClicked: {
                    textOnly.text = descInput.text
                    console.debug(descInput.text)
                }
            }
        }
    }
    

    On android 9 & 10, with Qt 5.13 I get overlap between the"asdasdasdasdas" and the following emojicons.

    Is there a cludge available for this?

    EDIT : Found it might be related to the emoji font in Android 9 / 10

    https://bugreports.qt.io/browse/QTBUG-70657?focusedCommentId=437950&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-437950

    But is this the right solution? If I bind in the older emoji font?


Log in to reply