Skip to content

Commit 4365a21

Browse files
authored
Attempt to fix canvas font emoji alignment (playcanvas#2737)
1 parent 81439ad commit 4365a21

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/font/canvas-font.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,7 @@ class CanvasFont extends EventHandler {
394394
var div = document.createElement('div');
395395
div.appendChild(textSpan);
396396
div.appendChild(block);
397-
div.style.font = this.fontName;
398-
div.style.fontSize = this.fontSize + 'px';
397+
div.style.font = this.fontSize + 'px ' + this.fontName;
399398

400399
var body = document.body;
401400
body.appendChild(div);

0 commit comments

Comments
 (0)