Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.1.0 Beta 1
-
None
-
2d065ddb53a31c1b717c88902bcdf4f6b24f320f
Description
import QtQuick 2.0 Item { width: 500 height: 400 Canvas { anchors.fill: parent anchors.margins: 100 onPaint: { var ctx = getContext("2d"); ctx.reset(); ctx.fillStyle = "#FF0000"; ctx.fillText(ctx.font, 0, 10); ctx.font = "ffffff"; ctx.fillText(ctx.font, 0, 20); } } }
Output:
sans-serif,-1,10,5,50,0,0,0,0,0
ffffff,9,-1,5,50,0,0,0,0,0
As mentioned in the comments of the function, qt_font_from_string() needs to be rewritten: http://qt.gitorious.org/qt/qtdeclarative/blobs/stable/src/quick/items/context2d/qquickcontext2d.cpp#line195