FANDOM


[edit] Template-info Template documentation

This is the {{Font}} template. It can be used to assign fonts available on Asphalt Wiki to wikitext. It can also set text color and background color to avoid nested formatting templates.

Usage

{{fontfont name | text | color | font size | background | font weight | div = }}

Parameters

font name

  • One of the font-family classes defined in the Fonts section of MediaWiki:Wikia.css, mainly:
    • font-a6
      hemi-head
      a6 (shorthand)
      Hemi Head Bold Italic, the Asphalt 6 main font. Example: Example text
    • font-a8
      accidental-presidency
      a8 (shorthand)
      Accidental Presidency, the Asphalt 8 main font. Example: Example text
    • font-a8-race
      monkirta-pursuit
      a8-race (shorthand)
      Monkirta Pursuit NC, the Asphalt 8 racing screen font. Example: Example text
    • font-a9
      rajdhani
      a9 (shorthand)
      Rajdhani, the Asphalt 9 main font. Example: Example text
    • font-ax
      asphalt-offroad
      ax (shorthand)
      Asphalt Offroad, the Asphalt Xtreme main font. Example: Example text

text

  • The text to be displayed.

color

  • Font color. Acceptable values are
    • Asphalt-specific colors like a8rare, a8legendary, etc. as listed in {{Color}},
    • RGB hex codes, e. g. #c9e72a, or
    • any of the web colors red, blue, green, moccasin, darkorchid, etc.

font size

  • CSS font-size property values like 15px, large or 150%.

background

  • CSS background-color property values, same as for color.

font weight

  • CSS font-weight property values:
    • normal, bold, or
    • a number between 100 and 700, where 400 is the same as normal, and 700 is the same as bold.
    • The template also accepts the non-CSS values medium (translated to 500) and semi-bold or semibold (translated to 600).
  • This parameter is only needed if a font has defined weights other than normal and bold.
    • Rajdhani, for example, has a medium and a semi-bold font weight which will be displayed if font weight is set to medium (500) or semi-bold (600).
    • Otherwise, bold font weights can be easier displayed with the wikitext markup ''' '''.

div

  • For complex formatting, it can be necessary to wrap the text in a <div> tag to override margins and line heights. div is the only named parameter and can take any additional CSS formatting. The following two lines do the same:
    • {{font|a9|Example|css=line-height:0.9em;}}
    • <div style="line-height:0.9em;">{{font|a9|Example}}</div>

Examples

No text:

  • {{font|Rajdhani}}Rajdhani

Text:

  • {{font|a9|Hello, world!}}Hello, world!

Text color:

  • {{font|a9|Hello, world!|a9highlight}}Hello, world!
  • If you only want to change the text color, use {{Color}} instead:
    {{font||Hello, world!|a9highlight}}
    = {{color|Hello, world!|a9highlight}}Hello, world!

Font size:

  • {{font|a9|Hello, world!||160%}}Hello, world!
  • As the Asphalt fonts are smaller than standard text, their default font size has been changed so that they have roughly the same size as standard text. If you want to display smaller or bigger text, you have to consider that the default font size is not 100 %, but:

Background color:

  • {{font|a9|Hello, world!|||a9highlight}}Hello, world!
  • If you only want to change the background color, use {{Background color}} instead:
    {{font||Hello, world!|||a9highlight}}
    = {{background color|a9highlight|Hello, world!}}Hello, world!

Text and background color:

  • {{font|a9|Hello, world!|black||a9highlight}}Hello, world!
  • The template can also be used to combine {{Color}} and {{Background color}} without setting a font:
    {{font||Hello, world!|black||a9highlight}}
    = {{color|black|{{background color|a9highlight|Hello, world!}}}}Hello, world!

Font weight:

  • {{font|a9|Hello, world!||||normal}}Hello, world!
    = {{font|a9|Hello, world!||||400}}
    = {{font|a9|Hello, world!}}
  • {{font|a9|Hello, world!||||medium}}Hello, world!
    = {{font|a9|Hello, world!||||500}}
  • {{font|a9|Hello, world!||||semi-bold}}Hello, world!
    = {{font|a9|Hello, world!||||600}}
  • {{font|a9|Hello, world!||||bold}}Hello, world!
    = {{font|a9|Hello, world!||||700}}
    = '''{{font|a9|Hello, world!}}'''

Combinations:

  • {{font|a8|Beat a Race Time of {{color|a8highlight|01:19:000}}||100%}}
    Beat a Race Time of 01:19:000
  • {{font|a8|RANK {{color|#00bafe|1605}} / 1653||150%}}
    RANK 1605 / 1653
  • {{font|a8-race|This is a car, not a submarine!|#ff3a18|180%}}
    This is a car, not a submarine!
  • {{font|a8-race|CITY HAVOC|a8highlight|100%}}
    CITY HAVOC
  • {{font|a9|&nbsp;DAILY&nbsp;||130%|bg a9|semi-bold}}{{font|a9|CAR LOOT&nbsp;||130%|bg a9}}
     DAILY CAR LOOT 
  • {{font|a9|{{color|a9green|FEATURED}} REWARDS||1.2em||semi-bold}}
    FEATURED REWARDS
  • Complex formatting with div parameter:
    {{font|a9|&nbsp;NEW CAR UNLOCKED&nbsp;||130%|a9highlight|semi-bold|div=margin-bottom:0.8em;}}
    {{font|a9|CONGRATULATIONS!||140%||semi-bold|div=line-height:1.1em;}}
    {{font|a9|YOU HAVE UNLOCKED||105%|div=line-height:0.9em;}}
    {{font|a9|A NEW CAR!||105%|div=line-height:0.9em;}}


    gives:
 NEW CAR UNLOCKED 
CONGRATULATIONS!
YOU HAVE UNLOCKED
A NEW CAR!

See also

  • {{A8common}}, the short version for the Asphalt 8 common color
  • {{A8rare}}, the short version for the Asphalt 8 rare color
  • {{A8legendary}}, the short version for the Asphalt 8 legendary color
  • {{A9uncommon}}, the short version for the Asphalt 9 uncommon color
  • {{A9rare}}, the short version for the Asphalt 9 rare color
  • {{A9epic}}, the short version for the Asphalt 9 epic color
  • {{Color}}, the main template called by all text color templates
  • {{Color code}}, the container template for Asphalt-specific color definitions
  • {{Background color}}, sets the background color only
  • {{Font}}, can set font face, text color and background color
Community content is available under CC-BY-SA unless otherwise noted.