ultimatepp/uppdev/FontMetrics/main.cpp
cxl 97c1f2fdb8 minor repository reorganization: obsolete directories moved to archive
git-svn-id: svn://ultimatepp.org/upp/trunk@1997 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2010-02-01 08:24:43 +00:00

46 lines
913 B
C++

#include <CtrlLib/CtrlLib.h>
using namespace Upp;
const char *font[] = {
"sans-serif",
"Arial",
"Arial Unicode MS",
"MS UI Gothic",
"MS Mincho",
"Arial",
"AlArabiya"
"FreeSerif",
"Kochi Mincho",
"Kochi Gothic",
"Sazanami Mincho",
"Sazanami Gothic",
"Gulim",
"SimSun",
"PMingLiU",
"Symbol",
};
GUI_APP_MAIN
{
LOG("struct...");
for(int i = 0; i < __countof(font); i++) {
Font fnt;
fnt.FaceName(font[i]);
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(font[i]) << ", 0x" << FormatIntHex(l) << ", 0x" << FormatIntHex(h) << ',');
}
}