Graphics Drawing on Linux

In part of our application we provide a means for users to add “decorations” to a picture. They can had arrows and labels.

When running locally (on a Mac with Safari or Firefox) the label creation works fine. When pushed to our Linux server, the label is very unhappy.

What we’re doing:
User enters some text. Software creates a picture to hold the text and we draw the text into the picture. Before drawing we used the TextWidth method to get the size needed.

On Linux, the size comes back as zero (for Helvetica, 14 pt). Rather than fight with this (at least for now), I decided to use Courier. Figured out a reasonable size for the letters so I now get a value that makes sense.

However (you knew this was coming), the Courier shows up in italics (when running on the Mac) and black letters on Linux (they’re supposed to be white letters on a black rectangle).

Anyone have any idea?

Thanks in advance.

-Bob Gordon


I created a WebCanvas (invisible on screen), was able to grab the webGraphics object and do my drawing. Things are much better, but webGraphics does not have the Text/StringWidth method.

Ignore previous post.

Problem solved!

The problem (and this all makes sense now) was that the server did not have the font installed.

Apparently Linux servers do not come with fonts. I learned how to install fonts, and things appear to be working. After some more testing I hope to provide some more information.