mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 16:03:24 +00:00
GRAPHICS: Add a DPI parameter to loadTTFFont.
Will be used by WME.
This commit is contained in:
parent
5521261fde
commit
b4196e48b1
@ -101,7 +101,7 @@ public:
|
||||
TTFFont();
|
||||
virtual ~TTFFont();
|
||||
|
||||
bool load(Common::SeekableReadStream &stream, int size, bool monochrome, const uint32 *mapping);
|
||||
bool load(Common::SeekableReadStream &stream, int size, uint dpi, bool monochrome, const uint32 *mapping);
|
||||
|
||||
virtual int getFontHeight() const;
|
||||
|
||||
@ -157,7 +157,7 @@ TTFFont::~TTFFont() {
|
||||
}
|
||||
}
|
||||
|
||||
bool TTFFont::load(Common::SeekableReadStream &stream, int size, bool monochrome, const uint32 *mapping) {
|
||||
bool TTFFont::load(Common::SeekableReadStream &stream, int size, uint dpi, bool monochrome, const uint32 *mapping) {
|
||||
if (!g_ttf.isInitialized())
|
||||
return false;
|
||||
|
||||
@ -195,7 +195,7 @@ bool TTFFont::load(Common::SeekableReadStream &stream, int size, bool monochrome
|
||||
// Check whether we have kerning support
|
||||
_hasKerning = (FT_HAS_KERNING(_face) != 0);
|
||||
|
||||
if (FT_Set_Char_Size(_face, 0, size * 64, 0, 0)) {
|
||||
if (FT_Set_Char_Size(_face, 0, size * 64, dpi, dpi)) {
|
||||
delete[] _ttfFile;
|
||||
_ttfFile = 0;
|
||||
|
||||
@ -462,10 +462,10 @@ bool TTFFont::cacheGlyph(Glyph &glyph, FT_UInt &slot, uint chr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Font *loadTTFFont(Common::SeekableReadStream &stream, int size, bool monochrome, const uint32 *mapping) {
|
||||
Font *loadTTFFont(Common::SeekableReadStream &stream, int size, uint dpi, bool monochrome, const uint32 *mapping) {
|
||||
TTFFont *font = new TTFFont();
|
||||
|
||||
if (!font->load(stream, size, monochrome, mapping)) {
|
||||
if (!font->load(stream, size, dpi, monochrome, mapping)) {
|
||||
delete font;
|
||||
return 0;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@
|
||||
namespace Graphics {
|
||||
|
||||
class Font;
|
||||
Font *loadTTFFont(Common::SeekableReadStream &stream, int size, bool monochrome = false, const uint32 *mapping = 0);
|
||||
Font *loadTTFFont(Common::SeekableReadStream &stream, int size, uint dpi = 0, bool monochrome = false, const uint32 *mapping = 0);
|
||||
|
||||
void shutdownTTF();
|
||||
|
||||
|
@ -1422,7 +1422,7 @@ const Graphics::Font *ThemeEngine::loadScalableFont(const Common::String &filena
|
||||
for (Common::ArchiveMemberList::const_iterator i = members.begin(), end = members.end(); i != end; ++i) {
|
||||
Common::SeekableReadStream *stream = (*i)->createReadStream();
|
||||
if (stream) {
|
||||
font = Graphics::loadTTFFont(*stream, pointsize, false,
|
||||
font = Graphics::loadTTFFont(*stream, pointsize, 0, false,
|
||||
#ifdef USE_TRANSLATION
|
||||
TransMan.getCharsetMapping()
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user