Giter Club home page Giter Club logo

gf-glyphs-scripts's Introduction

Glyphsapp QA and production scripts for Google Fonts

qa.py

Check a font family conforms to the Google Fonts' specification

Installation

  1. Open Glyphsapp and type command + shift + y
  2. Drag Google Fonts folder into Scripts folder

FontTools must be installed. This can be installed by going to Glyphs > Preferences > Addons > Install Modules

gf-glyphs-scripts's People

Contributors

m4rc1e avatar mjlagattuta avatar weiweihuanghuang avatar yanone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gf-glyphs-scripts's Issues

Fix script broken

Traceback:

Start
Traceback (most recent call last):
  File "fixfonts.py", line 264, in <module>
    main()
  File "fixfonts.py", line 250, in main
    ttfs_gf = download_gf_family(font.familyName)
  File "/Users/dcrossland/src/github.com/googlefonts/gf-glyphs-scripts/Google Fonts/utils.py", line 66, in download_gf_family
    return fonts_from_zip(family_zip)
  File "/Users/dcrossland/src/github.com/googlefonts/gf-glyphs-scripts/Google Fonts/utils.py", line 58, in fonts_from_zip
    ttfs.append(TTFont(zipfile.open(file_name)))
  File "/Library/Python/2.7/site-packages/fonttools-3.25.0-py2.7.egg/fontTools/ttLib/ttFont.py", line 126, in __init__
    file.seek(0)
io.UnsupportedOperation: seek
End

io.UnsupportedOperation: seek

macOS 10.13.6
GA Version 2.5.2 (1176)
fontTools "3.31.0"

Traceback (most recent call last):
  File "fixfonts.py", line 265, in <module>
    main()
  File "fixfonts.py", line 250, in main
    ttfs_gf = download_gf_family(font.familyName)
  File "~/Library/Application Support/Glyphs/Scripts/gf-glyphs-scripts-master/Google Fonts/utils.py", line 66, in download_gf_family
    return fonts_from_zip(family_zip)
  File "~/Library/Application Support/Glyphs/Scripts/gf-glyphs-scripts-master/Google Fonts/utils.py", line 58, in fonts_from_zip
    ttfs.append(TTFont(zipfile.open(file_name)))
  File "~/Library/Application Support/Glyphs/Scripts/fontTools/ttLib/ttFont.py", line 127, in __init__
    file.seek(0)
io.UnsupportedOperation: seek

Style Linking Issues

Is there a recommendations guide on style linking?

I ran the QA script in gf-glyphs-scripts and I'm getting a few errors I don't understand (my setup currently is that I have 1 set of instances for OTF, and 1 set for Webfonts with different vertical metric schemes, I also have a set for Italics, with the same vertical metrics as the TTF).

Firstly I had every italic instance linked to its upright counterpart, then I had "Bold" linked as Bold then "Bold Italic" as the Bold-Italic of Regular, I got these issues:

================================================================================
FAIL: Check style linking is correct for italic instances
--------------------------------------------------------------------------------
Italic instance must have no style linking.
Delete link to Regular

================================================================================
FAIL: Check style linking is correct for non italic instances
--------------------------------------------------------------------------------
Bold instance must have no style linking. Delete link to Regular

So I remove the linking in the "Italic" instance (why is that the case that every other weight should have Italic linking but not the 400 Regular Italic [named "Italic"]?)

Then I remove the style linking in the "Bold" instances. But keep the linking in the "Bold Italic" (this seems inconsistent). Now I get more issues:

================================================================================
FAIL: Check only Bold and Bold Italic have 'isBold' set
--------------------------------------------------------------------------------
'Bold' instance is a Bold weight.
Enable "Bold of" for this instance.

================================================================================
FAIL: Check only italic instances have 'isItalic' set
--------------------------------------------------------------------------------
'Italic' instance is an Italic.
Enable 'Italic of' for the instance

================================================================================
FAIL: Check style linking is correct for italic instances
--------------------------------------------------------------------------------
Italic instance must have no style linking.
Delete link to None

================================================================================
FAIL: Check style linking is correct for non italic instances
--------------------------------------------------------------------------------
Bold instance must have no style linking. Delete link to None

Confusingly, now the script is returning that in fact the "Bold" instance should be enabled as Bold (of Regular?), same with "Italic" as Italic. While at the same time returning Italic must have no style linking?

I have run the script on this file

Copyright string check / OFL copyright mismatch error

I get the following error when running QA from Glyphs (Version 2.5.1 (1141)) "OFL.txt and font copyright do not match." when as far as I can tell, they are functionally the same. Have checked for hidden characters etc; and not found anything amiss. Copyright is on first line of OFL.txt.

Strings in question below;

OFL copyright: Copyright 2018 The Turret Road Project Authors (https://github.com/noponies/turret-road)
Font copyright: Copyright 2018 The Turret Road Project Authors (https://github.com/noponies/turret-road)

Copyright notice check has incorrect assumption about date

self.assertIsNotNone(
copyright_search,
('Copyright string is incorrect.\n\n'
'It must contain or be:\n'
'Copyright %s The %s Project Authors (%s)\n\n'
'If the family has a RFN:\n'
'Copyright %s The %s Project Authors (%s), '
'with Reserved Font Name "%s".') % (
datetime.now().year,
font.familyName,
repo_git_url,
datetime.now().year,
font.familyName,
repo_git_url,
font.familyName,
)
)

This check is wrong, the copyright date should be the earliest date that the project started, not the current date. There is likely no way to check that date programmatically, so a regex that checks for 4 digits making the year is sufficient (likely started 19 or 20 :)

Add versioning

There's no versioning for this repo. I suggest we adopt the standard semver approach.

Copyright string check is a Grammar Na..i

Font:
Copyright 2015 The Amatic SC Project Authors (https://github.com/googlefonts/AmaticSC)

OFL:
Copyright 2015 The Amatic SC Project Authors (https://github.com/googlefonts/AmaticSC)

QA spits out:

Copyright string is incorrect.

It must contain or be:
Copyright 2017 The Amatic SC Project Authors (https://github.com/googlefonts/AmaticSC.git)

If the family has a RFN:
Copyright 2017 The Amatic SC Project Authors (https://github.com/googlefonts/AmaticSC.git), with Reserved Font Name "Amatic SC".

I think keeping earliest mention year is fine, no?

Date attribute parameter check generates false positive

QA test creates a false positive in cyrealtype/Lora-Cyrillic@02e0832

================================================================================
FAIL: Check all .glyph files share same parameters
--------------------------------------------------------------------------------
Files do not have equal attribute parameters.

Lora-Italic.glyphs date: 2017-10-27 16:56:35 +0000
Lora.glyphs date: 2017-10-27 16:55:49 +0000

typoDescender is Positive

When I run Fix Fonts for GF Spec, it generates hheaDescender as negative, and typoDescender as the same value in positive. I only noticed since fontbakery returned this error.

Error when running QA script

I get this error when I run QA:
File "qa.py", line 259
print '%s is not a correct style name' % instance.name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

Glyphs 3.2.3 (3260)
MacOS 14.4.1 (23E224)

QA: Incorrectly reports recommended instance names on 2 file, 2 instance families.

When QAing https://github.com/Omnibus-Type/ArchivoBlack, the QA script reports the following

================================================================================
FAIL: Check single weight families have Regular style name
--------------------------------------------------------------------------------
'Italic' instance name is incorrect.

Families which have just one instance must name the single 'Regular'

The family consists of two styles, Regular and Italic. Each style has its own .glyphs file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.