Getting link labels to sit inside links

Support questions about the Network Weather Map plugin

Moderators: Moderators, Developers

Post Reply
Posts: 1
Joined: Tue Jul 03, 2018 4:32 am

Getting link labels to sit inside links

#1 Post by geordish » Tue Jul 03, 2018 4:39 am

I'm trying to make some weathermaps using truetype fonts, that have the text going along them. The issue that I'm having is that the numbers hang outside of the link like this:


This even happens on horizontal links. The problem goes away when I use a non-TTF font, but obviously that doesn't work for angled links.

The relevant bits of my config are (I think):

Code: Select all

FONTDEFINE 6 /usr/share/cacti/site/plugins/weathermap/PT_Sans.ttf 10
FONTDEFINE 7 /usr/share/cacti/site/plugins/weathermap/PT_Sans.ttf 6
FONTDEFINE 8 /usr/share/cacti/site/plugins/weathermap/PT_Sans.ttf 8
FONTDEFINE 9 /usr/share/cacti/site/plugins/weathermap/SourceSansPro-Regular.ttf 10
FONTDEFINE 10 /usr/share/cacti/site/plugins/weathermap/docs/example/Vera.ttf 10
FONTDEFINE 11 /usr/share/cacti/site/plugins/weathermap/SourceSansPro-Bold.ttf 10
FONTDEFINE 12 /usr/share/cacti/site/plugins/weathermap/SourceSansPro-Bold.ttf 8

        ARROWSTYLE compact
        BWLABEL bits
        BWFONT 10
        BANDWIDTH 10G
        BWSTYLE angled
        BWBOXCOLOR none
        OUTLINECOLOR none
Has anyone got any ideas about how to get the numbers staying inside the link?

User avatar
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom

Re: Getting link labels to sit inside links

#2 Post by Howie » Tue Jul 03, 2018 8:50 am

The default format for comments is *supposed* to run on the edge of the arrow.

Try this: ... MMENTSTYLE

Oh - are those bwlabels? In that case perhaps try comments instead :-)

Code: Select all

INCOMMENT {link:this:bandwidth_in:%k}
OUTCOMMENT {link:this:bandwidth_in:%k}
Depending on the font, freetype doesn't always have great information about the height of characters, so you might also want to try a different font. This is also why you sometimes see a taller area above the text in bwlabels, but only with some fonts. It's not something I can fix, as far as I can tell. (not while keeping GD anyway - the long term plan is to move to SVG)
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)

Post Reply