PHP Classes

Font fix on linux

Recommend this page to a friend!

      Barcode  >  All threads  >  Font fix on linux  >  (Un) Subscribe thread alerts  
Subject:Font fix on linux
Summary:on linux server $_SERVER["PATH_TRANSLATED"] is empty
Messages:5
Author:Rudy
Date:2010-03-25 16:23:00
Update:2013-01-15 07:48:57
 

  1. Font fix on linux   Reply   Report abuse  
Picture of Rudy Rudy - 2010-03-25 16:23:00
on a linux server:
1) load arialbd.ttf in the same folder of barcode.inc.php
2) change line 54 of barcode.inc.php into:

$this->_font=dirname($_SERVER["SCRIPT_FILENAME"])."/"."arialbd.ttf";


  2. Re: Font fix on linux   Reply   Report abuse  
Picture of daisy white daisy white - 2012-02-09 08:39:51 - In reply to message 1 from Rudy
I've been very disappointed by most uses of QR Code because quite simply they are don't look good and aren't well integrated into the branding or design. A friend heard me complain so much he found this link and sent it to me. Now these are a bit more creative, I hope the info. is more than a phone number, web address or other basic info.【 KEEPAUTOMATION Free Online Code Reader】http://www.keepautomation.com/products/word_barcode/

  3. Re: Font fix on linux   Reply   Report abuse  
Picture of md imran md imran - 2013-01-15 07:44:02 - In reply to message 1 from Rudy
It will not work.
i have replace line 54 with given code.
but there is one problem what to do in line 55 and 56.
i.e
Line 54: $this->_font=dirname($_SERVER["PATH_TRANSLATED"])."/"."arialbd.ttf";
Replace with This Code
$this->_font=dirname($_SERVER["SCRIPT_FILENAME"])."/"."arialbd.ttf";


Line 55:if (isset($_SERVER['WINDIR']) && file_exists($_SERVER['WINDIR']))
Line 56:$this->_font=$_SERVER['WINDIR']."\Fonts\arialbd.ttf"; plz help me

  4. Re: Font fix on linux   Reply   Report abuse  
Picture of md imran md imran - 2013-01-15 07:48:57 - In reply to message 1 from Rudy
if (isset($_SERVER['WINDIR']) && file_exists($_SERVER['WINDIR']))
$this->_font=$_SERVER['WINDIR']."\Fonts\arialbd.ttf";


In place of WINDIR what to write here
$_SERVER['WINDIR'])

  5. Re: Font fix on linux   Reply   Report abuse  
Picture of kuldeep jain kuldeep jain - 2022-04-22 05:06:38 - In reply to message 3 from md imran
You can download the font from : https://github.com/RedBalloonShenanigans/MonitorDarkly/blob/master/fonts/arialbd.ttf

and then place on your server and can replace the line 54:


$this->_font=dirname($_SERVER["PATH_TRANSLATED"])."/"."arialbd.ttf";

to

$this->_font=dirname(__FILE__).DIRECTORY_SEPARATOR."arialbd.ttf";