Text Markup Functions
|
 |
The appearance of text, such as
bold or italic , can be controlled through a set of text
markup functions. If no markup functions are defined, the text appears according
to the defaults of the browser used to view the Web page.
All markup functions return an os_element_group
object. The effect of the function is applied to all contents of the object.
Each markup function is overloaded to provide the following forms.
os_element_group&
form1()
os_element_group&
form2( const os_element& element )
os_element_group&
form3( const string& text )
The initial contents of an os_element_group
object are determined by the form of the markup function called.
- Form 1-Returns an empty
os_element_group
object.
- Form 2-Returns an
os_element_group
object containing a copy of element .
- Form 3-Returns an
os_element_group
object containing an os_text object constructed
from text.
Additional elements can be added
to the os_element_group object returned, regardless
of the form of the markup function called.
There are two categories of
markup functions: physical and logical. Both are described in the following
sections.
Physical Markup Functions
Physical markup functions
define a specific typographic style that is applied to the contents of the
resulting os_element_group . Using physical
markup functions, every browser displays the contents in the same way.
The following table lists the
available physical markup functions and the effects they produce.
| Physical
Markup Function |
Effect |
|
os_big
|
Increases the size of the
contents with respect to the preceding text, if possible.
|
|
os_bold
|
Displays the contents in
bold font.
|
|
os_italic
|
Displays the contents in
italics.
|
|
os_small
|
Decreases the size of the
contents with respect to the preceding text, if possible.
|
|
os_strike
|
Adds a horizontal line
through each character of the contents.
|
|
os_subscript
|
Decreases the font size
of the contents with respect to the preceding text and changes it to
subscript, placing it below the current line.
|
|
os_superscript
|
Decreases the font size
of the contents with respect to the preceding text and changes it to
superscript, placing it above the current line.
|
|
os_typewriter
|
Displays the contents in
fixed-width font.
|
|
os_underline
|
Displays the contents
with an underline, where possible.
|
Logical Markup Functions
Logical markup functions assign
special meaning to a group of elements without defining a specific
typographical style. The typographical style is left to the browser and may be
presented differently with each browser, which may result in several different
logical markup functions being rendered the same.
The following table lists the
available logical markup functions and the effects they produce.
| Logical
Markup Function |
Effect |
Style
Definition |
|
os_abbrev
|
Describes the contents as
an abbreviation.
|
None
|
|
os_acronym
|
Describes the contents as
an acronym.
|
None
|
|
os_author
|
Describes the contents as
an author's name.
|
None
|
|
os_cite
|
Describes the contents as
a citation.
|
None
|
|
os_code
|
Describes the contents as
computer code and is intended for use with a small section of code up to
one line in length. Use os_preformatted for
larger sections of code.
|
Fixed-width font
|
|
os_define
|
Describes the contents as
the first instance of a term.
|
Italics; bold italics
|
|
os_delete
|
Describes the contents as
deleted text that has a logical purpose for deletion, such as text from
a legal document.
|
None
|
|
os_emphasis
|
Describes the contents as
emphasized text.
|
Italics
|
|
os_insert
|
Describes the contents as
inserted text.
|
None
|
|
os_keyboard
|
Describes the contents as
keyboard input.
|
Fixed-width font
|
|
os_person
|
Describes the contents as
the name of a person.
|
None
|
|
os_quote
|
Describes the contents as
a quote and is intended for use with a small quote up to one line in
length. Use os_blockquote for longer
quotes.
|
Surrounded by quotation
marks
|
|
os_sample
|
Describes the contents as
sample computer code.
|
Fixed-width font
|
|
os_strong
|
Describes the contents as
strong emphasis.
|
Bold
|
|
os_variable
|
Describes the contents as
a variable.
|
Italics; bold italics
|
Markup function calls can be
nested, which primarily is useful for physical markup. The following example
displays the text "Render this text" in bold italics. Web browsers
may interpret nesting differently, which may affect the final presentation of
the resulting os_element_group object.
os_bold(
os_italic( "Render this text " ) )
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved