1. #include <windows.h>
  2. #include <stdio.h>
  3.  
  4. const char *subranges[] = {
  5. "Basic Latin",
  6. "Latin-1 Supplement",
  7. "Latin Extended-A",
  8. "Latin Extended-B",
  9. "IPA Extensions",
  10. "Spacing Modifier Letters",
  11. "Combining Diacritical Marks",
  12. "Greek and Coptic",
  13. "Coptic",
  14. "Cyrillic",
  15. "Armenian",
  16. "Hebrew",
  17. "Vai",
  18. "Arabic",
  19. "NKo",
  20. "Devanagari",
  21. "Bengali",
  22. "Gurmukhi",
  23. "Gujarati",
  24. "Oriya",
  25. "Tamil",
  26. "Telugu",
  27. "Kannada",
  28. "Malayalam",
  29. "Thai",
  30. "Lao",
  31. "Georgian",
  32. "Balinese",
  33. "Hangul Jamo",
  34. "Latin Extended Additional",
  35. "Greek Extended",
  36. "General Punctuation",
  37. "Superscripts And Subscripts",
  38. "Currency Symbols",
  39. "Combining Diacritical Marks For Symbols",
  40. "Letterlike Symbols",
  41. "Number Forms",
  42. "Arrows",
  43. "Mathematical Operators",
  44. "Miscellaneous Technical",
  45. "Control Pictures",
  46. "Optical Character Recognition",
  47. "Enclosed Alphanumerics",
  48. "Box Drawing",
  49. "Block Elements",
  50. "Geometric Shapes",
  51. "Miscellaneous Symbols",
  52. "Dingbats",
  53. "CJK Symbols And Punctuation",
  54. "Hiragana",
  55. "Katakana",
  56. "Bopomofo",
  57. "Hangul Compatibility Jamo",
  58. "Phags-pa",
  59. "Enclosed CJK Letters And Months",
  60. "CJK Compatibility",
  61. "Hangul Syllables",
  62. "Non-Plane 0. Note that setting this bit implies that there is at least one supplementary code point beyond the Basic Multilingual Plane (BMP) that is supported by this font. See Surrogates and Supplementary Characters.",
  63. "Phoenician",
  64. "CJK Radicals Supplement",
  65. "Private Use Area",
  66. "CJK Strokes",
  67. "Alphabetic Presentation Forms",
  68. "Arabic Presentation Forms-A",
  69. "Combining Half Marks",
  70. "Vertical Forms",
  71. "Small Form Variants",
  72. "Arabic Presentation Forms-B",
  73. "Halfwidth And Fullwidth Forms",
  74. "Specials",
  75. "Tibetan",
  76. "Syriac",
  77. "Thaana",
  78. "Sinhala",
  79. "Myanmar",
  80. "Ethiopic",
  81. "Cherokee",
  82. "Unified Canadian Aboriginal Syllabics",
  83. "Ogham",
  84. "Runic",
  85. "Khmer",
  86. "Mongolian",
  87. "Braille Patterns",
  88. "Yi Syllables",
  89. "Tagalog",
  90. "Old Italic",
  91. "Gothic",
  92. "Deseret",
  93. "Byzantine Musical Symbols",
  94. "Mathematical Alphanumeric Symbols",
  95. "Private Use (plane 15)",
  96. "Variation Selectors",
  97. "Tags",
  98. "Limbu",
  99. "Tai Le",
  100. "New Tai Lue",
  101. "Buginese",
  102. "Glagolitic",
  103. "Tifinagh",
  104. "Yijing Hexagram Symbols",
  105. "Syloti Nagri",
  106. "Linear B Syllabary",
  107. "Ancient Greek Numbers",
  108. "Ugaritic",
  109. "Old Persian",
  110. "Shavian",
  111. "Osmanya",
  112. "Cypriot Syllabary",
  113. "Kharoshthi",
  114. "Tai Xuan Jing Symbols",
  115. "Cuneiform",
  116. "Counting Rod Numerals",
  117. "Sundanese",
  118. "Lepcha",
  119. "Ol Chiki",
  120. "Saurashtra",
  121. "Kayah Li",
  122. "Rejang",
  123. "Cham",
  124. "Ancient Symbols",
  125. "Phaistos Disc",
  126. "Lycian",
  127. "Mahjong Tiles"
  128. };
  129.  
  130. int main(int argc, char* argv[])
  131. {
  132.     if (argc<2){
  133.         printf("\nUsage: fontCheck <fontFaceName>\n");
  134.         return 0;
  135.     }
  136.  
  137.     HDC hdc = GetDC(0);
  138.     LOGFONTA lf;
  139.     memset(&lf, 0, sizeof(LOGFONTA));
  140.  
  141.     strcpy(lf.lfFaceName, argv[1]);
  142.     lf.lfCharSet = DEFAULT_CHARSET;
  143.  
  144.     HFONT hfont = CreateFontIndirectA(&lf);
  145.     HGDIOBJ oldobj = SelectObject(hdc, hfont);
  146.  
  147.     FONTSIGNATURE signature;
  148.   GetTextCharsetInfo(hdc, &signature, 0);
  149.   SelectObject(hdc, oldobj);
  150.   DeleteObject(hfont);
  151.   ReleaseDC(0, hdc);
  152.  
  153.     int i;
  154.     for (i=0;i<32;i++) if (signature.fsUsb[0] & 1<<i) printf("%s\n", subranges[i]);
  155.     for (i=0;i<32;i++) if (signature.fsUsb[1] & 1<<i) printf("%s\n", subranges[32+i]);
  156.     for (i=0;i<32;i++) if (signature.fsUsb[2] & 1<<i) printf("%s\n", subranges[64+i]);
  157.     for (i=0;i<27;i++) if (signature.fsUsb[3] & 1<<i) printf("%s\n", subranges[96+i]);
  158.     return 0;
  159. }
  160.  
  161.  
[raw code]