Page 1 of 1

BUG: Cannot set font-family via CSS

Posted: Thu Mar 08, 2018 4:58 pm
by mbb
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

Re: BUG: Cannot set font-family via CSS

Posted: Thu Mar 08, 2018 9:02 pm
by Hopki
Hi,
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 524 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

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

.textbox2{ 			
			font-family: "Comic Sans MS";
			font-weight:bold;
    			font-size: 14px;
			}

.textbox3{ 			
			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.

Regards,
Hopki

Re: BUG: Cannot set font-family via CSS

Posted: Thu Mar 08, 2018 10:03 pm
by mbb
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).