BUG: Cannot set font-family via CSS

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
Posts: 229
Joined: Mon Oct 19, 2009 11:42 pm

Thu Mar 08, 2018 4:58 pm

I am unable to set the font-family either by putting inline CSS in the element's "CSS Styles;" field or by setting my own class and having Pano2vr include my separate CSS file.

I am able to effect change to other font attributes via CSS (weight, style, size), but not the font-family.

Pano2VR v 5.2.3, Windows 10 64-bit
User avatar
Posts: 10467
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK

Thu Mar 08, 2018 9:02 pm

Pano2VR has a line of code in the HTML page that prevents fonts displaying.
However if you add:

Code: Select all

font-family: "Comic Sans MS";
In the CSS Styles but them remove this line in the HTML page:

Screen Shot 2018-03-08 at 19.49.34.png
Screen Shot 2018-03-08 at 19.49.34.png (80.59 KiB) Viewed 792 times

You will see the font.

In V6 there will be a checkbox to Disable default CSS font but for now you have to remove it manually.
You can even use CSS Classes so a styles.css doc with:

Code: Select all

   			text-shadow: 1px 1px 2px #FF0000;
			font-family: "Times New Roman";
    			font-size: 18px;

			font-family: "Comic Sans MS";
    			font-size: 14px;

			font-family: "Arial Black";
			font-style: italic;
    			font-size: 25px;
So in each test box enter in the CSS Classes box: textbox1 or textbox2 or textbox3.
Then each box will get the CSS attributes from the CSS doc.

Garden Gnome Software Support
If you send an e-mail to support please send a link to the forum post for reference.
Posts: 229
Joined: Mon Oct 19, 2009 11:42 pm

Thu Mar 08, 2018 10:03 pm

Ok, I have solved the issue without having to edit the HTML page as you have suggested (which would certainly be a pain to do each time I made changes to the skin and saved).

Apparently when I define a class within the fields skin editor, Pano2VR is not applying that class directly to my element as it should, but rather adding that class name to a surrounding div. So any setting made to my class was not taking effect.

Changing my CSS selection to ".myDefinedClass div { font-family: 'MyCoolFont'; }" (note the additional div) now changes the font as it should.

You should clear this up in the new v.6 (proper application of class names to the correct elements).
Post Reply