googlefonts / pyfontaine

Python tool to check font files for language/character set support
https://github.com/googlefonts/pyfontaine
GNU General Public License v3.0
103 stars 22 forks source link

Show actual glyph counts #62

Open davelab6 opened 9 years ago

davelab6 commented 9 years ago
...
        Orthography:
          Common name: Subset cyrillic-menu
          Support level: fragmentary
          Percent coverage: 33
...

then I see,

...
        Orthography:
          Common name: Subset cyrillic-menu
          Support level: fragmentary
          Percent coverage: 33
          Coverage: XXX
          Set total: YYY
...

where XXX is the count in the file, and YYY is the count in the glyphset or charset definition

davelab6 commented 9 years ago

The Set Total counts seem wrong:

$ git clone git@github.com:google/fonts.git ;
$ cd fonts/ofl/cantarell ;
$ pyfontaine --text --collection subsets Cantarell-Regular.ttf ;
WARNING: Please install PyICU <https://pypi.python.org/pypi/PyICU> to enable CLDR related features, perhaps with: pip install pyicu
WARNING: Please install PyICU <https://pypi.python.org/pypi/PyICU> to enable CLDR related features, perhaps with: pip install pyicu
Fonts
  Font:
    Filename: Cantarell-Regular.ttf
    Common name: Cantarell
    Sub family: Regular
    Weight: bold
    Fixed width: no
    Fixed sizes: yes
    Copyright: Copyright (c) 2009 Dave Crossland <dave@lab6.com>
    License: Copyright (c) 2009 Dave Crossland <dave@lab6.com>
    Version: Version 001.001 
    Vendor url: http://abattis.org
    Designer: Dave Crossland
    Designer url: http://abattis.org
    Glyph count: 391
    Character count: 388
    Orthographies:
        Orthography:
          Common name: Subset latin
          Support level: partial
          Percent coverage: 97
          Coverage: 216
          Set total: 211
        Orthography:
          Common name: Subset vietnamese-menu
          Support level: partial
          Percent coverage: 80
          Coverage: 10
          Set total: 8
        Orthography:
          Common name: Subset cyrillic-menu
          Support level: fragmentary
          Percent coverage: 33
          Coverage: 9
          Set total: 3
        Orthography:
          Common name: Subset greek-menu
          Support level: fragmentary
          Percent coverage: 23
          Coverage: 13
          Set total: 3
        Orthography:
          Common name: Subset latin-ext
          Support level: fragmentary
          Percent coverage: 18
          Coverage: 824
          Set total: 153
        Orthography:
          Common name: Subset vietnamese
          Support level: fragmentary
          Percent coverage: 2
          Coverage: 86
          Set total: 2
$
davelab6 commented 9 years ago

Ah, the labels are mixed up :) Eg,

$ pyfontaine --text fonts/ofl/slabo27px/Slabo27px-Regular.ttf ;
...
        Orthography:
          Common name: Adobe Latin 3
          Support level: partial
          Percent coverage: 94
          Coverage: 329
          Set total: 311
          Glyphs in set: 329
          Glyphs in font: 311
          Percent coverage: 94
          Support level: partial
davelab6 commented 9 years ago
$ git clone git@github.com:metapolator/Breite.git;
$ cd Breite;
$ pyfontaine --collection subsets Output/Regular.otf;
WARNING: Please install PyICU <https://pypi.python.org/pypi/PyICU> to enable CLDR related features, perhaps with: pip install pyicu
WARNING: Please install PyICU <https://pypi.python.org/pypi/PyICU> to enable CLDR related features, perhaps with: pip install pyicu
Fonts
  Font:
    Filename: Regular.otf
    Common name: Breite Grotesk Regular
    Sub family: Regular
    Weight: normal
    Fixed width: no
    Fixed sizes: yes
    Copyright: Copyright © 2014 by Nicolas Franck Pauly. All rights reserved.
    Version: Version 1.000;PS 1.0;hotconv 1.0.70;makeotf.lib2.5.58329 DEVELOPMENT
    Vendor: Type Design Studio
    Vendor url: http://typedesignstudio.net
    Designer: Nicolas Franck Pauly
    Designer url: http://nicolaspauly.com
    Glyph count: 482
    Character count: 469
    Orthographies:
        Orthography:
          Common name: Subset latin
          Glyphs in set: 216
          Glyphs in font: 216
          Percent coverage: 85
          Support level: partial
        Orthography:
          Common name: Subset vietnamese-menu
          Glyphs in set: 10
          Glyphs in font: 10
          Percent coverage: 80
          Support level: partial
        Orthography:
          Common name: Subset cyrillic-menu
          Glyphs in set: 9
          Glyphs in font: 9
          Percent coverage: 66
          Support level: fragmentary
        Orthography:
          Common name: Subset devanagari
          Glyphs in set: 176
          Glyphs in font: 176
          Percent coverage: 63
          Support level: fragmentary
        Orthography:
          Common name: Subset cyrillic
          Glyphs in set: 101
          Glyphs in font: 101
          Percent coverage: 48
          Support level: fragmentary
        Orthography:
          Common name: Subset greek-menu
          Glyphs in set: 13
          Glyphs in font: 13
          Percent coverage: 23
          Support level: fragmentary
        Orthography:
          Common name: Subset latin-ext
          Glyphs in set: 824
          Glyphs in font: 824
          Percent coverage: 13
          Support level: fragmentary
        Orthography:
          Common name: Subset telugu
          Glyphs in set: 101
          Glyphs in font: 101
          Percent coverage: 3
          Support level: fragmentary
        Orthography:
          Common name: Subset vietnamese
          Glyphs in set: 86
          Glyphs in font: 86
          Percent coverage: 3
          Support level: fragmentary

This doesn't make sense:

          Glyphs in set: 216
          Glyphs in font: 216
          Percent coverage: 85
davelab6 commented 9 years ago

Here's the --missing arg output:

  Font:
    Filename: Condensed.otf
    Common name: Breite Grotesk Condensed
    Sub family: Condensed
    Weight: normal
    Fixed width: no
    Fixed sizes: yes
    Version: Version 0.000;PS 0.0;hotconv 1.0.72;makeotf.lib2.5.5900 DEVELOPMENT
    Glyph count: 285
    Character count: 280
    Orthographies:
        Orthography:
          Common name: Google latin
          Glyphs in set: 214
          Glyphs in font: 214
          Percent coverage: 80
          Missing values: 
              U+00ad  ­  SOFT HYPHEN
              U+2022  •  BULLET
              U+2039  ‹  SINGLE LEFT-POINTING ANGLE QUOTATION MARK
              U+203a  ›  SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
              U+0025  %  PERCENT SIGN
              U+002a  *  ASTERISK
              U+007b  {  LEFT CURLY BRACKET
              U+007d  }  RIGHT CURLY BRACKET
              U+00a0     NO-BREAK SPACE
              U+00a3  £  POUND SIGN
              U+00a4  ¤  CURRENCY SIGN
              U+00a5  ¥  YEN SIGN
              U+00a6  ¦  BROKEN BAR
              U+00a7  §  SECTION SIGN
              U+00aa  ª  FEMININE ORDINAL INDICATOR
              U+00ab  «  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
              U+00ac  ¬  NOT SIGN
              U+00ad  ­  SOFT HYPHEN
              U+00b0  °  DEGREE SIGN
              U+00b2  ²  SUPERSCRIPT TWO
              U+00b3  ³  SUPERSCRIPT THREE
              U+00b5  µ  MICRO SIGN
              U+00b7  ·  MIDDLE DOT
              U+00b9  ¹  SUPERSCRIPT ONE
              U+00ba  º  MASCULINE ORDINAL INDICATOR
              U+00bb  »  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
              U+00bc  ¼  VULGAR FRACTION ONE QUARTER
              U+00bd  ½  VULGAR FRACTION ONE HALF
              U+00be  ¾  VULGAR FRACTION THREE QUARTERS
              U+00c3  Ã  LATIN CAPITAL LETTER A WITH TILDE
              U+00c6  Æ  LATIN CAPITAL LETTER AE
              U+00d1  Ñ  LATIN CAPITAL LETTER N WITH TILDE
              U+00d5  Õ  LATIN CAPITAL LETTER O WITH TILDE
              U+00df  ß  LATIN SMALL LETTER SHARP S
              U+00e3  ã  LATIN SMALL LETTER A WITH TILDE
              U+00f0  ð  LATIN SMALL LETTER ETH
              U+00f1  ñ  LATIN SMALL LETTER N WITH TILDE
              U+00f5  õ  LATIN SMALL LETTER O WITH TILDE
              U+00f7  ÷  DIVISION SIGN
              U+2074  ⁴  SUPERSCRIPT FOUR
              U+2215  ∕  DIVISION SLASH
              U+2044  ⁄  FRACTION SLASH
          Support level: partial

This shows 40 glyphs missing, so it should be:

          Glyphs in set: 214
          Glyphs in font: 174