defold icon indicating copy to clipboard operation
defold copied to clipboard

Blurry distance field font in html5

Open britzl opened this issue 1 year ago • 2 comments

A user reported that they distance field font is crisp and easy to read when building for desktop, but as soon as the project is built or bundled for html5 the font gets very blurry:

HTML5: Screenshot 2024-05-29 at 11 28 15

Desktop (macOS): Screenshot 2024-05-29 at 11 28 06

Attached sample project.

font_issue.zip

britzl avatar May 29 '24 09:05 britzl

@britzl This is scale down issue https://github.com/defold/defold/issues/5876 Should work fine with High DPI (it is off in example) CleanShot 2024-05-29 at 11 36 16@2x

AGulev avatar May 29 '24 09:05 AGulev

I forgot to set high dpi within the test project, am sorry.

Here is some extra information: It also happens to a project where highdpi is enabled blurry window.devicePixelRatio (as promised) uVPiXMQ

NighelDenda avatar May 29 '24 10:05 NighelDenda

I found that our sdf renderer uses sdf_world_scale when calculating sdf_smoothing , but to avoid issues screen space scale should be used. This is the reason of issues like this and https://github.com/defold/defold/issues/9568 and maybe even https://github.com/defold/defold/issues/9560

AGulev avatar Aug 25 '25 13:08 AGulev