mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-01 05:11:09 +00:00
GRAPHICS: Expose Font leading and descent values
The leading value in Macintosh fonts is the space between lines, defined as the space between a descent line and the ascent line below it. Clients need this to draw text and calculate its height as classic Macintosh did.
This commit is contained in:
parent
2775987cba
commit
b578f5be7b
@ -31,6 +31,14 @@ int Font::getFontAscent() const {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int Font::getFontDescent() const {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int Font::getFontLeading() const {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int Font::getKerningOffset(uint32 left, uint32 right) const {
|
||||
return 0;
|
||||
}
|
||||
|
@ -104,6 +104,24 @@ public:
|
||||
*/
|
||||
virtual int getFontAscent() const;
|
||||
|
||||
/**
|
||||
* Return the descent of the font.
|
||||
*
|
||||
* @return Font descent in pixels. If it is unknown
|
||||
* a value of -1 is returned.
|
||||
*/
|
||||
virtual int getFontDescent() const;
|
||||
|
||||
/**
|
||||
* Return the leading of the font.
|
||||
* This is the distance between the descent line
|
||||
* and the ascent line below it.
|
||||
*
|
||||
* @return Font leading in pixels. If it is unknown
|
||||
* a value of -1 is returned.
|
||||
*/
|
||||
virtual int getFontLeading() const;
|
||||
|
||||
/**
|
||||
* Return the maximum width of the font.
|
||||
*
|
||||
|
@ -170,6 +170,8 @@ public:
|
||||
|
||||
virtual int getFontHeight() const { return _data._fRectHeight; }
|
||||
virtual int getFontAscent() const { return _data._ascent; }
|
||||
virtual int getFontDescent() const { return _data._descent; }
|
||||
virtual int getFontLeading() const { return _data._leading; }
|
||||
virtual int getMaxCharWidth() const { return _data._maxWidth; }
|
||||
virtual int getCharWidth(uint32 chr) const;
|
||||
virtual void drawChar(Surface *dst, uint32 chr, int x, int y, uint32 color) const;
|
||||
|
Loading…
Reference in New Issue
Block a user