Page 1 of 1

text_decoration (underline, line_through) is too thin than the font default from the other render result

Posted: 2019-06-24T02:54:54-07:00
by Kenneth
Hello there

When I use ImageMagick with decorate option

The result seems wrong when I compare Photoshop or MS Word result

The problem is that the line width of underline or throughline is too thin than which I expected

Even ImageMagick uses depending on the OTF font information

The line is extremely thin and there seems an issue of line position (y and x as well)

Check the below result for your understanding



Font name -> Noto Sans CJK JP Medium (OTF version)



Photoshop result

Image
Image

MS Word result

Image
Image

ImageMagick result(7.0.8-50 Q16 x86_64)

Image
Image

Below is a command snippet

Code: Select all

convert \
    -size 320x120 xc:white -draw \
    "fill black font-size 64 font '/Users/user/Downloads/NotoSansCJKjp-hinted/test.otf' decorate LineThrough gravity center text 0,0 'test'" linethrough.gif

Re: text_decoration (underline, line_through) is too thin than the font default from the other render result

Posted: 2019-06-28T07:12:32-07:00
by Kenneth
Hmmm, There seems no one is interested in this issue...

So I tried to fix this issue by my self by changing the source file in MagickCore

And below is the result (this case I used NotoSerifCJK JP)

Underline
Image

LineThrough
Image


There seem two issues in the code

1. skip some condition when PolygonPrimitive uses stroke width
2. A calculation logic for underline_thickness which FreeType gave includes an issue

I will make PR for solving this issue very soon

Re: text_decoration (underline, line_through) is too thin than the font default from the other render result

Posted: 2019-06-28T07:14:05-07:00
by Kenneth
There seems still an issue in annotating process (line through position is not correct accurately)

I will fix that issue as well, and then you can check the source code from PR in GitHub

Re: text_decoration (underline, line_through) is too thin than the font default from the other render result

Posted: 2019-06-28T18:03:38-07:00
by magick
We were about to investigate this issue but you saved us the time. Looking forward to your PR.

Re: text_decoration (underline, line_through) is too thin than the font default from the other render result

Posted: 2019-06-29T02:56:27-07:00
by Kenneth