Enable typesetting capabilities with CSS font properties such as font face, size, weight, and color of text
Compatibile con DokuWiki
Enable typesetting capabilities with CSS font properties such as font face, size, weight, and color of text
Simile a fontcolor, fontfamily, fontsize2, wrap
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
Typography plugin extends DokuWiki markup by typesetting abilities. The <typo>
markup tag specifies CSS font properties such as font face, size, weight, and color of text.
The parameter consists of CSS property-value pairs (property: value;
), each pair must be separated by semicolon (;
) however last one may be omitted. You can use abbreviated short name instead of full property name.
Some specific short name are also available as markup tag; <ff>
(font familiy/name), <fs>
(size), <fc>
(color), <bg>
(background-color), <fw>
(weight). Typography plugin fully replaces: fontfamily, fontsize2, and fontcolor.
short name | css property name | description |
---|---|---|
fc | color | color of text |
bg | background-color | background color of text |
fs | font-size | font size of text (large or small) |
fw | font-weight | weight of a font (thick or thin characters in text) |
fv | font-variant | display text in a small-caps font |
ff | font-family | font family for text, must be single quoted if a font name contains white-space and non-ASCII characters |
lh | line-height | space between the lines |
ls | letter-spacing | an extra space between characters (in px, em, etc) |
ws | word-spacing | an additional space between words (in px, em, etc) |
sp | white-space | specifies how white-space is handled (preserve or collapse) |
va | vertical-align | sets the vertical alignment |
- | text-transform | controls the capitalization of text (capitalize, uppercase or lowercase) |
- | text-shadow | adds shadow to text |
wf | (web-font) | specify a web font class which prefixed “wf-” |
Sometimes, inline styles are necessary when you are building a page by hand. You should however avoid them whenever possible for “semantic markup”, better maintainability, and reusability. The wrap plugin will provide most powerful and flexible method for specifying a class attribute.
Typography plugin provides short name (or single property) syntax those are compatible with fontfamily, fontcolor, and fontsize2. If you have enabled these three plugin, the short syntax are treated by relevant plugins instead of this plugin. These short syntax are available through toolbar icons: .
Single parameter example:
<typo font-size:large;>Large</typo>, <typo fs:x-large>Very large</typo>, <fs:xx-large>Huge</fs>, and <fs smaller>smaller</fs> size text
Multiple parameter example:
<typo fs:larger; fw:bold; ff:serif>Bold serif</typo>, <fs:large; fv:small-caps>Small-caps</fs> text
Nesting syntax:
<ff:'Georgia', 'MS Serif', serif><fs:36px; lh:1.1> There is nothing either good or bad, \\ but thinking makes it so. </fs>\\ <fs:smaller;>//-- William Shakespeare, “Hamlet”, Act 2 scene 2//</fs></ff>
Using Web font
For getting started with the Google Fonts API, you may add a stylesheet link to request the desired web font(s) in conf/meta.html file, for example:
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Tangerine"> <style> .wf-tangerine { font-family: Tangerine, serif; } </style>
Then you can use the font name (eg. Tangerine) in the font-family value:
<ff Tangerine; fs:48px>Making the Web Beautiful!</ff> <wf:tangerine; fs:48px>Making the Web Beautiful!</wf>
Starting with release 2014-10-13 this plugin also supports ODT export (Open Document Text format). On the left side you see a screenshot taken from a typography test page opened in a browser, on the right side you see the page exported to ODT:
As you might see there are currently some limitations regarding the ODT export:
Note: The ODT export feature of typography plugin requires PHP 5 >= 5.3.0
Typography plugin for DokuWiki was initially developed by Paweł Piekarski, original version (v0.1101 / 2011-01-18) is still available from http://treecode.pl/typography.html .
Since 2014-07-28, the plugin code has moved to github repository to provide better accessibility for install and further development opportunity. Thanks Paweł for your early work and encouraging me to move the code to github. — s.sahara 2014-07-28 14:57
The ODT renderer feature is contribution from Lars (LarsDW223).
fw:
(font-weight) and sp:
(white-space) parameters<typo fw:900;>Heavy text</typo>
//if ($isSameHost && $isColorSet) { // }