OpenNMS+jrobin does not obey font selection

Description

OpenNMS does not appear to pass the correct font definitions to the JRobin library, and JRobin appears to lie about the font definition that it actually uses.

snmp-graph.properties:
command.prefix=/usr/bin/rrdtool graph - --width 450 --imgformat PNG --font DEFAULT:6 --font TITLE:20 --start {startTime} --end {endTime}

jetty.log:
DEBUG [btpool0-18] JRobinRrdStrategy: large font = java.awt.Font[family=Monospaced,name=Monospaced,style=bold,size=12], small font = java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=10]

Graph is available at the URL posted. As shown, the actual font chosen is proportional, and totally messes up the columns in the legend. Using JRobin through groovy, I get a monospaced font of some description.

I would expect that either OpenNMS should be passing the font definition to JRobin from the command.prefix setting, or that there should be a dedicated font configuration in the properties file. I would also expect JRobin to throw an error if it had to use a proportional font, even though the debug says monospaced.

Environment

Operating System: Linux Platform: PC URL: http://www.cricalix.net/~dhill/opennms/opennms-1.png

Acceptance / Success Criteria

None

Attachments

1

Lucidchart Diagrams

Activity

Show:

Ron Roskens December 19, 2013 at 11:45 PM

Fixed in commit 624af684dd0754f22d32427e85845b3dc8bcd389

Ron Roskens December 19, 2013 at 11:44 PM

Added the patch back in with a fix to ensure that parameter splits to an array of size 3.

Ron Roskens December 13, 2013 at 5:19 PM

According to the RRDTOOL graph command, the argument for --font is supposed to have two colons:

[n|-font FONTTAG:size:[font]]

So the initial check for the argValue array size is wrong, and should just be checking size equal to 3.

Benjamin Reed December 13, 2013 at 3:32 PM

Tarus tried this out and got the following attempting to use --font arguments:

...I went ahead and reverted this for now.

Benjamin Reed December 13, 2013 at 2:09 PM

Lost in the shuffle, this bug never got marked as having a patch. Tarus ran into font issues and dug it up, I've merged your patch Ron. Thanks!

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created August 12, 2008 at 12:03 PM
Updated January 27, 2017 at 4:25 PM
Resolved December 19, 2013 at 11:45 PM