ultimatepp/uppbox/FontMaps/main.cpp
cxl 5342d2c346 .uppbox: FontMaps
git-svn-id: svn://ultimatepp.org/upp/trunk@9159 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2015-11-07 09:01:50 +00:00

33 lines
776 B
C++

#include <CtrlLib/CtrlLib.h>
using namespace Upp;
GUI_APP_MAIN
{
Progress pi;
pi.SetTotal(Font::GetFaceCount());
for(int i = 0; i < Font::GetFaceCount(); i++) {
String f = Font::GetFaceName(i);
pi.SetText(f);
if(pi.StepCanceled())
break;
Font fnt;
fnt.FaceName(f);
dword l = 0;
for(int ch = 32; ch < 4096; ch++) {
if(GetGlyphInfo(fnt, ch).IsNormal()) {
l |= (0x80000000 >> (ch / 128));
ch = (ch + 127) & ~127;
}
}
dword h = 0;
for(int ch = 32; ch < 65536; ch++) {
if(GetGlyphInfo(fnt, ch).IsNormal()) {
h |= (0x80000000 >> (ch / 2048));
ch = (ch + 2047) & ~2047;
}
}
LOG("{ " << AsCString(f) << ", 0x" << FormatIntHex(l) << ", 0x" << FormatIntHex(h) << " },");
}
PromptOK("OK");
}