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. | |
| Font & | operator= (const Font &) |
| operator= | |
| bool | operator== (const Font &other) const |
| operator== | |
| bool | operator!= (const Font &other) const |
| operator!= | |
| const FontDescription & | fontDescription () 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 | |
| FontFamily & | firstFamily () |
| get first font family | |
| const FontFamily & | family () 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 SimpleFontData * | primaryFont () const |
| get primary font value | |
| const FontData * | fontDataAt (unsigned) const |
| get fontData value at position | |
| const GlyphData & | glyphDataForCharacter (UChar32, bool mirror, bool forceSmallCaps=false) const |
| get glyph data for a character | |
| const FontData * | fontDataForCharacters (const UChar *, int length) const |
| get font data for a characters | |
| FontSelector * | fontSelector () 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 |
| enum WKAL::Font::CodePath |
| WKAL::Font::Font | ( | const FontDescription & | , | |
| short | letterSpacing, | |||
| short | wordSpacing | |||
| ) |
| WKAL::Font::Font | ( | const FontPlatformData & | , | |
| bool | isPrinting | |||
| ) |
Font constructor This constructor is only used if the platform wants to start with a native font.
| [in] | : | FontPlatformData& |
| [in] | : | printing value |
| WKAL::Font::~Font | ( | ) |
~Font destructor
delete font;
| WKAL::Font::Font | ( | const Font & | ) |
| bool WKAL::Font::operator== | ( | const Font & | other | ) | const |
operator==
| [in] | : | Font |
| [out] | : | return false if the fonts are different bool eq = f == currentFont;
|
| bool WKAL::Font::operator!= | ( | const Font & | other | ) | const |
operator!=
| [in] | : | Font |
| [out] | : | return true if the fonts are different bool d = f != currentFont;
|
| const FontDescription& WKAL::Font::fontDescription | ( | ) | const |
get fontDescription
| [out] | : | FontDescription& FontDescription& fd = f->fontDescription(); |
| int WKAL::Font::pixelSize | ( | ) | const |
get font pixel size
| [out] | : | pixel size int ps = f->pixelSize();
|
| float WKAL::Font::size | ( | ) | const |
get font size
| [out] | : | font size int s = f->size();
|
| void WKAL::Font::update | ( | PassRefPtr< FontSelector > | ) | const |
| void WKAL::Font::drawText | ( | GraphicsContext * | , | |
| const TextRun & | , | |||
| const FloatPoint & | , | |||
| int | from = 0, |
|||
| int | to = -1 | |||
| ) | const |
draw text
| [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 |
| float WKAL::Font::floatWidth | ( | const TextRun & | ) | const |
| float WKAL::Font::floatWidth | ( | const TextRun & | run, | |
| int | extraCharsAvailable, | |||
| int & | charsConsumed, | |||
| String & | glyphName | |||
| ) | const |
return float width
| [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
| [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
| [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
| [out] | : | small caps value bool sc = f->isSmallCaps();
|
| short WKAL::Font::wordSpacing | ( | ) | const |
get word spacing value
| [out] | : | word spacing value short ws = f->wordSpacing();
|
| short WKAL::Font::letterSpacing | ( | ) | const |
get letter spacing value
| [out] | : | letter spacing value short ls = f->letterSpacing();
|
| void WKAL::Font::setWordSpacing | ( | short | s | ) |
set word spacing value
| [in] | : | word spacing value f->setWordSpacing(12); |
| void WKAL::Font::setLetterSpacing | ( | short | s | ) |
set letter spacing value
| [in] | : | letter spacing value f->setLetterSpacing(12); |
| bool WKAL::Font::isFixedPitch | ( | ) | const |
test if the pitch is fixed
| [out] | : | true if the pitch is fixed bool fp = f->isFixedPitch();
|
| bool WKAL::Font::isPrinterFont | ( | ) | const |
test if the font is printer
| [out] | : | true if the font is printer bool pf = f->isPrinterFont();
|
| FontRenderingMode WKAL::Font::renderingMode | ( | ) | const |
get the font rendering mode
| [out] | : | font rendering mode FontRenderingMode frm = f->renderingMode(); |
| FontFamily& WKAL::Font::firstFamily | ( | ) |
get first font family
| [out] | : | font family FontFamily ff = f->firstFamily(); |
| const FontFamily& WKAL::Font::family | ( | ) | const |
get font family
| [out] | : | font family FontFamily ff = f->family(); |
| bool WKAL::Font::italic | ( | ) | const |
get the italic status
| [out] | : | italic status bool it = f->italic();
|
| FontWeight WKAL::Font::weight | ( | ) | const |
| bool WKAL::Font::isPlatformFont | ( | ) | const |
get it's a platform font
| [out] | : | true if it's a platform font bool pf = f->isPlatformFont();
|
| int WKAL::Font::ascent | ( | ) | const |
get ascent value
| [out] | : | ascent value int a = f->ascent();
|
| int WKAL::Font::descent | ( | ) | const |
get descent value
| [out] | : | descent value int d = f->descent();
|
| int WKAL::Font::height | ( | ) | const |
get height value
| [out] | : | height value int h = f->height();
|
| int WKAL::Font::lineSpacing | ( | ) | const |
get lineSpacing value
| [out] | : | lineSpacing value int ls = f->lineSpacing();
|
| float WKAL::Font::xHeight | ( | ) | const |
get xHeight value
| [out] | : | xHeight value float x = f->xHeight();
|
| unsigned WKAL::Font::unitsPerEm | ( | ) | const |
get unitsPerEm value
| [out] | : | untiPerEm value unsigned u = f->unitsPerEm();
|
| int WKAL::Font::spaceWidth | ( | ) | const |
get spaceWidth value
| [out] | : | spaceWidth value int sw = f->spaceWidth();
|
| int WKAL::Font::tabWidth | ( | ) | const |
get tabWidth value
| [out] | : | tabWidth value int tw = f->tabWidth();
|
| const SimpleFontData* WKAL::Font::primaryFont | ( | ) | const |
get primary font value
| [out] | : | primary font SimpleFontData *sfd = f->primaryFont(); |
| const FontData* WKAL::Font::fontDataAt | ( | unsigned | ) | const |
get fontData value at position
| [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
| [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
| [in] | : | characters |
| [in] | : | length |
| [out] | : | font data FontData *fd = f->fontDataForCharacters(c, 12); |
| static void WKAL::Font::setCodePath | ( | CodePath | ) | [static] |
| static bool WKAL::Font::isRoundingHackCharacter | ( | UChar32 | c | ) | [static] |
get is rounding hack character
| [in] | : | character |
| [out] | : | true or false bool r = f->isRoundingHackCharacter(c);
|
| FontSelector* WKAL::Font::fontSelector | ( | ) | const |
get fontSelector
| [out] | : | font selector FontSelector *fs = f->fontSelector(); |
| static bool WKAL::Font::treatAsSpace | ( | UChar | c | ) | [static] |
test if font treat character as space
| [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
| [in] | : | character |
| [out] | : | true or false bool t = f->treatAsZeroWidthSpace(c);
|
friend struct WidthIterator [friend] |
CodePath WKAL::Font::codePath [static] |
const uint8_t WKAL::Font::gRoundingHackCharacterTable[256] [static] |