One of the topics we always cover in our data visualization training courses is the font family selection within your app. With the increasing number of devices and platforms accessing to your QlikView apps, details such as font size and type have become in a very important piece of the app success.
As a rule of thumb our recommendation is to keep your app as simple as possible, meaning using Arial or any other font that work well across devices. It’s important to note that fonts such as Tahoma or MS Calibri will force those devices that don’t come with those fonts installed, to pick an alternative font based on the font family. That may cause your app to be unreadable and/or blurry in some situations.
But let’s say you really need to use a non-standard typeface to customize one of your apps. Is that doable with QlikView?
The answer is yes, you can customize QlikView apps based on your needs and use an external font from Google or any other font servers.
To do so you will need to install and customize a document extension – you can download it at the bottom of this post - and then follow the next steps:
1. Search or browse font families at google.com/fonts you want to use in your QV app For this example, I’m going to pick the Abel font for my project, one of the many open source fonts hosted at google.com/fonts. You could choose a different provider or just host the font file on your own server.
2. Once you have chosen your font, grab a copy of the font file and install it on the computer where you are developing your app and in the machine(s) that host the QlikView Server(s). This is especially important: you must install the font on the QV server host machine if you want your charts to be rendered using the selected font.
3. Open your QlikView app with QlikView Desktop and modify the font as usual:
4. Once we are done applying your font across all the app objects it’s the time to review the document extension.
5. Download the extension attached at the bottom of this post, rename the file from ExtensionName.qar to ExtensionName.zip and unzip it.
A document extension will include at least 2 files, Definition.XML and Script.js.
The JS file will look like the example below where Abel is the font I chosen.
7. Go back to QlikView and activate the document extension in the app:
From now on when the page loads, QlikView will include the extension and the font will be loaded across devices.
8. Publish your app to the server and enjoy your custom fonts in any device.
As a general recommendation you should stick to one of the 'standard' fonts such as Arial but in the case of you trying something new, following the described 8 steps you should be able to deploy a QV app to a server with a non-standard font on it.
PROS: Wide range of font styles to choose from, easy app customization, web standard fonts, works well across any device.
The performance benefits of loading the fonts through a separate LoadCSS() statements will be in the milliseconds so I would bake it into my original CSS file instead, either as a @import or a normal font-family declaration.
The little performance gain you might get is outweighed by maintainability in my book
Thanks for everyone's help so far on this. I am successful in bringing in several new fonts and implementing those so the user's see them when they access the applications via ajax. The style sheet is very simple currently just changing a few things like
/* List Box Defaults */
.QvListbox{
font-family:'Open Sans' !important;
}
/* Caption Defaults */
.QvCaption{
background-color:#f0f1f2 !important;
border-bottom:1px solid #f8f9fa !important;
Is there a way to set the style sheet so it only affects a single object. Meaning for CH01 I want the caption with background-color:#f0f1f2 and CH02 background-color:#474747 ?
To add to this. I am using firebug and can identify the class and the class id. The div is embedded 5-7 layers so several embedded classes. The issue I am having is on the style sheet formatting it specific for a single chart or single list box. If someone can give me an example I would greatly appreciate. Below is my last failed attempt.
This is because i need to load 2 different font from the same family. However only the first font is loaded (700), the second one is never rendered. what am i missing?
Edit: found out that even if the fonts are listed as "Open Sans Condensed", after the installation one of them appears as "Open Sans Condensed Light", like it's a different font, not just a different style.
Only the Bold (700) is listed ad the original "Open Sans Condensed", and in fact that's the only text that is the only one rendered using the extension.
How can i achieve my goal this way? Google doesn't have a family for "Light".