GRAPHICS: Support loading a Windows font from an existing stream
This commit is contained in:
parent
9a22f1b913
commit
f6eeae4736
2 changed files with 11 additions and 0 deletions
|
@ -86,6 +86,16 @@ bool WinFont::loadFromFON(const Common::String &fileName, const WinFontDirEntry
|
|||
return ok;
|
||||
}
|
||||
|
||||
bool WinFont::loadFromFON(Common::SeekableReadStream &stream, const WinFontDirEntry &dirEntry) {
|
||||
Common::WinResources *exe = Common::WinResources::createFromEXE(&stream);
|
||||
if (!exe)
|
||||
return false;
|
||||
|
||||
bool ok = loadFromEXE(exe, Common::String("stream"), dirEntry);
|
||||
delete exe;
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool WinFont::loadFromEXE(Common::WinResources *exe, const Common::String &fileName, const WinFontDirEntry &dirEntry) {
|
||||
// Let's pull out the font directory
|
||||
Common::SeekableReadStream *fontDirectory = exe->getResource(Common::kWinFontDir, Common::String("FONTDIR"));
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
* If dirEntry is not given, the first font in the FONTDIR will be loaded
|
||||
*/
|
||||
bool loadFromFON(const Common::String &fileName, const WinFontDirEntry &dirEntry = WinFontDirEntry());
|
||||
bool loadFromFON(Common::SeekableReadStream &stream, const WinFontDirEntry &dirEntry = WinFontDirEntry());
|
||||
|
||||
/** Open a font from an FNT file */
|
||||
bool loadFromFNT(const Common::String &fileName);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue