Styling Text with CSS and Local Fonts

Updated 10 July/2019 for Pano2VR V6.0.2+

Graphic elements such as buttons or information boxes can be exported as png files and added to the skin. However if there are a large number of these elements they can slow down the loading of a large virtual tour.

An alternative is to use SVG (Scalable Vector) files. These elements can be created within Adobe Illustrator and loaded into the skin. However if you want to use a special font to style the text within the SVG, the files will not be supported on Firefox and simply display a standard font (Times)

Sample renderings across browsers

Sample renderings across browsers


The example above shows #1. a SVG file styled using Gilroy Bold displayed in Google Chrome, #2. the same SVG file viewed in Firefox and #3 a version whose text is styled using an external CSS file and local font file. #3 viewed in both Firefox/Google Chrome/Safari look identical. 

The best way to ensure consistency across browsers is to use a Local font file and CSS to style the text. In this example I'm going to create a button and a popup information block using the local font file/css method.

Getting Started

This tutorial covers how to use fonts in a Pano2VR skin that may not be readily available on other computers. In this example the fonts are included in the Pano2VR project.

This tutorial includes; 

  • Create a CSS file to style both the text for the button name, the header and body in a popup window

  • Update the skin to style the text and

  • Link to the CSS file to the HTML5 template

  • Fine tune the line spacing, kerning and add a website link

Before and after styling with CSS and local fonts

Information on converting existing fonts into .WOFF versions is provided at the end of the tutorial.

You can download the basic project files at; and the finished tutorial files at; (Version 6.02)

Note: this tutorial is designed for Pano2VR Version: 6.0.5 Pro

1. Unzip the tutorial files

1.1. Unzip the There is a CSS_Project folder containing 3 .woff font files and project files and a CSS_Assets folder containing a project file P2VR_CSS.p2vr, a skin file P2VR_CSS.ggsk, a css file my_styles.css and a test panorama 6x3-white.jpg.

2. Open the P2VR_CSS.p2vr project

2.1. Double click on the P2VR_CSS.p2vr to open the project in Pano2VR

2.2. Make sure that the Output Folder is pointing to the CSS_Project folder in the P2VR_CSS folder

2.3. Make sure that the Skin is the one located in the CSS_Assets folder in the P2VR_CSS folder

2.4. Click on 'Generate Output'  to view the basic project. It should look and work like the sample file  below.

3. Create the CSS file & apply the classes

The first step is to create the CSS classes and assign them to the three instances of text in the project;

  • The name on the button, 'Lobby & Concierge'

  • The header of the popup 'Concierge Information'

  • The body of the popup 'Body Information'

Each will have slightly different styling so we will create three unique classes, bt_lobby, info_header and info_body.

Note: If you are using V5 we also need to create a new HTML Template that uses the local fonts and link the 'my_styles.css' document to the HTML Template

4. Update the my_styles.css

4.1. Open the 'my_styles.css' into a text editor. I use TextWrangler but you can use any text editor you like. In the text document add the following;

            font-family: "Gilroy-SemiBold";
            font-size: 19px;
            font-family: "Gilroy-Light";
                font-size: 15px;
            font-family: "Gilroy-Bold";
            font-size: 60px;

Text entry for my_styles.css document

Note: If you are cutting and pasting the code above it's good practice to remove all formatting from the text before you save your .css file.


4.2. Save the my_styles.css document

5. Assign the Classes to the elements

5.1. Open the project P2VRCSS.p2vr if it isn't already open, open the skin editor, click on the dropdown arrow of the bt_lobby_cont container and select the element 'button_text'.

5.2 In the Properties/Advanced/CSS Classes: add the class name 'bt_lobby'

button_txt element selected and class name added to Properties/Advanced/CSS Classes:

5.3. Repeat with the elements, in the ‘info_cont’ container, 'header_text' and 'body_text' adding 'info_header' and 'info_body' into the CSS Classes for each element

5.4. Close and save the Skin and publish the project

Note: even though we've provided .WOFF fonts, created a CSS file and applied the Classes to the elements the text isn't styled. That's because the HTML5 template we are using has alternative styling in the template that we need to replace.

6. “NEW For V6 Users” - Disabling Default Fonts

6.1 In the HTML dropdown menu click on the Edit Template button.

Note: It's the one with the spanner and screwdriver icons.

click to open the HTML Template window

6.2 In the HTML Template window check the box against ‘Disable default CSS font:’


check to disable default CSS font;


Note: skip section 7 and continue with section 8 ‘Link the CSS file’

7. For V5 users - Create a new HTML5 Template and link the CSS file

In order to use the local fonts we need to identify them in the index.html file. To do so we will modify the existing HTML Template normal.ggt. 

Note: If you don't know where the HTML5 templates are located on your system open Preferences and under Files you will find a link to the HTML Template Directory.

7.1 Creating the new HTML5 Template

7.1.1. Open the normal.ggt file, into your text editor and scroll down to line 172 or to the where you find the following text;

<style type="text/css" title="Default">
        body, div, h1, h2, h3, span, p {
        font-family: Verdana,Arial,Helvetica,sans-serif;


Text style in the normal.ggt HTML5 template


7.1.2. Replace it with;

<style type="text/css" title="Default">
            font-family: Gilroy-Bold;
            src: url(Gilroy_Bold.WOFF);
            font-family: Gilroy-SemiBold;
            src: url(Gilroy_SemiBold.WOFF);
            font-family: Gilroy-Light;
            src: url(Gilroy_Light.WOFF);

Updated text style in the Gilroy_Fontface.ggt HTML5 template


The @font-face is used to identify the font as a local font, the src: url shows the location of the font. In this case the font is in the same folder as the rest of the files so it's set to url(Gilroy_xx.WOFF)

7.1.3. Save it with a unique name eg Gilroy_Fontface.ggt back into the HTML5 folder with the other HTML templates.

Note: in order to see the new HTML5 template you will have to close and reopen the project

7.1.4. Open up the project and in Output/HTML select the new Gilroy_Fontface html template.

HTML File Template selection popup

8. Link the CSS file

8.1. To add the 'my_styles.css' file into the HTML template click on the 'Edit Template' button next to the HTML Template section. It's the one with the spanner and screwdriver icons.

8.2. In the Template Parameters/Include external CSS file: select 'Open' and select the 'my_styles.css' file from the CSS_Assets folder


V6 HTML Template window showing my_styles.css selected

V5 HTML Template Window showing my_styles.css selected


8.3. Select 'OK', save and publish the project.  It should look like the images below.

Button styled

Info box styled

8.4. The text is now styled using the Gilroy fonts however there is still a bit of fine tuning to be done.

For the final output we want to make some modifications;

  • The word 'Concierge' in the button is too wide and touches the right hand edge of the graphic

  • The spacing between the words Concierge and Information is too large and the spacing between the lines in the body is too small.

  • The words 'visit our website' need to be a hyperlink, without underline, bolded and in the same green color as the button.

Word requires kerning

Line spacing updates and web site link active

9. Update the the line spacing in the popup in the my_styles.css file

9.1. Open the 'my_styles.css' file in your text editor and make the following changes to the .info_header and .info_body classes by adding the two 'line-height' settings.

            font-family: "Gilroy-SemiBold";
            font-size: 19px;
            font-family: "Gilroy-Light";
            font-size: 15px;
            line-height: 170%;
            font-family: "Gilroy-Bold";
            font-size: 60px;
            line-height: 100%;

9.2. Save the file and publish the project to see the updated line spacing

Line spacing applied to the popup header and body

10. Create the website link and kern the button text

10.1. Open the skin and select the body_text element

10. 2. In the Properties/Text/Text: remove the text 'visit our website' and replace it with:

<a href="" target="_blank" style="text-decoration:none;"><span style="font-family: Gilroy-Bold; color: rgb(0,111,120);">visit our website</span></a>

body_text update to include active URL link

10.3. Select the button_text element

10.4. In the Properties/Text/Text: wrap the word 'Concierge' in the following span:  

<span style="letter-spacing: -.5px;">Concierge</span>

button_text updated to close up letter spacing

10.5. Save the skin and publish the project

10.6. You have now finished the tutorial and this is the finished project