Qual: Work to allow externalizing of fonts.

This commit is contained in:
Laurent Destailleur
2011-08-14 17:17:19 +00:00
parent c3270c7c76
commit d6bb618dfe
13 changed files with 100 additions and 76 deletions

View File

@@ -1,6 +1,8 @@
<?php
/*
* PHP-Barcode 0.3pl1
/* Copyright (C) 2001,2002,2003,2004 Folke Ashberg <folke@ashberg.de>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* PHP-Barcode 0.3pl2
*
* PHP-Barcode generates
* - Barcode-Images using libgd2 (png, jpg, gif)
@@ -15,8 +17,6 @@
* I25, 128RAW, CBR, MSI, PLS
* genbarcode is available at www.ashberg.de/bar
*
* (C) 2001,2002,2003,2004 by Folke Ashberg <folke@ashberg.de>
*
* The newest version can be found at http://www.ashberg.de/bar
*
* This program is free software; you can redistribute it and/or modify
@@ -60,14 +60,15 @@ $text_color=Array(0,0,0);
/* SAMPLE2 :
* use font specified by full-path
*/
$font_loc = DOL_DOCUMENT_ROOT.'/includes/barcode/php-barcode/fonts/AerialBd.ttf';
if (defined('DOL_DEFAULT_TTF_BOLD')) $font_loc=constant('DOL_DEFAULT_TTF_BOLD');
/* Automatic-Detection of Font if running Windows
* kick this lines if you don't need them! */
// DOL_CHANGE LDR
if (isset($_SERVER['WINDIR']) && @file_exists($_SERVER['WINDIR'])){
$font_loc=$_SERVER['WINDIR']."\Fonts\arialbd.ttf";
}
if (empty($font_loc)) die('DOL_DEFAULT_TTF_BOLD must de defined with full path to a TTF font.');
/* ******************************************************************** */
/* GENBARCODE */
@@ -76,15 +77,10 @@ if (isset($_SERVER['WINDIR']) && @file_exists($_SERVER['WINDIR'])){
* leave blank if you don't have them :(
* genbarcode is needed to render encodings other than EAN-12/EAN-13/ISBN
*/
// DOL_CHANGE LDR
if (isset($_SERVER['WINDIR']) && empty($conf->global->GENBARCODE_LOCATION))
{
$genbarcode_loc = DOL_DOCUMENT_ROOT.'/includes/barcode/php-barcode/genbarcode/genbarcode.exe';
}
else
{
$genbarcode_loc = $conf->global->GENBARCODE_LOCATION;
}
if (defined('PHP-BARCODE_PATH_COMMAND')) $genbarcode_loc=constant('PHP-BARCODE_PATH_COMMAND');
else $genbarcode_loc = $conf->global->GENBARCODE_LOCATION;
//dol_syslog("genbarcode_loc=".$genbarcode_loc." - env_windows=".$_SERVER['WINDIR']);