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