Ad Widget

Collapse

Changing font size on Maps?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • noxis
    Senior Member
    • Aug 2007
    • 145

    #1

    Changing font size on Maps?

    Anyone know which bit of code to hack to allow me to change the font size of maps to something more useful when used on large LCD monitoring screens?

    Thanks!
  • noxis
    Senior Member
    • Aug 2007
    • 145

    #2
    Ah found the number to change, limited range of sizes without a bigger hack and adding of custom fonts. For anyone that is interested it is in these two "if" statements:

    Code:
                    if($label_line!="")
                    {
                            ImageFilledRectangle($im,
                                    $x_label-2, $y_label,
                                    $x_label+ImageFontWidth(2)*strlen($label_line), $y_label+ImageFontHeight(2),
                                    $white);
                            ImageString($im, 2, $x_label, $y_label, $label_line,$label_color);
                    }
    
                    if($info_line!="")
                    {
                            ImageFilledRectangle($im,
                                    $x_info-2, $y_info,
                                    $x_info+ImageFontWidth(2)*strlen($info_line), $y_info+ImageFontHeight(2),
                                    $white);
                            ImageString($im, 2, $x_info, $y_info, $info_line,$color);
                    }
    Change the second parameter of the "ImageString" lines with a maximum of 5. Although if you make it larger you will need to adjust another section of code for the x/y positioning.

    Comment

    • bee
      Senior Member
      • Jun 2007
      • 133

      #3
      Font Style

      Hi,
      Thanks, your posting useful for me. Any idea on how to change font style?
      Thanks,
      BEE

      Comment

      • vjunior1981
        Junior Member
        • Nov 2009
        • 10

        #4
        File...

        What's the file to change? Where it is?

        Thanks and sorry for my pour english...

        Comment

        • vjunior1981
          Junior Member
          • Nov 2009
          • 10

          #5
          Sorry...

          I can't find this options in the zabbix frontend...

          Comment

          • dudink
            Junior Member
            • Aug 2009
            • 20

            #6
            agree noxis
            For the font size in zabbix responsible function imageTextSize and imageText.

            In the file /zabbix/php/include/maps.inc.php find the line with the function imageTextSize or imageText. For example, in rows:

            $dims = imageTextSize(8,0,$ str);
            imagetext($im, 8, 0, $labelx, $labely+$dims['height'], $colors['Black'], $str);

            8 - is the font size.
            Last edited by dudink; 30-08-2010, 16:57.

            Comment

            • poche218
              Junior Member
              • Mar 2017
              • 1

              #7
              Originally posted by dudink
              agree noxis
              $dims = imageTextSize(8,0,$ str);
              imagetext($im, 8, 0, $labelx, $labely+$dims['height'], $colors['Black'], $str);
              Can I change the font background color?

              Comment

              Working...