diff --git a/uppbox/FontMaps/FontMaps.upp b/uppbox/FontMaps/FontMaps.upp new file mode 100644 index 000000000..5872304d3 --- /dev/null +++ b/uppbox/FontMaps/FontMaps.upp @@ -0,0 +1,9 @@ +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/uppbox/FontMaps/init b/uppbox/FontMaps/init new file mode 100644 index 000000000..042cf32e3 --- /dev/null +++ b/uppbox/FontMaps/init @@ -0,0 +1,4 @@ +#ifndef _FontMaps_icpp_init_stub +#define _FontMaps_icpp_init_stub +#include "CtrlLib/init" +#endif diff --git a/uppbox/FontMaps/main.cpp b/uppbox/FontMaps/main.cpp new file mode 100644 index 000000000..7f594f6c1 --- /dev/null +++ b/uppbox/FontMaps/main.cpp @@ -0,0 +1,33 @@ +#include + +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"); +}