Difference between revisions of "Template:WFont"

From Second Life Wiki
Jump to navigation Jump to search
(added comment and exmaple)
(added 'fstyle' (font-style))
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><span {{ #if: {{{id|}}} | id='{{{id}}}' | }} style='{{ #if: {{{family|}}} | font-family:{{{family}}}; | }} {{ #if: {{{size|}}} | font-size:{{{size}}}; | }} {{ #if: {{{color|}}} | color:{{{color}}}; | }} {{ #if: {{{rgb|}}} | color:rgb({{{rgb}}}); | }} {{ #if: {{{weight|}}} | font-weight:{{{weight}}}; | }}'>{{{text|}}}</span></includeonly><noinclude>
<includeonly><span {{ #if: {{{id|}}} | id='{{{id}}}' | }} style='{{ #if: {{{family|}}} | font-family:{{{family}}}; | }} {{ #if: {{{size|}}} | font-size:{{{size}}}; | }} {{ #if: {{{weight|}}} | font-weight:{{{weight}}}; | }} {{ #if: {{{decorate|}}} | text-decoration:{{{decorate}}}; | }} {{ #if: {{{fstyle|}}} | font-style:{{{fstyle}}}; | }} {{ #if: {{{color|}}} | color:{{{color}}}; | }} {{ #if: {{{rgb|}}} | color:rgb({{{rgb}}}); | }} {{ #if: {{{back_color|}}} | background-color:{{{back_color}}}; | }} {{ #if: {{{back_rgb|}}} | background-color:rgb({{{back_rgb}}}); | }}'>{{{text|}}}</span></includeonly><noinclude>


== Usage ==
== Usage ==
Line 8: Line 8:
|family=
|family=
|size=
|size=
|weight=
|decorate=
|fstyle=
|color=
|color=
|rgb=
|rgb=
|weight=
|back_color=
|back_rgb=
|text=
|}}</nowiki></pre></code></div>
|}}</nowiki></pre></code></div>


<span style="font-family:monospace;font-size:10pt">color</span> and <span style="font-family:monospace;font-size:10pt">rgb</span> both set the text color but the former allows a HEX specification and the latter allows for an RGB specification.
{| border=1
! field !! comment
|-
| <code>id</code> || HTML 4.01 [http://www.w3.org/TR/REC-html40/struct/global.html#h-7.5.2 element identifier]
|-
| <code>family</code> || CSS 2.1 [http://www.w3.org/TR/CSS21/fonts.html#font-family-prop font family]
|-
| <code>size</code> || CSS 2.1 [http://www.w3.org/TR/CSS21/fonts.html#font-size-props font size]
|-
| <code>weight</code> || CSS 2.1 [http://www.w3.org/TR/CSS21/fonts.html#font-boldness font weight]
|-
| <code>decorate</code> || CSS 2.1 [http://www.w3.org/TR/CSS21/text.html#decoration text decoration]
|-
| <code>fstyle</code> || CSS 2.1 [http://www.w3.org/TR/CSS21/fonts.html#propdef-font-style font style]
|-
| <code>color</code> || CSS 2.1 [http://www.w3.org/TR/CSS21/colors.html#colors color]
|-
| <code>rgb</code> || CSS 2.1 [http://www.w3.org/TR/CSS21/colors.html#colors color]
|-
| <code>back_color</code> || CSS 2.1 [http://www.w3.org/TR/CSS21/colors.html#background-properties background color]
|-
| <code>back_rgb</code> || CSS 2.1 [http://www.w3.org/TR/CSS21/colors.html#background-properties background color]
|-
| <code>text</code> || any text
|}


<span style="font-family:monospace;font-size:10pt">size</span> requires either <span style="font-family:monospace;font-size:10pt">pt</span> or <span style="font-family:monospace;font-size:10pt">px</span>.


== Examples ==
== Examples ==
Line 21: Line 49:
<div style="font-size:140%"><code><pre><nowiki>This is {{wFont|size=10px|family=monospace|rgb=255,64,128|text=my line|}} of text.</nowiki></pre></code></div>
<div style="font-size:140%"><code><pre><nowiki>This is {{wFont|size=10px|family=monospace|rgb=255,64,128|text=my line|}} of text.</nowiki></pre></code></div>
This is {{wFont|size=10px|family=monospace|rgb=255,64,128|text=my line|}} of text.
This is {{wFont|size=10px|family=monospace|rgb=255,64,128|text=my line|}} of text.
<div style="font-size:140%"><code><pre><nowiki>This is yet {{wFont|size=large|family=serif|color=orange|back_color=blue|text=more of my|}} of text.</nowiki></pre></code></div>
This is yet {{wFont|size=large|family=serif|color=orange|back_color=blue|text=more of my|}} of text.


</noinclude>
</noinclude>

Latest revision as of 12:16, 5 February 2009


Usage

Minimum Requirements

{{wFont|
|id=
|family=
|size=
|weight=
|decorate=
|fstyle=
|color=
|rgb=
|back_color=
|back_rgb=
|text=
|}}
field comment
id HTML 4.01 element identifier
family CSS 2.1 font family
size CSS 2.1 font size
weight CSS 2.1 font weight
decorate CSS 2.1 text decoration
fstyle CSS 2.1 font style
color CSS 2.1 color
rgb CSS 2.1 color
back_color CSS 2.1 background color
back_rgb CSS 2.1 background color
text any text


Examples

This is {{wFont|size=10px|family=monospace|rgb=255,64,128|text=my line|}} of text.

This is my line of text.

This is yet {{wFont|size=large|family=serif|color=orange|back_color=blue|text=more of my|}} of text.

This is yet more of my of text.