# Text Aligment Bug on Linux

**URL:** <https://phaser.discourse.group/t/text-aligment-bug-on-linux/9145>\
**Category:** Phaser 3\
**Created:** [March 19, 2021, 8:53am UTC](https://phaser.discourse.group/t/text-aligment-bug-on-linux/9145 "2021-03-19T08:53:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trbonnes](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/trbonnes/32/4051_2.png) [@Trbonnes](https://phaser.discourse.group/u/Trbonnes)\
**Post date:** [March 19, 2021, 8:53am UTC](https://phaser.discourse.group/t/text-aligment-bug-on-linux/9145/1 "2021-03-19T08:53:23Z")

</div>

Hi !

We are doing some tests with Phaser 3 with a friend and we ran into some sort of bug with text display.

 ![unknown](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/b/bb691c2490191f6c4ffcf067faeb369bd4e06c24.jpeg)

 ![Screenshot](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/7/7453f3de9ad8eee195e4ea8c570b1b7af07293c5.jpeg)

The first screenshot is on my computer using Firefox 86.0.1 on Windows 10  
The second one is on my firend computer also using Firefox 86.0.1 but on Linux Manjaro.

There is nothing tricky in the code. Here it is :

```
this.description = scene.add.text(x, y - 300, description)
.setOrigin(0.5, 0.5)
.setFontSize(23)
.setVisible(true)
.setDepth(1)

this.apCost = scene.add.text(x + 175, y - 538, apCost.toString())
.setOrigin(0.5, 0.5)
.setFontSize(23)
.setVisible(true)
.setDepth(1)

this.mpCost = scene.add.text(x + 175, y - 438, mpCost.toString())
.setOrigin(0.5, 0.5)
.setFontSize(23)
.setVisible(true)
.setDepth(1)

```

Does anyone have a clue about why the text is not displaying well on my friend computer ?

Thank you !

---

<div class="post-metadata">

**Author:** ![Lupo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/lupo/32/4808_2.png) [@Lupo](https://phaser.discourse.group/u/Lupo)\
**Post date:** [March 19, 2021, 9:02am UTC](https://phaser.discourse.group/t/text-aligment-bug-on-linux/9145/2 "2021-03-19T09:02:41Z")

</div>

Do you have an url to share? i am working on linux as well - maybe create a jsfiddle?

---

<div class="post-metadata">

**Author:** ![Trbonnes](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/trbonnes/32/4051_2.png) [@Trbonnes](https://phaser.discourse.group/u/Trbonnes)\
**Post date:** [March 19, 2021, 9:10am UTC](https://phaser.discourse.group/t/text-aligment-bug-on-linux/9145/3 "2021-03-19T09:10:07Z")

</div>

Yes, you can access it here : [https://coli.prushka.fr/](https://coli.prushka.fr/)

We also tested it on numerous navigators.

It also works on :  
Edge on Windows  
Firefox and Chrome on Android  
Safari and Chrome on MacOS  
Safari on IOS

It does not work on :  
Tro Browser on every plateform  
Brave on Android

---

<div class="post-metadata">

**Author:** ![Lupo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/lupo/32/4808_2.png) [@Lupo](https://phaser.discourse.group/u/Lupo)\
**Post date:** [March 19, 2021, 9:22am UTC](https://phaser.discourse.group/t/text-aligment-bug-on-linux/9145/4 "2021-03-19T09:22:20Z")

</div>

looks good on ubuntu-20 firefox 86

![grafik](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/9/926bd26ece3431a8cbfbcc110a9ee2e7abccdbf7.jpeg)

---

<div class="post-metadata">

**Author:** ![Trbonnes](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/trbonnes/32/4051_2.png) [@Trbonnes](https://phaser.discourse.group/u/Trbonnes)\
**Post date:** [March 19, 2021, 9:27am UTC](https://phaser.discourse.group/t/text-aligment-bug-on-linux/9145/5 "2021-03-19T09:27:33Z")

</div>

Thanks~

It’s really weird. It appears that all texts are downshifted on my friend computer :l

---

<div class="post-metadata">

**Author:** ![Lupo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/lupo/32/4808_2.png) [@Lupo](https://phaser.discourse.group/u/Lupo)\
**Post date:** [March 19, 2021, 9:35am UTC](https://phaser.discourse.group/t/text-aligment-bug-on-linux/9145/6 "2021-03-19T09:35:25Z")

</div>

yepp that’s weird - here’s somethings that you could check if you haven’t already:

anything of interest in the console output? what about chrome on linux? is the problem present there as well? did you try in private mode to avoid bogus issues from the cache?

good luck

---

<div class="post-metadata">

**Author:** ![Telinc1](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/telinc1/32/60_2.png) [@Telinc1](https://phaser.discourse.group/u/Telinc1)\
**Post date:** [March 19, 2021, 9:40am UTC](https://phaser.discourse.group/t/text-aligment-bug-on-linux/9145/7 "2021-03-19T09:40:12Z")

</div>

Works fine for me with Chrome on Linux.

This is a shot in the dark, but it might be worth investigating. I’ve seen browsers, often Brave, but _maybe_ also Firefox (with `privacy.resistFingerprinting` enabled?) that intentionally break font rendering due to privacy concerns. If this guess is correct, I don’t think there’s anything you can do about it short of changing the browser settings.

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [March 19, 2021, 3:15pm UTC](https://phaser.discourse.group/t/text-aligment-bug-on-linux/9145/8 "2021-03-19T15:15:58Z")

</div>

You could try [passing text metrics](http://labs.phaser.io/edit.html?src=src/game%20objects%5Ctext%5Ctext%20metrics.js).

---

<div class="post-metadata">

**Author:** ![digitalpenguin](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/digitalpenguin/32/4969_2.png) [@digitalpenguin](https://phaser.discourse.group/u/digitalpenguin)\
**Post date:** [March 23, 2021, 1:02pm UTC](https://phaser.discourse.group/t/text-aligment-bug-on-linux/9145/9 "2021-03-23T13:02:39Z")

</div>

I’m getting the same issue on Pop!\_OS and Firefox 86.0.1

It was fine on Firefox 86.0.0 and works fine on Chromium.  
I can only assume it’s a new Firefox bug in the last patch release.

---

<div class="post-metadata">

**Author:** ![BeFiveINFO](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/befiveinfo/32/87_2.png) [@BeFiveINFO](https://phaser.discourse.group/u/BeFiveINFO)\
**Post date:** [April 16, 2021, 5:04pm UTC](https://phaser.discourse.group/t/text-aligment-bug-on-linux/9145/10 "2021-04-16T17:04:34Z")

</div>

In case anyone having this issue on Brave (Mac, not linux though), I have posted an issue at the Brave browser Github repo.

> <https://github.com/brave/brave-browser/issues/15326>
>
> Description
> Web Font in Html5 Canvas Alignment is off only in Brave (Mac Desktop v. 1.23.71) while there is not any problem...

I confirm that the workaround @[samme](https://phaser.discourse.group/u/samme) suggested appears to resolve the issue on Brave.
