Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 244 | chris | 1 | #include "Font.h" |
| 2 | #include "Image.h" |
||
| 3 | |||
| 4 | using namespace Sexy; |
||
| 5 | |||
| 6 | Font::Font() |
||
| 7 | { |
||
| 8 | mAscent = 0; |
||
| 9 | mHeight = 0; |
||
| 10 | mAscentPadding = 0; |
||
| 11 | mLineSpacingOffset = 0; |
||
| 12 | } |
||
| 13 | |||
| 14 | Font::Font(const Font& theFont) : |
||
| 15 | mAscent(theFont.mAscent), |
||
| 16 | mHeight(theFont.mHeight), |
||
| 17 | mAscentPadding(theFont.mAscentPadding), |
||
| 18 | mLineSpacingOffset(theFont.mLineSpacingOffset) |
||
| 19 | { |
||
| 20 | } |
||
| 21 | |||
| 22 | Font::~Font() |
||
| 23 | { |
||
| 24 | } |
||
| 25 | |||
| 26 | int Font::GetAscent() |
||
| 27 | { |
||
| 28 | return mAscent; |
||
| 29 | } |
||
| 30 | |||
| 31 | int Font::GetAscentPadding() |
||
| 32 | { |
||
| 33 | return mAscentPadding; |
||
| 34 | } |
||
| 35 | |||
| 36 | int Font::GetDescent() |
||
| 37 | { |
||
| 38 | return mHeight - mAscent; |
||
| 39 | } |
||
| 40 | |||
| 41 | int Font::GetHeight() |
||
| 42 | { |
||
| 43 | return mHeight; |
||
| 44 | } |
||
| 45 | |||
| 46 | int Font::GetLineSpacingOffset() |
||
| 47 | { |
||
| 48 | return mLineSpacingOffset; |
||
| 49 | } |
||
| 50 | |||
| 51 | int Font::GetLineSpacing() |
||
| 52 | { |
||
| 53 | return mHeight + mLineSpacingOffset; |
||
| 54 | } |
||
| 55 | |||
| 56 | int Font::StringWidth(const SexyString& theString) |
||
| 57 | { |
||
| 58 | return 0; |
||
| 59 | } |
||
| 60 | |||
| 61 | int Font::CharWidth(SexyChar theChar) |
||
| 62 | { |
||
| 63 | SexyString aString(1, theChar); |
||
| 64 | return StringWidth(aString); |
||
| 65 | } |
||
| 66 | |||
| 67 | int Font::CharWidthKern(SexyChar theChar, SexyChar thePrevChar) |
||
| 68 | { |
||
| 69 | return CharWidth(theChar); |
||
| 70 | } |
||
| 71 | |||
| 72 | void Font::DrawString(Graphics* g, int theX, int theY, const SexyString& theString, const Color& theColor, const Rect& theClipRect) |
||
| 73 | { |
||
| 74 | } |