Commits

anatoly techtonik  committed 82ce670

Output more font info in DEBUG mode.

  • Participants
  • Parent commits 76a5aba

Comments (0)

Files changed (1)

File fontquery.py

   _font_names.add(lf.lfFaceName)
 
   if DEBUG:
-    # print information about fixed pitch and modern font properties
-    pitch  = lf.lfPitchAndFamily & 0b11
+    info = ''
+ 
+    pitch = lf.lfPitchAndFamily & 0b11
+    if pitch == FIXED_PITCH:
+      info += 'FP '
+    elif pitch == VARIABLE_PITCH: 
+      info += 'VP '
+    else:
+      info += '   '
+
     family = lf.lfPitchAndFamily >> 4
-    if pitch == FIXED_PITCH:
-      if family == FF_MODERN:
-        print(b'           ' + lf.lfFaceName)
-      else:
-        print(b'[FPNM] (%s) %s' % (family, lf.lfFaceName))
+    if family == FF_MODERN:
+      info += 'M  '
     else:
-      if lf.lfPitchAndFamily >> 4 == FF_MODERN:
-        print(b'[VP M] [%s] %s' % (pitch, lf.lfFaceName))
+      info += 'NM '
 
+    style = [' ']*3
+    if lf.lfItalic:
+      style[0] = 'I'
+    if lf.lfUnderline:
+      style[1] = 'U'
+    if lf.lfStrikeOut:
+      style[2] = 'S'
+    info += ''.join(style)
+
+    info += ' %s' % lf.lfWeight
+
+    #if pitch == FIXED_PITCH:
+    if 1:
+      print('%s CHARSET: %3s  %s' % (info, lf.lfCharSet, lf.lfFaceName))
 
   return 1   # non-0 to continue enumeration
 enum_font_names = FONTENUMPROC(_enum_font_names)