VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Gouz on November 21, 2014, 16:04:28 PM

Title: (2.9.9.5) No fonts _specs.xml files found warning
Post by: Gouz on November 21, 2014, 16:04:28 PM
After upgrading 2.9.9.4 to 2.9.9.5 i get the following warning in SHOP tab.

""
Warning
No fonts _specs.xml files found in ..../libraries/tcpdf/fonts
""
Title: Re: (2.9.9.5) No fonts _specs.xml files found warning
Post by: GJC Web Design on November 21, 2014, 19:21:05 PM
VM3 is released..... 
Title: Re: (2.9.9.5) No fonts _specs.xml files found warning
Post by: Gouz on November 21, 2014, 20:29:39 PM
Just updated. Same thing.
Title: Re: (2.9.9.5) No fonts _specs.xml files found warning
Post by: Troels_E on November 22, 2014, 22:39:12 PM
Same thing here.
Just building from scratch with VM3.

"No fonts _specs.xml files found in....."
Title: Re: (2.9.9.5) No fonts _specs.xml files found warning
Post by: Milbo on November 23, 2014, 11:45:08 AM
It is a false positiv. You can ignore it.
Title: Re: (2.9.9.5) No fonts _specs.xml files found warning
Post by: Snake 60 on December 01, 2014, 23:54:09 PM
Quote from: Milbo on November 23, 2014, 11:45:08 AM
It is a false positiv. You can ignore it.
How I can ignore it if I can't set any fonts for invoices???
Joomla 3.3.6+Virtuemart 3.0.0
(http://foto.kolibru.ru/images/2014/12/02/2014-12-02_1-48-50.jpg)
Title: Re: (2.9.9.5) No fonts _specs.xml files found warning
Post by: Christopher on December 02, 2014, 15:51:38 PM
I have the same problem using J3.3.6 / vm3.0.0

I have checked the source code and find only one reference, in the file "administrator/components/com_virtuemart/models/config.php" around line 129 :

/**
* Retrieve a list of available fonts to be used with PDF Invoice generation & PDF Product view on FE
*
* @author Nikos Zagas
* @return object List of available fonts
*/
function getTCPDFFontsList() {

$dir = VMPATH_ROOT.DS.'libraries'.DS.'tcpdf'.DS.'fonts';
$result = array();
if(function_exists('glob')){
$specfiles = glob($dir.DS."*_specs.xml");
foreach ($specfiles as $file) {
$fontxml = @simpleXML_load_file($file);
if ($fontxml) {
if (file_exists($dir . DS . $fontxml->filename . '.php')) {
$result[] = JHtml::_('select.option', $fontxml->filename, vmText::_($fontxml->fontname.' ('.$fontxml->fonttype.')'));
} else {
vmError ('A font master file is missing: ' . $dir . DS . $fontxml->filename . '.php');
}
} else {
vmError ('Wrong structure in font XML file: '. $dir . DS . $file);
}
}
}

return $result;
}


I am not a great PHP programmer but a quick check of vm 2.6.x code and I found the following more extensive code, in the same file and location, around line 111 :

/**
* Retrieve a list of available fonts to be used with PDF Invoice generation & PDF Product view on FE
*
* @author Nikos Zagas
* @return object List of available fonts
*/
function getTCPDFFontsList() {

$dir = JPATH_ROOT.DS.'libraries'.DS.'tcpdf'.DS.'fonts';
$result = array();
if(function_exists('glob')){
$specfiles = glob($dir.DS."*_specs.xml");
} else {
$specfiles = array();
$manual = array('courier_specs.xml','freemono_specs.xml','helvetica_specs.xml');
foreach($manual as $file){
if(file_exists($dir.DS.$file)){
$specfiles[] = $dir.DS.$file;
}
}
}
foreach ($specfiles as $file) {
$fontxml = @simpleXML_load_file($file);
if ($fontxml) {
if (file_exists($dir . DS . $fontxml->filename . '.php')) {
$result[] = JHTML::_('select.option', $fontxml->filename, JText::_($fontxml->fontname.' ('.$fontxml->fonttype.')'));
} else {
vmError ('A font master file is missing: ' . $dir . DS . $fontxml->filename . '.php');
}
} else {
vmError ('Wrong structure in font XML file: '. $dir . DS . $file);
}
}

return $result;
}


... Is there something missing with the code for vm 3.0 ?

Can we cut-and-paste this code from 2.6.x to 3.0.0 ?

Thanks in advance
Title: Re: (2.9.9.5) No fonts _specs.xml files found warning
Post by: Christopher on December 02, 2014, 16:07:32 PM
After a bit more digging, I think I have found a solution...

I checked a backed up vm2.6.x site and looked in this folder:

[site root]/libraries/tcpdf/fonts

... where I found a bunch of "[fontname]_specs.xml" files for various fonts - five files in all, so I nailed these up to the same folder ( [site root]/libraries/tcpdf/fonts ) in my vm3.0.0 installation and (fingers crossed) it appears to have solved the problem.

I also found a repository of the XML files and other ways to solve the problem here:

https://codereview.appspot.com/8092047/

... I hope this helps
Title: Re: (2.9.9.5) No fonts _specs.xml files found warning
Post by: Snake 60 on December 02, 2014, 17:54:43 PM
to Christopher
Thanks, you real help
+ woot in karma :)
Title: Re: (2.9.9.5) No fonts _specs.xml files found warning
Post by: Christopher on December 02, 2014, 18:10:50 PM
No problem Snake 60 - glad I could help.

Perhaps if we can get a heads up from Milbo on whether this is a good fix (or whether there are missing file or code from the release of vm 2.9 and vm3.0) then we can flag this as solved
Title: Re: (2.9.9.5) No fonts _specs.xml files found warning
Post by: Troels_E on December 18, 2014, 11:40:01 AM
Thanks for the link!

I'm no developer and only my logic tells me what this or that code do, so it was a bit difficult to understand why it should be a false positive, since it was clearly not working.

EDIT: Would be nice to get a confirmation about whether this is the actual bug and a straightforward way to fix it (I'm not sure what to do with the files linked above). Or just a word of whether it is fixed in next update.
Title: Re: (2.9.9.5) No fonts _specs.xml files found warning
Post by: Milbo on December 18, 2014, 17:53:59 PM
It is fixed in the matter, that if there are no spec files are found, it takes a fallback. Thank you for the hint, that the spec files are in vm2.6, I think zakos added them a year ago.
Title: Re: (2.9.9.5) No fonts _specs.xml files found warning
Post by: NETsystem.tv on December 26, 2014, 18:08:41 PM
Hello, i'm a new user in the forum.

Joomla 3, VM3.

I have this bug:(Error).
Attenzione
No fonts _specs.xml files found in /web/htdocs/www.taorvica.it/home/libraries/tcpdf/fonts

How can fix this problem?,
thanks you, very much,

Best Regards from Italy
René
Title: Re: (2.9.9.5) No fonts _specs.xml files found warning
Post by: jjk on December 30, 2014, 21:26:32 PM
If your version of VirtueMart still needs the the _specs.xml files, you can download them here: http://dev.virtuemart.net/projects/virtuemart/repository/show/trunk/virtuemart/libraries/tcpdf/fonts