X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Font sizes in WYSIWYG (https://forum.x-cart.com/showthread.php?t=39052)

rrmccabe 04-13-2008 03:42 PM

Font sizes in WYSIWYG
 
Running X-Cart 4.1.9 and with the template we are running the font size goes from super small to slightly larger than I would like when using the WYSIWYG editor. Like size 3 to size 4.

I would assum that is a function of a CSS sheet. Is that right?

Thanks

Rich

balinor 04-13-2008 04:10 PM

Re: Font sizes in WYSIWYG
 
View the source, see what formatting tags it is adding.

rrmccabe 04-18-2008 06:16 AM

Re: Font sizes in WYSIWYG
 
The source shows <span style="FONT-SIZE: 14pt">This is a pre-purchase agreement. For $10.00 you get on the official first list. Be the first at your track to own one. This is the first major manufacturer 100% ready 1/8 scale kit entirely designed in the United States. Pictures are of prototype only. Slight variations may exist with mass manufacturing. See Details. </span>

In the WYSIWYG the nex size down seems to set the font to 10??

Thanks

kube 04-18-2008 12:02 PM

Re: Font sizes in WYSIWYG
 
Although I wouldn't recommend using the wysiwyg; a quick way around this, so that you can have your own font sizes within the wysiwyg editor, would be to change these two .js files below...

skin1/modules/HTML_Editor/editor.js
skin1/modules/HTML_Editor/moz/editor.js

and locate these lines of code in both of them...
Code:

if(f.size==1)nSize="8pt";
else if(f.size==2)nSize="10pt";
else if(f.size==3)nSize="12pt";
else if(f.size==4)nSize="14pt";
else if(f.size==5)nSize="18pt";
else if(f.size==6)nSize="24pt";
else if(f.size>=7)nSize="36pt";


and change them to the size you like, for instance (these sizes below are NOT in relation to the equivalent size in pt's)...
Code:

if(f.size==1)nSize="0.8em";
else if(f.size==2)nSize="0.9em";
else if(f.size==3)nSize="1em";
else if(f.size==4)nSize="1.2em";
else if(f.size==5)nSize="1.4em";
else if(f.size==6)nSize="1.6em";
else if(f.size>=7)nSize="2.0em";


I haven't tested this thoroughly but it doesn't appear to be conflicting with anything else within the js and outputs just the same. The em's I have introduced to show that over units are possible. You could just as easily swap...

else if(f.size==3)nSize="12pt"; to else if(f.size==3)nSize="11pt";

...if needs be - for size 3 to come up as 11pt's.

Hope this helps.

rrmccabe 04-19-2008 09:40 AM

Re: Font sizes in WYSIWYG
 
Thanks Doms, But if I dont want to do wysiwyg how do I bump up the default size for description field text?

kube 04-21-2008 12:04 AM

Re: Font sizes in WYSIWYG
 
Quote:

Originally Posted by rrmccabe
if I dont want to do wysiwyg how do I bump up the default size for description field text?


Within the default editor, to bump a portion of text, you could add a span and give it a style with a font size in percent. For example...

<span style="font-size:120%;">text</span>

However, if you meant how do you get a consistent fixed font size for the description text on all the product pages. Then...

Open up skin1/customer/main/product.tpl and locate...
<td>{if $product.fulldescr ne ""}{$product.fulldescr}{else}{$product.descr}{ /if}</td>

and add a class to the TD, for example, .descrtxt...
<td class="descrtxt">{if $product.fullde...

Then open up skin1/skin1.css and add the new class...
Code:

.descrtxt {
 font-size:2em; /* The font-size of your choosing */
}


Still within skin1/skin1.css, locate at the top of the document the following grouped selectors (on one line) and /* comment out */ the font-size like so (whatever the font-size value is)...
Code:

BODY,DIV,TH,TD,P,INPUT,SELECT,TEXTAREA,TT {
  /* FONT-SIZE: 10px;*/
}


Then a little further down locate the following grouped selectors (on one line) and add the default font-size for the rest of the content...
Code:

HTML,BODY {
    FONT-SIZE: 10px; /* default font-size for rest of content -  add to existing code  */
}


Hope this helps.


All times are GMT -8. The time now is 01:10 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.