Jasper fonts on linux - linux

My .jasper report made using verdana on windows does not work on the client running tomcat under red hat linux.
Is there any way to link the verdana.ttf to the .jasper, or the only way around this is to install verdana.ttf on the server side?
Is there any other solution?

There is a lower level alternative. You can unzip the jar jasperreports-fonts-x.x.x.jar in the lib directory of jasper server's.
Check the structure and edit/add the appropriate XML files and the TTF files you need. Maintain coherence in what's in there.
I was having troubles including fonts every time so I did that and only have to worry on the next upgrade :)
Hope it helps, good luck.

Create file jasperreports_extension.properties with this content:
net.sf.jasperreports.extension.registry.factory.fonts= net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.simple.font.families.fontfamily=
fonts/fontfamily.xml
If you use maven, include this file as a resource in your pom.xml
Create a file fontfamily.xml with this content:
<fontfamilies>
<fontfamily name="Verdana">
<normal><![CDATA[fonts/verdana.ttf]]></normal>
<bold><![CDATA[fonts/verdanabd.ttf]]></bold>
<italic><![CDATA[fonts/verdanai.ttf]]></italic>
<bolditalic><![CDATA[fonts/verdanabi.ttf]]></bolditalic>
<pdfembedded><![CDATA[true]]></pdfembedded>
</fontfamily>
</fontfamilies>
Put in folder "fonts" (create this folder) all ttf files (download for example from http://www.fontsupply.com/fonts/V/Verdana.html)
Use fontName Verdana in all your Jasper Reports (*.jrxml)

Related

How can I create my own file type on Node?

I am wondering if I can change the mime-type of a file on Node. I have checked many mime-type modules, but all of them are just to get information from the files and from the system.
What I would like to achieve is to zip some files in one single file and then, change the mime-type. On this way I could check if the file type is suited for my application.
I know there are differences between operating systems:
Windows. I change the extension and it is done
Ubuntu. I must deal with mime-types. This is what I would like to change
Mac. They have a system similar to Ubuntu.
How to achieve this on Ubuntu or Mac?
Assuming that I can do it and I have just changed the mime-type of a zip file on Ubuntu, is it still going to detect the file as a zip file by the system?
If all of this is not possible. How can I create my own file built with different files?
For example I would like to include all these files compressed inside the packaged file called filename.foo:
An XML file with metadata
A text file
A CSV file
An image
Finally I have changed the file extension and added a new MIME-TYPE to the system. In this way Nautilus (Ubuntu) and the Windows explorer recognise the file with the new type.
When I use the command file --mime-type I still detect the zip mime-type. But that's not bad because I can use this detection to avoid errors in my app.
Create your own MIME-TYPE for Nautilus
Create a new XML in /usr/share/mime/packages/ with this content:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/todo">
<comment>Todos Text file</comment>
<glob pattern="*.TODO"/>
<glob pattern="*.todo"/>
</mime-type>
</mime-info>
Execute the following command to update mime database
sudo update-mime-database /usr/share/mime
Assign an icon to the new extension
First step is renaming the icon to application-todo and it must be in svg extension.
If you're using gnome you have move the icon to /usr/share/icons/gnome/scalable then update the cache with
$ sudo gtk-update-icon-cache /usr/share/icons/gnome -f
If you're using unity move it to /usr/share/icons/Humanity/mimes/ then update the cache
$ sudo gtk-update-icon-cache /usr/share/icons/Humanity -f
Give your nautilus a refresh and you'll have a new mime-type with icon
Most higher level applications make use of the file extension to determine an approprite mime type.
OS X, Linux and UNIX systems can make use of the 'file' command which uses a pre compiled database of header and the offset at which the unique identifier for the mime type exists; see /usr/share/misc/magic.mgc
While I can only think of one reason to modify a created archive to a different mime type which is undoubtedly nefarious it is possible would require hex editing the archive to create/pretend the associated signature at the correct offset.
Of course this would then require your node module to first strip this unnecessary header prior to extraction.

collada2gltf converter can't produce *.json file

I am reading a book: Programming 3D Applications with HTML5 and WebG , it involve a Vizi framework.
All the examples load the *.json file instead of *.gltf file. Why?
When I load *.gltf, it doesn't load any result, and the collada2gltf converters only produce *.gltf, *.bin, *.glsl files and so on.
What should I do?
.gltf is a JSON file. Try to open it with a text editor and see for youself. .bin and .glsl files are just additional resources, linked from .gltf file. Those are geometry buffers and shaders respectively. So to make it work you should make sure that all the files produced with the converter are also available to a web browser you running your code in.
Also you can try to add -e CLI flag to collada2gltf and it'll embed all the resources into result .gltf file.

openam jar file for custom module development

Where will I get the opensso.jar within the openAM-12 folder?
This jar file essential for developing the custom module. The amserver.jar is named as openam-core-12.0.0 and opensso-sharedlib.jar is named as openam-shared-12.0.0.
But opensso.jar cannot be found within the folder openAM-12. Please help me.
I don't believe there is a clear replacement for opensso.jar, from what I can see it looks like that it has been mainly separated into OpenFM and openam-cli-impl.

Single-file app with xulrunner - possible?

I have tried to mess with xulrunner before, and now I'm trying once again :)
The "real" tutorial (Getting started with XULRunner - MDN) does, in fact, show that one is supposed to have application.ini and other files (possibly zipped as .xpi, which then requires --install-app ...), and then the call should be like:
xulrunner `pwd`/application.ini
... however, I'd like an easier way to start up - and hence, my hope for single-file XUL application approach :) (A good note here is that one also cannot use the zipped .xpi as an argument to xulrunner, see XULRunner question - DonationCoder.com)
The thing is, I am almost 100% certain that at some point in the past, I have used a simple single-file XUL application, as in (pseudocode):
xulrunner my-xul-app.extension
... but I cannot remember how it went :) So, was that possible with xulrunner, or only with firefox?
As far as I can remember, I used something like a 'my-xul-app.xul' file (as the single-file application), which would specify only, say, a window with a single button (that couldn't really do anything due to lack of javascript) - and I'd like to repeat the same thing now, to refresh my memory (unless I confused something from back then :))
First of all, I found HOWTO: Getting Started with Linux Standalone Apps using XUL - Ubuntu Forums (2007), and I modified the example.xul file used there as:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window
id = "myapp"
title = "SQLite Example"
height = "420"
minHeight = "420"
width = "640"
minWidth = "640"
screenX = "10"
screenY = "10"
sizemode = "normal"
xmlns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
<spacer style = "height: 4px; cursor: default;" />
</window>
and I'm trying to "run" this as recommended in link, with:
firefox -no-remote -chrome file:$PWD/example.xul
... and what happens is that Firefox opens, with window size being like 1x1 pixels; if you can find the handle, you can stretch the window, and read:
Remote XUL
This page uses an unsupported technology that is no longer available by default in Firefox.
Ouch :( Answers to this (like How do I fix the Remote XUL error I get when using Firefox 4.x and the Webmail Advanced Interface?) seem to be related to actual remote xul (and recommend a plugin to handle that); but what I want is simply to run a file locally?! Where did the "remote" part come from?
Also, seeing the firefox switch '-app' (Using Firefox 3 as a XUL runtime environment); although it refers to an application.ini, I tried this:
firefox -no-remote -app $PWD/example.xul
... and Firefox just started as usual.
Btw, I cannot see neither -app nor -chrome command line options in firefox --help ;)
But actually, I do not really want to use firefox as an engine - just the xulrunner; and I tried the Firefox approach because I thought it is more-less the same as xulrunner; turns out it isn't (even if you use application.ini: Why does 'firefox -App application.ini' and 'xulrunner application.ini' behave differentely? | Firefox Support Forum):
In any case, if I run just xulrunner (as I wanted to), I get:
$ xulrunner example.xul
Error: App:Name not specified in application.ini
So, I can see everything points to "single source file" app not being possible with xulrunner - but I just wanted to make sure (in case I missed some obscure tutorial :) ). And if it isn't - does anyone remember if it was possible at a previous point in time?
PS:
$ firefox --version
Mozilla Firefox 7.0.1
$ xulrunner --version
Mozilla XULRunner 2.0 - 20110402003021
$ uname -r
2.6.38-11-generic
$ cat /etc/issue
Ubuntu 11.04 \n \l
I don't believe you could ever create single-file XULRunner applications. The -chrome <...> parameter probably used to work, I guess the "Remote XUL" error comes from the fact that the URL is file://, not chrome://.
You could use something like the Live XUL Editor in the Developer Assistant (formerly Extension Developer's extension) to test XUL quickly.
The general idea I hear these days is that you should write HTML5 instead, whenever you can, since it is more actively developed, more well-known technology with less incompatible changes and better tooling...
Here is the answer I wrote for another related question, reproduced here because it may help someone who want to know how to package their XUL application.
It is too bad that xulrunner can not run a zipped .xpi or .xulapp directly, but it is possible to package most of your .js, .xul, .css and .png files into a jar and wrap everything up with a private copy of xulrunner, without having to run --install-app
These are the steps I went through to package our XUL application.
The first step is to put all your files (except application.ini, chrome.manifest, and prefs.js) into a .jar file like this (all of this was carried out under Windows, make appropriate adjustments for Linux and OSX)
zip -r d:\download\space\akenispace.jar * -i *.js *.css *.png *.xul *.dtd
Then in d:\download\space, layout your files as follows:
D:\download\space\akenispace.jar
D:\download\space\application.ini
D:\download\space\chrome.manifest
D:\download\space\defaults
D:\download\space\defaults\preferences
D:\download\space\defaults\preferences\prefs.js
The content of the files are as follows
application.ini
[App]
Vendor=Akeni.Technologies
Name=Akeni.Space
Version=1.2.3
BuildID=20150125
Copyright=Copyright (c) 2015
ID=space#akeni.com
[Gecko]
MinVersion=1.8
MaxVersion=35
chrome.manifest
content akenispace jar:akenispace.jar!/chrome/content/
skin akenispace default jar:akenispace.jar!/chrome/skin/
locale akenispace en-US jar:akenispace.jar!/chrome/locale/en-US/
resource akenispace jar:akenispace.jar!/chrome/resource/
prefs.js
pref("toolkit.defaultChromeURI", "chrome://akenispace/content/space.xul");
Now you can put these files into your .wxs for WiX and produce an MSI file for Wndows.
Of course you need to include all the files for XULRunner as well.

Open Files Created with BSAVE in QuickBasic?

I have some files that were created using BSAVE in QuickBasic. I'm wondering how I can load/view these files?
I received assistance over at the FreeBasic forums. Its easy to do if you download and install the FreeBasic compiler / IDE. Here is the relevant thread:
http://www.freebasic.net/forum/viewtopic.php?t=12554&postdays=0&postorder=asc&start=0
Essentially, it loads the image using BLOAD like one normally would and then BSAVEs it as a BMP. I suppose it would be pretty easy to create an app. that did this by just prompting for source and output files...
I would try installing pcpaint (free) http://www.shdon.com/software/pcpaint
Change the extension to .PIC and try to open it. Apparently this program used bsave to save images with the extention .pic.
Hope this works!

Resources