pleyo.com

WKAL::Font Class Reference

List of all members.

Public Types

enum  CodePath { Auto, Simple, Complex }

Public Member Functions

 Font ()
 Font default constructor.
 Font (const FontDescription &, short letterSpacing, short wordSpacing)
 Font constructor.
 Font (const FontPlatformData &, bool isPrinting)
 Font constructor This constructor is only used if the platform wants to start with a native font.
 ~Font ()
 ~Font destructor
 Font (const Font &)
 Font constructor by copy.
Fontoperator= (const Font &)
 operator=
bool operator== (const Font &other) const
 operator==
bool operator!= (const Font &other) const
 operator!=
const FontDescriptionfontDescription () const
 get fontDescription
int pixelSize () const
 get font pixel size
float size () const
 get font size
void update (PassRefPtr< FontSelector >) const
 update font
void drawText (GraphicsContext *, const TextRun &, const FloatPoint &, int from=0, int to=-1) const
 draw text
int width (const TextRun &) const
 return font width
float floatWidth (const TextRun &) const
 return float width
float floatWidth (const TextRun &run, int extraCharsAvailable, int &charsConsumed, String &glyphName) const
 return float width
int offsetForPosition (const TextRun &, int position, bool includePartialGlyphs) const
 get offset for position
FloatRect selectionRectForText (const TextRun &, const IntPoint &, int h, int from=0, int to=-1) const
 get selection for text
bool isSmallCaps () const
 get small caps value
short wordSpacing () const
 get word spacing value
short letterSpacing () const
 get letter spacing value
void setWordSpacing (short s)
 set word spacing value
void setLetterSpacing (short s)
 set letter spacing value
bool isFixedPitch () const
 test if the pitch is fixed
bool isPrinterFont () const
 test if the font is printer
FontRenderingMode renderingMode () const
 get the font rendering mode
FontFamilyfirstFamily ()
 get first font family
const FontFamilyfamily () const
 get font family
bool italic () const
 get the italic status
FontWeight weight () const
 get the font weight
bool isPlatformFont () const
 get it's a platform font
int ascent () const
 get ascent value
int descent () const
 get descent value
int height () const
 get height value
int lineSpacing () const
 get lineSpacing value
float xHeight () const
 get xHeight value
unsigned unitsPerEm () const
 get unitsPerEm value
int spaceWidth () const
 get spaceWidth value
int tabWidth () const
 get tabWidth value
const SimpleFontDataprimaryFont () const
 get primary font value
const FontDatafontDataAt (unsigned) const
 get fontData value at position
const GlyphDataglyphDataForCharacter (UChar32, bool mirror, bool forceSmallCaps=false) const
 get glyph data for a character
const FontDatafontDataForCharacters (const UChar *, int length) const
 get font data for a characters
FontSelectorfontSelector () const
 get fontSelector

Static Public Member Functions

static void setCodePath (CodePath)
 set code path
static bool isRoundingHackCharacter (UChar32 c)
 get is rounding hack character
static bool treatAsSpace (UChar c)
 test if font treat character as space
static bool treatAsZeroWidthSpace (UChar c)
 test if font treat character as zero width space

Static Public Attributes

static CodePath codePath
static const uint8_t gRoundingHackCharacterTable [256]

Friends

struct WidthIterator


Member Enumeration Documentation

Enumerator:
Auto 
Simple 
Complex 


Constructor & Destructor Documentation

WKAL::Font::Font (  ) 

Font default constructor.

 Font *f = new Font();

WKAL::Font::Font ( const FontDescription ,
short  letterSpacing,
short  wordSpacing 
)

Font constructor.

Parameters:
[in] : FontDescription
[in] : letter spacing
[in] : word spacing
 Font *f = new Font(fd, 12, 12 );

WKAL::Font::Font ( const FontPlatformData ,
bool  isPrinting 
)

Font constructor This constructor is only used if the platform wants to start with a native font.

Parameters:
[in] : FontPlatformData&
[in] : printing value
 Font *f = new Font(fpd, false);

WKAL::Font::~Font (  ) 

~Font destructor

 delete font;

WKAL::Font::Font ( const Font  ) 

Font constructor by copy.

Parameters:
[in] : Font
 Font *f = new Font(currentFont);


Member Function Documentation

Font& WKAL::Font::operator= ( const Font  ) 

operator=

Parameters:
[in] : Font
[out] : Font
 Font f = currentFont;

bool WKAL::Font::operator== ( const Font other  )  const

operator==

Parameters:
[in] : Font
[out] : return false if the fonts are different
 bool eq = f == currentFont;

bool WKAL::Font::operator!= ( const Font other  )  const

operator!=

Parameters:
[in] : Font
[out] : return true if the fonts are different
 bool d = f != currentFont;

const FontDescription& WKAL::Font::fontDescription (  )  const

get fontDescription

Parameters:
[out] : FontDescription&
 FontDescription& fd = f->fontDescription();

int WKAL::Font::pixelSize (  )  const

get font pixel size

Parameters:
[out] : pixel size
 int ps = f->pixelSize();

float WKAL::Font::size (  )  const

get font size

Parameters:
[out] : font size
 int s = f->size();

void WKAL::Font::update ( PassRefPtr< FontSelector  )  const

update font

Parameters:
[in] : FontSelector
 f->update(fontSelector);

void WKAL::Font::drawText ( GraphicsContext ,
const TextRun ,
const FloatPoint ,
int  from = 0,
int  to = -1 
) const

draw text

Parameters:
[in] : context graphic
[in] : text
[in] : start point
[in] : start glyph range
[in] : end glyph range
 f->drawText(cg, text, FloatPoint(0,0));

int WKAL::Font::width ( const TextRun  )  const

return font width

Parameters:
[in] : TextRun
[out] : width
 int w = f->width(textRun);

float WKAL::Font::floatWidth ( const TextRun  )  const

return float width

Parameters:
[in] : TextRun
[out] : float width
 float w = f->floatWidth(textRun);

float WKAL::Font::floatWidth ( const TextRun run,
int  extraCharsAvailable,
int &  charsConsumed,
String &  glyphName 
) const

return float width

Parameters:
[in] : TextRun
[in] : extra chars available
[in] : chars consumed
[in] : glyph name
[out] : float width
 float w = f->floatWidth(textRun, 0, chars, name);

int WKAL::Font::offsetForPosition ( const TextRun ,
int  position,
bool  includePartialGlyphs 
) const

get offset for position

Parameters:
[in] : TextRun
[in] : position
[in] : include partial glyphs
[out] : position
 int pos = f->offsetForPosition(textRun, 0, false);

FloatRect WKAL::Font::selectionRectForText ( const TextRun ,
const IntPoint ,
int  h,
int  from = 0,
int  to = -1 
) const

get selection for text

Parameters:
[in] : TextRun
[in] : start point
[in] : height
[in] : start glyph range
[in] : end glyph range
[out] : float rect
 FloatRect f = f->selectionRectForText(textRun, IntPoint(0,0), 18);

bool WKAL::Font::isSmallCaps (  )  const

get small caps value

Parameters:
[out] : small caps value
 bool sc = f->isSmallCaps();

short WKAL::Font::wordSpacing (  )  const

get word spacing value

Parameters:
[out] : word spacing value
 short ws = f->wordSpacing();

short WKAL::Font::letterSpacing (  )  const

get letter spacing value

Parameters:
[out] : letter spacing value
 short ls = f->letterSpacing();

void WKAL::Font::setWordSpacing ( short  s  ) 

set word spacing value

Parameters:
[in] : word spacing value
 f->setWordSpacing(12);

void WKAL::Font::setLetterSpacing ( short  s  ) 

set letter spacing value

Parameters:
[in] : letter spacing value
 f->setLetterSpacing(12);

bool WKAL::Font::isFixedPitch (  )  const

test if the pitch is fixed

Parameters:
[out] : true if the pitch is fixed
 bool fp = f->isFixedPitch();

bool WKAL::Font::isPrinterFont (  )  const

test if the font is printer

Parameters:
[out] : true if the font is printer
 bool pf = f->isPrinterFont();

FontRenderingMode WKAL::Font::renderingMode (  )  const

get the font rendering mode

Parameters:
[out] : font rendering mode
 FontRenderingMode frm = f->renderingMode();

FontFamily& WKAL::Font::firstFamily (  ) 

get first font family

Parameters:
[out] : font family
 FontFamily ff = f->firstFamily();

const FontFamily& WKAL::Font::family (  )  const

get font family

Parameters:
[out] : font family
 FontFamily ff = f->family();

bool WKAL::Font::italic (  )  const

get the italic status

Parameters:
[out] : italic status
 bool it = f->italic();

FontWeight WKAL::Font::weight (  )  const

get the font weight

Parameters:
[out] : font weight
 FontWeight fw = f->weight();

bool WKAL::Font::isPlatformFont (  )  const

get it's a platform font

Parameters:
[out] : true if it's a platform font
 bool pf = f->isPlatformFont();

int WKAL::Font::ascent (  )  const

get ascent value

Parameters:
[out] : ascent value
 int a = f->ascent();

int WKAL::Font::descent (  )  const

get descent value

Parameters:
[out] : descent value
 int d = f->descent();

int WKAL::Font::height (  )  const

get height value

Parameters:
[out] : height value
 int h = f->height();

int WKAL::Font::lineSpacing (  )  const

get lineSpacing value

Parameters:
[out] : lineSpacing value
 int ls = f->lineSpacing();

float WKAL::Font::xHeight (  )  const

get xHeight value

Parameters:
[out] : xHeight value
 float x = f->xHeight();

unsigned WKAL::Font::unitsPerEm (  )  const

get unitsPerEm value

Parameters:
[out] : untiPerEm value
 unsigned u = f->unitsPerEm();

int WKAL::Font::spaceWidth (  )  const

get spaceWidth value

Parameters:
[out] : spaceWidth value
 int sw = f->spaceWidth();

int WKAL::Font::tabWidth (  )  const

get tabWidth value

Parameters:
[out] : tabWidth value
 int tw = f->tabWidth();

const SimpleFontData* WKAL::Font::primaryFont (  )  const

get primary font value

Parameters:
[out] : primary font
 SimpleFontData *sfd = f->primaryFont();

const FontData* WKAL::Font::fontDataAt ( unsigned   )  const

get fontData value at position

Parameters:
[in] : position value
[out] : font data
 FontData *fd = f->fontDataAt(0);

const GlyphData& WKAL::Font::glyphDataForCharacter ( UChar32  ,
bool  mirror,
bool  forceSmallCaps = false 
) const

get glyph data for a character

Parameters:
[in] : character
[in] : mirror
[in] : force small caps
[out] : glyph data
 GlyphData gd = f->glyphDataForCharacter(c, false);

const FontData* WKAL::Font::fontDataForCharacters ( const UChar *  ,
int  length 
) const

get font data for a characters

Parameters:
[in] : characters
[in] : length
[out] : font data
 FontData *fd = f->fontDataForCharacters(c, 12);

static void WKAL::Font::setCodePath ( CodePath   )  [static]

set code path

Parameters:
[in] : code path
 f->setCodePath(Auto);

static bool WKAL::Font::isRoundingHackCharacter ( UChar32  c  )  [static]

get is rounding hack character

Parameters:
[in] : character
[out] : true or false
 bool r = f->isRoundingHackCharacter(c);

FontSelector* WKAL::Font::fontSelector (  )  const

get fontSelector

Parameters:
[out] : font selector
 FontSelector *fs = f->fontSelector();

static bool WKAL::Font::treatAsSpace ( UChar  c  )  [static]

test if font treat character as space

Parameters:
[in] : character
[out] : true or false
 bool t = f->treatAsSpace(c);

static bool WKAL::Font::treatAsZeroWidthSpace ( UChar  c  )  [static]

test if font treat character as zero width space

Parameters:
[in] : character
[out] : true or false
 bool t = f->treatAsZeroWidthSpace(c);


Friends And Related Function Documentation

friend struct WidthIterator [friend]


Member Data Documentation

const uint8_t WKAL::Font::gRoundingHackCharacterTable[256] [static]


The documentation for this class was generated from the following file:

Generated on Mon Jun 30 16:22:07 2008 for Origyn Web Browser by Doxygen 1.5.5

pleyo.com
pleyo.com