editor2-issues icon indicating copy to clipboard operation
editor2-issues copied to clipboard

Custom Font rendered strange.

Open tangyiyang opened this issue 7 years ago • 9 comments

I hope I'm making a stupid mistake. :)

Expected behaviour

The font should be rendered correctly.

Actual behaviour

The font looks like been trimmed, see the picture.

Steps to reproduce

Just simply create a default gui.text with the builtin font /builtins/fonts/vera_mo_bd.ttf.

text render issue

https://github.com/tangyiyang/repo-for-report-bugs/blob/master/text-render-problem.png


Build time2018-02-09T17:55:28.506062
Defold channeleditor-alpha
Defold editor shaae0c5857e5a413235c097fcc87d53a3f62756d1c
Defold engine shac70ad190898e790f8284e8dab0e31c9090476be9
Defold version1.2.120
GPUNVIDIA GeForce GT 650M OpenGL Engine
GPU Driver2.1 NVIDIA-10.17.5 355.10.05.45f01
Java version1.8.0_102-b14
OS archx86_64
OS nameMac OS X
OS version10.12.6

tangyiyang avatar Feb 20 '18 15:02 tangyiyang

Do you have the right material set in the font?

subsoap avatar Feb 20 '18 15:02 subsoap

Haven't changed setting yet. This is the content of font file.

font: "/builtins/fonts/vera_mo_bd.ttf" material: "/builtins/fonts/font.material" size: 24 antialias: 1 alpha: 1.0 outline_alpha: 0.0 outline_width: 0.0 shadow_alpha: 0.0 shadow_blur: 0 shadow_x: 0.0 shadow_y: 0.0 extra_characters: "" output_format: TYPE_BITMAP all_chars: false cache_width: 0 cache_height: 0

tangyiyang avatar Feb 20 '18 16:02 tangyiyang

https://github.com/tangyiyang/repo-for-report-bugs/blob/master/screen-shot-for-html5-version.png

The Html5 Version looks great, It looks like a mac platform issue.

tangyiyang avatar Feb 20 '18 16:02 tangyiyang

If you can make a small example and upload as a zip

subsoap avatar Feb 20 '18 17:02 subsoap

I have uploaded a project here: https://github.com/tangyiyang/repo-for-report-bugs/blob/master/render-issue.zip

The main issue is that, the transparent pixels (wrap the text glyph) of the font rendered by defold looks like been trimmed as I mentioned. You may have a look at what glyph designer have rendered.

PS: In order to exclude the influence of ttf file itself, I'm using SourceCodeVariable-Roman font build by adobe, https://github.com/adobe-fonts/source-code-pro/releases.

Lots of Thanks, :)

tangyiyang avatar Feb 21 '18 06:02 tangyiyang

Hi!

Could you highlight the error(s) in the images for me? Is it the bottom of some of the chars, like; L, v, l, R, n and K?

Can't see how it should behave differently on HTML5 compared to any other platform, since the build steps are the same for all platforms.

andsveking avatar Feb 26 '18 10:02 andsveking

Ping @tangyiyang :)

andsveking avatar Mar 05 '18 16:03 andsveking

Meet the same situation

Font browser image

Editor image

Debug build image

html5 build is fine image

The font properties image

R5dwMg avatar Feb 13 '21 08:02 R5dwMg

Trial on other fonts. Appears that some of character, say 9, is being clipped but not as obvious as vera_mo_bd

Arial image

Arial blk image

R5dwMg avatar Feb 13 '21 08:02 R5dwMg