Commits

anatoly techtonik committed 2059bba

Improve comments.

Comments (0)

Files changed (1)

 files with the same font name you'll can get only one.
 
 Windows also doesn't have a clear concept of _generic font family_
-familiar from CSS specification. To get to monospace fonts you need
-to query all available fonts and filter them by properties. Here is
-how fontquery does mapping for generic CSS font families:
+familiar from CSS specification. Here is how fontquery maps Windows
+LOGFONT properties to generic CSS font families:
 
   serif      -   (LOGFONT.lfPitchAndFamily >> 4) == FF_ROMAN
   sans-serif -   (LOGFONT.lfPitchAndFamily >> 4) == FF_SWISS
   monospace  -   (LOGFONT.lfPitchAndFamily >> 4) == FF_MODERN
 
 NOTE: Raster 'Modern' font and OpenType 'OCR A Extended' are
-      FF_MODERN, but have VARIABLE_PITCH.
+      FF_MODERN, but have VARIABLE_PITCH for some reason
 
       [ ] find a way to check char's pitch matches manually
 
 on the system, the font mapper will substitute a font that has similar
 attributes but a different name.
 
-   [ ] check if font is chosen by the system has required family
+   [ ] check if font chosen by the system has required family
 
     To get the appropriate font, call EnumFontFamiliesEx with the
 desired font characteristics in the LOGFONT structure, then retrieve the
 appropriate typeface name and create the font using CreateFont or
 CreateFontIndirect.
 
-Wikipedia:
+"""
+DEBUG = False
+
+#-- CHAPTER 1: GET ALL SYSTEM FONTS USING EnumFontFamiliesEx FROM GDI --
+
+"""
+Q: Why GDI? Why not GDI+? 
+A: Wikipedia:
 
     Because of the additional text processing and resolution independence
 capabilities in GDI+, text rendering is performed by the CPU [2] and it
 Chris Jackson published some tests indicating that a piece of text
 rendering code he had written could render 99,000 glyphs per second in GDI,
 but the same code using GDI+ rendered 16,600 glyphs per second.
-
 """
-DEBUG = False
-
-#-- CHAPTER 1: GET ALL SYSTEM FONTS USING EnumFontFamiliesEx FROM GDI --
-#
-# Essential info about font metrics http://support.microsoft.com/kb/32667
-# And about logical units at http://www.winprog.org/tutorial/fonts.html
 
 import ctypes
 from ctypes import wintypes
     print("Total: %s" % len(names))
 
 
+
+#-- CHAPTER 2: WORK WITH FONT DIMENSIONS --
+#
+# Essential info about font metrics http://support.microsoft.com/kb/32667
+# And about logical units at http://www.winprog.org/tutorial/fonts.html
+
 # x. Convert desired font size from points into logical units (pixels)
 
 # By default logical for the screen units are pixels. This is defined
 # x.1 Get pixels per inch using GetDeviceCaps() or ...
 
 
+#-- CHAPTER 3: LAYERED FONT API --
+#
 # y. Font object with several layers of info
 
 # Font object should contains normalized font information. This
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.