spacer
spacer search

SwissCenter

Search
spacer
Main Menu
Home
Documentation + FAQ
Screenshots
Downloads
Forums
Bug Tracking
History
Login
Username

Password

Remember me
?
No account yet?

Locations of visitors to this page

 
Home arrow Forums

SwissCenter Forums  


Freetype Support on Synology DS-107+ - 2008/02/10 05:55 I bought a DS-107+ NAS from Synology and got it working with SwissCenter. Video streaming, audio streaming, slideshows, everything works... except...

I have no "Now Playing..." screen, and I also know why: There's no freetype support on the disk. I've been over a load of sites and several of them tells me that it so easy to get this working. Basically "You just need to cross-compile the freetype binaries on another linux distro and then install it on the NAS". A-ha, really?

I normally don't concider myself to be sub-avarage intelligence-wise, but then again, I'm not that much of a linux person. I have no idea how to get this done. (yeah, that's right. Start laughing...)

I think I managed to crosscompile soemthing with this tutorial:
http://synology.com/enu/forum/viewtopic.php?f=55&t=4735&start=0&st=0&sk=t&sd=a
But I'm not really sure how to use the thing I get out of it or even if I did it correctly.

Is there any of you who have a DS-107+ and got the freetype support working, or just know how to make and use an installation that could write a very detailed, step-by-step, n00b-safe tutorial on how to get this darn thing working??
"When you've sustained as many blows to the head as I have, consistency is something, something that something..."
- H. J. Simpson
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/02/10 12:31 Hi CryptoKnight,

Indeed the Synolgoy PHP-version doesn't have GD TrueType support. I contacted Synology to see whether the GD TrueType support could be included and they confirmed it would be with the next PHP release.

QUESTION
I have SwissCenter (http://swisscenter.co.uk/) running on my my DS107+ (128). For some of the screens I need Freefont (Truetype) GD support. This is not standard with my DS.
Is there any way to patch this or will there be a update covering this issue in the (near) future?


ANSWER BY SYNOLOGY
Dear Klaas,

Thank you for your feedback.

Indeed our system doesn't support this feature yet. However your suggestion has caught our attention and we have included it into our system.

Moreover, one powerful user has developed a solution for this feature, please visit this page for your reference:

http://www.synology.com/enu/forum/viewtopic.php?t=1934&highlight= freetype

Your request has been input the database. We have a near plan about PHP upgrading. Hope this feature could be added on time for you.

If you have further questions or suggestions, please feel free to contact Synology support again.


So, I think we have to be a little more patient until Synology is ready with this.

Meanwhile I've got severe problems with SwissCenter on my DS (see here. By now the config-screen is completely blocked again.

To solve this I completely deleted SwissCenter and its database. Also changed the VirtualHost, but nothing helped. I suppose it has something to do with some settings within the DS (the PHP-ini, rights or whatever). Would you please let me know the settings you applied to get the SwissCenter running.

Moreover, I was not able to play video (see here. Could you please let me know how you've done this.

Finally, I can view photo's, but only one at a time. As soon as select a entire slideshow, SwissCenter collapse. Did you encounter this as well?

looking forward to your reply, regards, Klaas

-------------------
SwissCenter 1.19.2
Apache 2 / PHP 5.2.0
Linux Synology 2.6.15
Synology DS107+ (128)
Pinnacle SC200
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/02/11 04:08 Hi Klaas,

That sounds good. I think I'll try the link in the reply from Synology. Otherwise I'll just have to wait for them to release the new and improved php version.

I'll see if I can't help you with the problems you have in the posts you linked to.

/CK
"When you've sustained as many blows to the head as I have, consistency is something, something that something..."
- H. J. Simpson
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/02/11 18:13 Hi CK,

Thanks for your support in advance, regards, Klaas

-------------------
SwissCenter 1.19.2
Apache 2 / PHP 5.2.0
Linux Synology 2.6.15
Synology DS107+ (128)
Pinnacle SC200
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/02/15 15:46 Unfortunately, Synology postponed the “GD freetype support” feature in the DS PHP-version until further notice. On my question re this feature I got this answer on February 13th, last:

Synology wrote:
Dear Klaas,
Thank you for your feedback and sorry for this late response due to Chinese New Year.
This feature is confirmed that not supported in the near plan. We have added your request into the improvement database again. In the future we will try supporting it. The engineer now still have the difficulty in integrating the feature with DS. We are sorry for this bad news ...

-------------------
SwissCenter 1.19.2
Apache 2 / PHP 5.2.0
Linux Synology 2.6.15
Synology DS107+ (128)
Pinnacle SC200
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/04/12 13:06 To quote Professor Farnsworth: "Good news, everyone!"
With a little hacking I actually made this work!

The Synology NAS does not support truetype fonts, and - as Klaas wrote above - won't in the near future.
But what it does support is another method of adding text to an image: imagestring().
It doesn't look as pretty as the truetype fonts, and (in my configuration) there's only one fontsize, but it's way better than nothing.

First of all, we need to find a decent bitmap-font. Theres a couple built-in in php, but they are horrible.
I chose a font called andale12.gdf - you can get it here:
http://hostandname.com/fonts/andale12.gdf

download it, create a new folder in your in your swisscenter directory named "Fonts" and put the .gdf-file there. (or any other place, just remember where you put it...)

Next we need to edit base/image.php.
On line 391 exchange this line:
Code:

 $result = @imagettftext ($this->image,$size,$angle,$x,$y,$colour,$font,$text);


with this:
Code:

 $result imagestring$this->imageimageloadfont("/volume1/web/Fonts/andale12.gdf") , $x $y $text$colour);


NOTE: you may need to change the path to the .gdf-file, to wherever you put it.

There's a function that meassures the text-width. It doesn't work for this setup, so we'll need to edit that too.
On line 413-424 is the function get_text_width(). Change this
Code:

 function get_text_width$text$size 14$font ''$angle 0)   {     if (gd_version() >=3)       $size *= 0.8;          if (empty($font))       $font get_sys_pref('TTF_FONT');            $box = @imagettfbbox($size$angle$font$text);     return ($box[2] - $box[6]);   }


to this
Code:

 function get_text_width$text$size 14$font ''$angle 0)   {     return imagefontwidth(imageloadfont("/volume1/web/Fonts/andale12.gdf")) * strlen($text);   }


(again make sure the path to your font is correct)

We're just about there. (in fact if you go to the configuration screen, you should see that you system passes the Truetype-support test.)
Start playing a song on your showcenter and you should see that indeed text is displayed, but it's not properly aligned. We need to edit base/image_screens.php. There are about 6 lines that needs to be edited, and it it' way easier to do, than to explain.

on lines 169-170 change the two numbers "450" and "30" into "215" and "145" respectively
on lines 173, 178, 183 and 188 find and delete this text: "+=($detail_text_size*2.5)"

You're done.
"When you've sustained as many blows to the head as I have, consistency is something, something that something..."
- H. J. Simpson
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/04/14 17:17 Hi CK,

This is great news. I'm going to try next week when I'm back home, regards, Klaas

-----------------------------------------
SwissCenter 1.19.2
Simese 1.40 & Apache 2 / PHP 5.2.0
Windows XP & Linux Synology 2.6.15
Synology DS107+ (128)
Pinnacle SC200
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/04/16 10:09 Hi CK,

A bit earlier than expected I could start making the changes in "image.php" and "image_screens.php" (long live the web), but apparently I'm doing something wrong as the PLAY NOW screen doesn't appear.

Maybe you can upload your files so I can see whether there're any differences with mine.

many thanks in advance & regards, Klaas

-----------------------------------------
SwissCenter 1.20
Simese 1.40 & Apache 2 / PHP 5.2.0
Windows XP & Linux Synology 2.6.15
Synology DS107+ (128)
Pinnacle SC200
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/04/17 02:38 I bet I just forgot something in my guide above. I'm one of those guys who make a lot of changes, but forget to document them properly, so when I need to explain what I did, I can't remember it

here are my image.php and image_screen.php files. see if you can spot the difference.
File Attachment:
File name: image_and_image_screens.zip
File size:8476 bytes
"When you've sustained as many blows to the head as I have, consistency is something, something that something..."
- H. J. Simpson
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/04/19 17:31 Hi CK,

Humm, I followed your advice, but no “NOW PLAYING” screen yet. Strange, as the config menu now clearly states that SwissCenter

… successfully located a TrueType font for generating ‘NOW PLAYING” images.
Maybe it has something to do with rights of the “font”-direcotory. Below you may find an overview of my folder structure,



Hope you (or someone else) can give me hint how to proceed?

many thanks in advance & regards, Klaas

-----------------------------------------
SwissCenter 1.20
Simese 1.40 & Apache 2 / PHP 5.2.0
Windows XP & Linux Synology 2.6.15
Synology DS107+ (128)
Pinnacle SC200
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/04/19 17:40 now with fonts directory, regards, Klaas



-----------------------------------------
SwissCenter 1.20
Simese 1.40 & Apache 2 / PHP 5.2.0
Windows XP & Linux Synology 2.6.15
Synology DS107+ (128)
Pinnacle SC200
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/04/21 05:26 As expected there was a problem with the rights. I saved all files through a FTP-server and that caused the problems. After saving the files the normal way, the 'PLAY NOW'-screen appeared.

It's a great piece of work, CK!!!!

I'll experiment a bit with the fonts and co-ordinates within the "image_screen.php"-file to see whether the 'PLAY NOW'-screen can be optimized. I'll come back with the results.

regards, Klaas

-----------------------------------------
SwissCenter 1.20
Simese 1.40 & Apache 2 / PHP 5.2.0
Windows XP & Linux Synology 2.6.15
Synology DS107+ (128)
Pinnacle SC200
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/04/21 15:59 glad to help "When you've sustained as many blows to the head as I have, consistency is something, something that something..."
- H. J. Simpson
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/05/29 12:14 Klaas,

After following the described steps, I dont see the Plow Now screen.
But in the config screen I also see:
"… successfully located a TrueType font for generating ‘NOW PLAYING” images."

I copied the font files using the internet explorer. (Copying the files to the svr/swiss/fonts directory via a mapped drive)

Could this be the reason of the problem. How should I copy the font files to the
fonts directory?

Thanks.
SwissCenter 1.21.1
Synology CS407 firmware DSM 2.0-0598
Pinnacle SC200 - firmware 21-63
Windows XP SP2
Linux on Synology
PHP 5.2.0
MySQL 5.0.51
Apache 2.2.3 (Unix)
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/05/29 13:12 As far as I experienced there may be two problems:

[1] SwissCenter may not have the correct rights to access the "font"-directory
In this case you should download the "font"-directory first to a location on your PC and then copy the directory to the main SwissCenter directory.

[2] The albumart might be too large
I noticed that large albumarts cause the failure of the "PLAY NOW"-screen. It can be solved by decreasing the image.

Hope this helps.

regards, Klaas

-----------------------------------------
SwissCenter 1.20.1
Simese 1.40 & Apache 2 / PHP 5.2.0
Windows XP & Linux Synology 2.6.15
Synology DS107+ (128)
Pinnacle SC200
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/05/29 16:13 Hi Klaas,

[1]

I cant download directly to the NAS (CS407) so I download the files to my PC, unzip the files and than copy them to the NAS using windows explorer:

I have mapped the "web" directory on the NAS on my windows PC using Synology's assistant. Using the normal windows copy command I copy from the download directory to the fonts directory on my NAS.

Dont actually know of another method to copy these files to the fonts directory......

[2]

All album art is all taken from IMDB by the SC parser. All art is stored after the media search in the same place as the video files (I assume this is how it should be?). The art files are +/- 4-8 KB only.

The cache directory of SC is quite full. About 750 files, 22 Mb. Mayby I should clear that directory but I am afraid it could mess up SC. Its content are all ###_resample.png files. Both movie art, weather buttons & icons and SC background images.

Mayby I should see if recreating the entire database help?
SwissCenter 1.21.1
Synology CS407 firmware DSM 2.0-0598
Pinnacle SC200 - firmware 21-63
Windows XP SP2
Linux on Synology
PHP 5.2.0
MySQL 5.0.51
Apache 2.2.3 (Unix)
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/05/31 08:12 Hi Wouter,

Now you've got function exec() enabled (see here), do you have your "PLAY NOW"-screen working?

regards, Klaas

-----------------------------------------
SwissCenter 1.20.1
Simese 1.40 & Apache 2 / PHP 5.2.0
Windows XP & Linux Synology 2.6.15
Synology DS107+ (128)
Pinnacle SC200
  | | The administrator has disabled public write access.
Re: Freetype Support on Synology DS-107+ - 2008/05/31 09:32 Hi Klaas,

To be honest is was already working before I changed the exec( ) function, just without sound. I just forgot to post that.

I am not sure though what I did to make it work though

Wouter
SwissCenter 1.21.1
Synology CS407 firmware DSM 2.0-0598
Pinnacle SC200 - firmware 21-63
Windows XP SP2
Linux on Synology
PHP 5.2.0
MySQL 5.0.51
Apache 2.2.3 (Unix)
  | | The administrator has disabled public write access.
spacer
 

Screenshots

www.flickr.com
This is a Flickr badge showing public photos from swisscenter. Make your own badge here.


 

Mambo is Free Software released under the GNU/GPL License.
spacer