os_font


Font change characteristics for enclosed text.

An os_font defines font change characteristics for its enclosed text. Characteristics include size, color, and typeface.

When specified through the absolute_size() and relative_size() member functions, the specified size value is rounded to fit the appropriate range.

Declaration

#include <ospace/web/font.h>
class os_font : public os_element_group

Enums

enum os_font::size_type
  {
  relative,  // Font size is relative to the base font of the page.
  absolute   // Font size is absolute.
  };

Interface

Constructor
os_font( int size , size_type sz_type )
Constructs a font change with size size and size type sz_type (default relative ).
Constructor
os_font( const string& color )
Constructs a font change with color color .
Constructor
os_font( int size , const string& color , size_type sz_type )
Constructs a font change with size size , size type sz_type (default relative ), and color color.
absolute_size
os_font& absolute_size( int size )
Sets the size to absolute size size and returns a reference to the font change.
clone
/* virtual */ os_element* clone() const
Returns a base class pointer to a heap-based deep copy of the font change.
color
string color() const
Returns the font color, or the empty string if the color is not set.
color
os_font& color( const string& color )
Sets the color to color and returns a reference to the font change.
face
os_font& face( const string& face )
Sets the typeface to face and returns a reference to the font change.
face
string face() const
Returns the font typeface, or the empty string if the typeface is not set.
is_absolute_size
bool is_absolute_size( int& size ) const
Returns true if the size is absolute and sets size to the absolute font size.
is_relative_size
bool is_relative_size( int& size ) const
Returns true if the size is relative and sets size to the relative font size.
relative_size
os_font& relative_size( int size )
Sets the size to relative size size and returns a reference to the font change.
size
string size() const
Returns size as a string. A leading + or - indicates a relative size.
size
os_font& size( int size , size_type sz_type )
Sets the size size and size type to sz_type , and returns a reference to the font change.

Copyright©1994-2026 Recursion Software LLC
All Rights Reserved