Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Cumulus PHP-GD Banner

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Bob
Posts: 67
Joined: Thu 04 Sep 2008 12:03 pm
Weather Station: Watson W-8681
Location: Whixall, Shropshire.
Contact:

Re: Cumulus PHP-GD Banner

Post by Bob »

Thanks

Bob
Bob

Image
TNETWeather

Re: Cumulus PHP-GD Banner

Post by TNETWeather »

.
Version 3.0 released

This version uses a new internal method to obtain the realtime.txt files and uses the new extended format.

You need to be using Cumulus 1.8.2 Beta or higher to use this version.

You can download the script from my project page (in my signature below).
User avatar
Paul C
Posts: 538
Joined: Thu 19 Jun 2008 7:45 am
Weather Station: Davis VP2 with solar
Operating System: Windows 10
Location: Brampton, Cumbria, UK
Contact:

Re: Cumulus PHP-GD Banner

Post by Paul C »

Ive put all the known cumulus banners on one topic, if I have missed anybody please let me know.
https://cumulus.hosiene.co.uk/viewtopic.php?f=10&t=206
Paul C
Brampton, Cumbria, UK
117m ASL
http://www.bramptonweather.co.uk
Image
andro700
Posts: 75
Joined: Mon 22 Sep 2008 10:18 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Renton, Washington
Contact:

Re: Cumulus PHP-GD Banner

Post by andro700 »

For some reason I can not get my True Type Fonts to work. This is the directory where they are at. I have it set to no because when I set it to yes it is telling me it contains errors. Any help would be greatly appreciated.

Code: Select all

/virtual/users/e14497-14796/web/graphs/jp/ttf/
Here is my settings as of now;

Code: Select all

$SITE['fontdir']        = "web/graphs/jp/ttf/";     # must contain ttf font files!
$SITE['usettf']         = "no";        # Set to No to use default fonts
Chuck
Image
TNETWeather

Re: Cumulus PHP-GD Banner

Post by TNETWeather »

If you know the hard path (non-relative) it is most likely easier to use it, instead of a relative path.

Code: Select all

$SITE['fontdir']        = "/virtual/users/e14497-14796/web/graphs/jp/ttf/";
If you want to use a relative path, then it has to be relative of where the banner.php script resides.

Just guessing...

If your banner is addressable via the web as:

http://www.chucksweather.com/cumulus/banner.php

Then the relative path to the banner.php script to the fonts would be:

Code: Select all

$SITE['fontdir']        = "../graphs/jp/ttf/";
andro700
Posts: 75
Joined: Mon 22 Sep 2008 10:18 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Renton, Washington
Contact:

Re: Cumulus PHP-GD Banner

Post by andro700 »

Kevin,

I will give it a shot and see what happens. Thanks for the quick response.

Chuck
Image
andro700
Posts: 75
Joined: Mon 22 Sep 2008 10:18 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Renton, Washington
Contact:

Re: Cumulus PHP-GD Banner

Post by andro700 »

Thanks Kevin got that to work.

Chuck
Image
Lars-K
Posts: 13
Joined: Thu 06 Nov 2008 2:46 pm
Weather Station: Davis VP2 with WeatherlinkIP

Re: Cumulus PHP-GD Banner

Post by Lars-K »

Hi, I have tested the banner and it works like it should do.
But, in Norwegian we have the letters ÆØÅ-æøå and they will not show correct in the banner.
I know this can be fixed by using

Code: Select all

['charset'] = "utf-8";
Can you implement this in the php code?
Here is how the banner looks like using this text:

Code: Select all

$SITE['sitename']       = "Æ Ø Å æ ø å";
Image
The Sky is the Limit!

My Club's Webpage:
Image
TNETWeather

Re: Cumulus PHP-GD Banner

Post by TNETWeather »

Saw this on a Jpgraph forum...
In a similair way this can be used to show Greek letters, for example "β" (beta) is displayed by

$beta = sprintf('&#%04d;',hexdec('03B2'));
This means you could add each greek letter one at a time like:

Code: Select all

$SITE['sitename']       = "Mesa AZ USA - TNET Weather";
// Add first greek letter
$SITE['sitename'] .= sprintf('&#%04d;',hexdec('03B2'));
// Add second greek letter
$SITE['sitename'] .= sprintf('&#%04d;',hexdec('03B3'));
// Add third greek letter
$SITE['sitename'] .= sprintf('&#%04d;',hexdec('03B4'));
You do not have the required permissions to view the files attached to this post.
Lars-K
Posts: 13
Joined: Thu 06 Nov 2008 2:46 pm
Weather Station: Davis VP2 with WeatherlinkIP

Re: Cumulus PHP-GD Banner

Post by Lars-K »

Sorry, didn't work. The banner just shows the decimal code for the letter wanted.

Code: Select all

$SITE['sitename'] = sprintf('&#%04d;',hexdec('00D8')); 
Shows this in banner: "Ø"

Reference:

Code: Select all

Ø 216 Ø 00D8 Ø Ø LATIN CAPITAL LETTER O WITH STROKE 
The Sky is the Limit!

My Club's Webpage:
Image
TNETWeather

Re: Cumulus PHP-GD Banner

Post by TNETWeather »

Might be your web host's version of GD or something else in its PHP version??

I used your exact syntax code:

Code: Select all

$SITE['sitename'] = sprintf('&#%04d;',hexdec('00D8'));
And got:
Image
TNETWeather

Re: Cumulus PHP-GD Banner

Post by TNETWeather »

Might help if I could see the real code you are using... but you don't have your website listed in your profile info.
Lars-K
Posts: 13
Joined: Thu 06 Nov 2008 2:46 pm
Weather Station: Davis VP2 with WeatherlinkIP

Re: Cumulus PHP-GD Banner

Post by Lars-K »

Image
My banner with the code:

Code: Select all

#---------------------------------------------------------------------------
$SITE['format']         = "png";        # Options: jpeg  gif  png
$SITE['dateiso']        = "no";
$SITE['sitename'] = sprintf('&#%04d;',hexdec('00D8'));
#---------------------------------------------------------------------------
Link to the Banner:
http://www.mphgk.com/met/testbanner.php
The Sky is the Limit!

My Club's Webpage:
Image
TNETWeather

Re: Cumulus PHP-GD Banner

Post by TNETWeather »

Using encodings like that apparently requires the use of FreeType Support and the use of TTF fonts.

You are not using TTF fonts:

Code: Select all

#---------------------------------------------------------------------------
$SITE['fontdir']        = "fonts/";     # must contain ttf font files!
$SITE['usettf']         = "no";        # Set to No to use default fonts
#---------------------------------------------------------------------------
When I turned off TTF support, I got the same output as you are showing. So apparently the standard GD fonts and its library does not support what you are trying to do.

Looks like the only solution would be to make sure your webhosts supports FreeType support and load some of the TTF fonts so you can use them. Then it appears to work okay.
Lars-K
Posts: 13
Joined: Thu 06 Nov 2008 2:46 pm
Weather Station: Davis VP2 with WeatherlinkIP

Re: Cumulus PHP-GD Banner

Post by Lars-K »

Thanks, I will check it out!
The Sky is the Limit!

My Club's Webpage:
Image
Post Reply