googlefonts / pyfontaine

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

Add --text-compact arg #63

Closed davelab6 closed 9 years ago

davelab6 commented 9 years ago
$ pyfontaine --collection subsets builds/d088571/sources/RhodiumLibre-Regular.ttf;
Fonts
  Font:
    Common name: Rhodium Libre
    Sub family: Regular
    Weight: normal
    Fixed width: no
    Fixed sizes: no
    Copyright: Copyright © 2015 by James Puckett. All rights reserved.
    License: Copyright (c) 2015
    License url: This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is available with a FAQ at: http://scripts.sil.org/OFL
    Version: Version 1.001; ttfautohint (v1.3)
    Vendor: Dunwich Type Founders
    Vendor url: http://www.dunwichtype.com
    Designer: James Puckett
    Designer url: http://www.dunwichtype.com
    Glyph count: 815
    Character count: 463
    Orthographies:
        Orthography:
          Common name: Subset cyrillic-menu
          Support level: fragmentary
          Percent coverage: 33
        Orthography:
          Common name: Subset devanagari
          Support level: fragmentary
          Percent coverage: 73
        Orthography:
          Common name: Subset greek-menu
          Support level: fragmentary
          Percent coverage: 23
        Orthography:
          Common name: Subset greek
          Support level: fragmentary
          Percent coverage: 2
        Orthography:
          Common name: Subset latin-ext
          Support level: fragmentary
          Percent coverage: 11
        Orthography:
          Common name: Subset latin
          Support level: partial
          Percent coverage: 98
        Orthography:
          Common name: Subset telugu
          Support level: fragmentary
          Percent coverage: 3
        Orthography:
          Common name: Subset vietnamese-menu
          Support level: partial
          Percent coverage: 80
        Orthography:
          Common name: Subset vietnamese
          Support level: fragmentary
          Percent coverage: 3
$

I can run,

$ pyfontaine --collection subsets --text-compact builds/d088571/sources/RhodiumLibre-Regular.ttf 
Filename: RhodiumLibre-Regular.ttf;
Glyph count:  487
Character count: 463
33% XXX/YYY Subset cyrillic-menu 
73% XXX/YYY Subset devanagari   
23% XXX/YYY Subset greek-menu   
 2% XXX/YYY Subset greek        
11% XXX/YYY Subset latin-ext    
98% XXX/YYY Subset latin        
 3% XXX/YYY Subset telugu       
80% XXX/YYY Subset vietnamese-menu
 3% XXX/YYY Subset vietnamese   
$
davelab6 commented 9 years ago

This broke the other modes :( Its also not as I described.

$ pyfontaine --xml --collection subsets gillsans/*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
Character Set             
Subset latin              True           
Subset vietnamese-menu              
davelab6 commented 9 years ago

@vitalyvolkov ping :)

vitalyvolkov commented 9 years ago

@davelab6 My output is below you could see

$ python bin/pyfontaine --xml --collection subsets ../Fonts/Bhavuka/Bhavuka-Regular.ttf 
<?xml version="1.0" ?>
<report>
  <fonts>
    <font>
      <Filename>Bhavuka-Regular.ttf</Filename>
      <commonName>Bhavuka</commonName>
      <subFamily>Regular</subFamily>
      <style></style>
      <weight>normal</weight>
      <fixedWidth>no</fixedWidth>
      <fixedSizes>yes</fixedSizes>
      <copyright>Copyright 2014 - Matt Heximer (www.10fourdesign.com)</copyright>
      <license>OFL 1.1</license>
      <licenseUrl>http://scripts.sil.org/OFL</licenseUrl>
      <version>2.94.0; ttfautohint (v1.1) -l 8 -r 50 -G 200 -x 14 -D deva -f latn -w G</version>
      <vendor></vendor>
      <vendorUrl></vendorUrl>
      <designer></designer>
      <designerUrl></designerUrl>
      <glyphCount>1023</glyphCount>
      <characterCount>735</characterCount>
      <orthographies>
        <orthography>
          <commonName>Subset latin</commonName>
          <nativeName></nativeName>
          <supportLevel>partial</supportLevel>
          <percentCoverage>98</percentCoverage>
          <Coverage>216</Coverage>
          <SetTotal>213</SetTotal>
        </orthography>
      </orthographies>
      <orthographies>
        <orthography>
          <commonName>Subset vietnamese-menu</commonName>
          <nativeName></nativeName>
          <supportLevel>partial</supportLevel>
          <percentCoverage>90</percentCoverage>
          <Coverage>10</Coverage>
          <SetTotal>9</SetTotal>
        </orthography>
      </orthographies>
      <orthographies>
        <orthography>
          <commonName>Subset devanagari</commonName>
          <nativeName></nativeName>
          <supportLevel>fragmentary</supportLevel>
          <percentCoverage>75</percentCoverage>
          <Coverage>176</Coverage>
          <SetTotal>133</SetTotal>
        </orthography>
      </orthographies>
      <orthographies>
        <orthography>
          <commonName>Subset vietnamese</commonName>
          <nativeName></nativeName>
          <supportLevel>fragmentary</supportLevel>
          <percentCoverage>50</percentCoverage>
          <Coverage>86</Coverage>
          <SetTotal>43</SetTotal>
        </orthography>
      </orthographies>
      <orthographies>
        <orthography>
          <commonName>Subset greek-menu</commonName>
          <nativeName></nativeName>
          <supportLevel>fragmentary</supportLevel>
          <percentCoverage>38</percentCoverage>
          <Coverage>13</Coverage>
          <SetTotal>5</SetTotal>
        </orthography>
      </orthographies>
      <orthographies>
        <orthography>
          <commonName>Subset cyrillic-menu</commonName>
          <nativeName></nativeName>
          <supportLevel>fragmentary</supportLevel>
          <percentCoverage>33</percentCoverage>
          <Coverage>9</Coverage>
          <SetTotal>3</SetTotal>
        </orthography>
      </orthographies>
      <orthographies>
        <orthography>
          <commonName>Subset latin-ext</commonName>
          <nativeName></nativeName>
          <supportLevel>fragmentary</supportLevel>
          <percentCoverage>28</percentCoverage>
          <Coverage>824</Coverage>
          <SetTotal>233</SetTotal>
        </orthography>
      </orthographies>
      <orthographies>
        <orthography>
          <commonName>Subset greek</commonName>
          <nativeName></nativeName>
          <supportLevel>fragmentary</supportLevel>
          <percentCoverage>20</percentCoverage>
          <Coverage>144</Coverage>
          <SetTotal>30</SetTotal>
        </orthography>
      </orthographies>
      <orthographies>
        <orthography>
          <commonName>Subset telugu</commonName>
          <nativeName></nativeName>
          <supportLevel>fragmentary</supportLevel>
          <percentCoverage>3</percentCoverage>
          <Coverage>101</Coverage>
          <SetTotal>4</SetTotal>
        </orthography>
      </orthographies>
    </font>
  </fonts>
</report>

$ python bin/pyfontaine --xml --collection subsets --text-compact ../Fonts/Bhavuka/Bhavuka-Regular.ttf 
Filename: Bhavuka
Glyph count:  1023
Character count: 735
50% 43/86 Subset vietnamese
3% 4/101 Subset telugu
90% 9/10 Subset vietnamese-menu
20% 30/144 Subset greek
38% 5/13 Subset greek-menu
33% 3/9 Subset cyrillic-menu
98% 213/216 Subset latin
28% 233/824 Subset latin-ext
75% 133/176 Subset devanagari
vitalyvolkov commented 9 years ago

Try --collection=subsets instead.