Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
48
Src/Wasabi/api/skin/skinfont.cpp
Normal file
48
Src/Wasabi/api/skin/skinfont.cpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
#include <precomp.h>
|
||||
|
||||
#include "skinfont.h"
|
||||
|
||||
#include <bfc/wasabi_std.h>
|
||||
|
||||
SkinFont::SkinFont()
|
||||
{}
|
||||
|
||||
SkinFont::~SkinFont()
|
||||
{
|
||||
if (!tempFn.isempty())
|
||||
{
|
||||
#ifdef WIN32
|
||||
RemoveFontResourceW(tempFn);
|
||||
#else
|
||||
DebugString( "portme -- SkinFont::~SkinFont\n" );
|
||||
#endif
|
||||
UNLINK(tempFn);
|
||||
}
|
||||
}
|
||||
|
||||
int SkinFont::setXmlOption(const wchar_t *paramname, const wchar_t *strvalue)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SkinFont::installFont(const wchar_t *filename, const wchar_t *path)
|
||||
{
|
||||
OSFILETYPE in, out;
|
||||
StringPathCombine temp(path, filename);
|
||||
in = WFOPEN(temp, WF_READONLY_BINARY);
|
||||
if (in == OPEN_FAILED) return ;
|
||||
int len = (int)FGETSIZE(in);
|
||||
MemBlock<char> m(len);
|
||||
FREAD(m.getMemory(), len, 1, in);
|
||||
tempFn = TMPNAM(NULL);
|
||||
out = WFOPEN(tempFn, WF_WRITE_BINARY);
|
||||
ASSERT(out != OPEN_FAILED);
|
||||
FWRITE(m.getMemory(), len, 1, out);
|
||||
FCLOSE(out);
|
||||
FCLOSE(in);
|
||||
#ifdef WIN32
|
||||
AddFontResourceW(tempFn);
|
||||
#else
|
||||
DebugString( "portme -- SkinFont::installFont\n" );
|
||||
#endif
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue