New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Html5 Canvas Web Font Alignment is off #15326
Comments
Hello @shumiyao Can I fix this ? |
The program uses a library called PahserJS.
Here is an official sample page by Phaser Js: I googled further and I found out that it looks like the security feature might have something to do with the behavior. https://community.brave.com/t/getimagedata-does-not-work-in-brave/43292 According to btlechowski:
The problem of misaligned text is gone once I disable the Brave's protection feature. Protection ON: Protection OFF: |
cc: @pilgrim-brave Farbling issue? |
That Brave Community post from January 2019 is obsolete; Brave's privacy protection around HTML5 APIs is now significantly more advanced than block/don't block. However, I agree that there is a real, Brave-specific bug here. |
I would not consider this a problem, I would consider it a feature. This is to protect against canvas fingerprinting, and it can be disabled in settings. Of course canvas elements will look buggy, as the data is given a false value by brave. I don't understand the problem here. |
I could find a Phaser Js forum thread referring to According to Telinc1 in the thread:
|
Canvas elements are vulnerable to fingerprinting. Brave prevents this by reporting a false/random value. This can be disabled in settings. I don't understand what the problem here is, or how it can be considered a problem at all. |
Thank you everyone here. Will post a link to this thread in the forum thread to let people know about this issue. Maybe developers can add a prompt in those html5 game pages telling Brave users to disable the protection or, In the thread samme suggests a workaround for PhaserJs (using the Text Metrics). I have tried the sample and I see that the workaround resolves the issue. |
Description
Web Font in Html5 Canvas Alignment (of games developed using Phaser Js library) is off only in Brave (Mac Desktop v. 1.23.71) while there is not any problem in Chrome, Firefox and Safari. Is this a known problem?
Steps to Reproduce
The html5 canvas game showing the problem can be found at https://game.cuckooparrot.com/bonus-jackpot/
Actual result:
Brave Version 1.23.71 (Mac desktop)
Expected result:
Chrome Version 89.0.4389.128 (Mac desktop)
Safari Version 14.0.3 (Mac desktop)
Firefox 85.0 (Mac desktop)
Reproduces how often:
Always.
Brave version (brave://version info)
Brave Version 1.23.71 Stable (Mac desktop)
The text was updated successfully, but these errors were encountered: