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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Kenneth
Posts: 7
Joined: 2019-06-18T01:25:35-07:00
Authentication code: 1152

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

Post 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
Kenneth
Posts: 7
Joined: 2019-06-18T01:25:35-07:00
Authentication code: 1152

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

Post 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
Last edited by Kenneth on 2019-06-28T07:19:38-07:00, edited 2 times in total.
Kenneth
Posts: 7
Joined: 2019-06-18T01:25:35-07:00
Authentication code: 1152

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

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

We were about to investigate this issue but you saved us the time. Looking forward to your PR.
Post Reply