Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu May 23, 2019 10:36 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Getting link labels to sit inside links
PostPosted: Tue Jul 03, 2018 4:39 am 
Offline

Joined: Tue Jul 03, 2018 4:32 am
Posts: 1
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:

Image

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:
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

# TEMPLATE-only LINKs:
LINK DEFAULT
        ARROWSTYLE compact
        BWLABEL bits
        BWFONT 10
        BANDWIDTH 10G
        BWSTYLE angled
        BWOUTLINECOLOR none
        BWBOXCOLOR none
        OUTLINECOLOR none


Has anyone got any ideas about how to get the numbers staying inside the link?


Top
 Profile  
 
 Post subject: Re: Getting link labels to sit inside links
PostPosted: Tue Jul 03, 2018 8:50 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5311
Location: United Kingdom
The default format for comments is *supposed* to run on the edge of the arrow.

Try this: http://network-weathermap.com/manual/0. ... MMENTSTYLE

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

Code:
INCOMMENT {link:this:bandwidth_in:%k}
OUTCOMMENT {link:this:bandwidth_in:%k}
COMMENTSTYLE center
BWLABEL none


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!)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group