FW: Text rendering issues with gm convert and unifont

Neil Youngman <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
I am trying to render plain text to fax and I need to support as wide a
range of characters as possible, ideally the whole Unicode BMP.

Combining gm convert with unifont might meet this requirement, as long
as I can get it to render cleanly.

The simplest approach is:

gm convert -font /usr/share/fonts/truetype/unifont/unifont.ttf
-pointsize 12 -density 204x196 -units PixelsPerInch -geometry
1728x2292\! -depth 1 -monochrome -compress fax /tmp/4778.txt /tmp/test.tif

This renders quite well, but I need a border. If I add a border with
-border 100 -borderColor white the border is external to the specified
geometry, so the output is the wrong size.

If I adjust the geometry to -geometry 1528x2092\! to leave space for the
border the text renders very poorly

I have tried rendering it at the original size, with the border added
and resizing:

gm convert -font /usr/share/fonts/truetype/unifont/unifont.ttf
-pointsize 12 -density 204x196 -units PixelsPerInch -geometry
1728x2292\! -depth 1 -border 100 -borderColor white -monochrome
-compress fax /tmp/4778.txt /tmp/test.tif

gm convert -density 204x196 -units PixelsPerInch -resize 1728x2292\!
-monochrome -depth 1 -compress fax /tmp/test.tif /tmp/resized.tif

This leaves ragged edges on the text.

I have a very limited understanding of text rendering and I have run out
of ideas. Is there a sensible solution to this problem that will give me
reasonable output quality?

It doesn't have to be graphicsmagick based, but I would prefer it not to
be a proprietary solution.

Neil Youngman


Neil Youngman
Developer
Wirefast Limited

Wirefast provides secure corporate messaging services.
See our messaging solutions at  http://www.wirefast.com/
Please consider the environment.
Does this email or attachment need to be printed?
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this email. Please
notify the sender immediately by email if you have received this
email by mistake and delete this email from your system.

Any views or opinions are solely those of the author
and do not necessarily represent those of Wirefast Limited

Email transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of email transmission.
Wirefast Limited is registered in England & Wales
Company number: 03865860
Registered Office: 7/10 Chandos Street, Cavendish Square, London, W1G 9DQ

Wirefast definitions of classification can be found here: www.wirefast.com/classifications

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.