phetsims / sherpa

Third-party libraries and dependencies for PhET Simulations
Other
6 stars 8 forks source link

Upgrade Font Awesome #81

Closed jessegreenberg closed 3 years ago

jessegreenberg commented 3 years ago

I needed a new icon from Font Awesome that is not in the version we have. Considering upgrading but there was some uncertainty around licensing. Font Awesome also changed a lot between versions 4 and 5. For instance, the old fontawesome-webfont.svg file has been replaced by a different file called sprites/solid.svg.

We need to make sure that FA 5 licensing allows PhET to use it, and that the changes in FA 5 still work with FontAwesomeNode.js.

jessegreenberg commented 3 years ago

Here is a link to FA licensing: https://fontawesome.com/license/free

Icons — CC BY 4.0 License In the Font Awesome Free download, the CC BY 4.0 license applies to all icons packaged as .svg and .js files types.

Fonts — SIL OFL 1.1 License In the Font Awesome Free download, the SIL OFL license applies to all icons packaged as web and desktop font files.

jessegreenberg commented 3 years ago

Here is the 4.7.0 licensing: https://fontawesome.com/v4.7.0/license/

Applies to all desktop and webfont files in the following directory: font-awesome/fonts/. License: SIL OFL 1.1

So the CC BY 4.0 License seems to be new for FA 5 icons.

jessegreenberg commented 3 years ago

Adding developer meeting label to review with team and see if anyone can confirm that CC BY 4.0 is usable by PhET.

samreid commented 3 years ago

CC BY 4.0 requires:

you must provide the name of the creator and attribution parties, a copyright notice, a license notice, a disclaimer notice, and a link to the material.

We provide some (but not all of this) in https://github.com/phetsims/sherpa/blob/master/third-party-licenses.md. To my knowledge, none of this is provided in the sim or in the app.

It may be the most cost-effective route for PhET to subscribe to the pro license for font awesome, which is described at https://fontawesome.com/plans#faq-standard-pro-license

pixelzoom commented 3 years ago

FYI...

SVG for icons can be downloaded directly from the FA website, by pressing the "Download SVG" button. E.g. for icon user-cog (the one that @jessegreenberg is interested in):

screenshot_738

Then you'll get a dialog like this, informing you of the license requirements:

screenshot_739

The "link to the license" hyperlink takes you to https://fontawesome.com/license.

zepumph commented 3 years ago

Some other sources for icons, perhaps with easier licensing: https://lineicons.com/blog/font-awesome-alternatives/

pixelzoom commented 3 years ago

12/10/2020 dev meeting:

The question is whether the new FA license (CC-BY) is compatible with PhET.

@samreid recalls that CC-BY was not approved when PhET had a legal review a few years ago. PhET has been using MIT. CC-BY puts restrictions on how we can relicense sims.

@jonathanolson said that PhET licenses its sim as CC-BY. He's skeptical that FA license will work, because we need to be GPL compatible.

@ariel-phet How much is the paid plan? @samreid $90/year for 5 "seats". @jonathanolson doesn't solve the issue because we're redistributing. @ariel-phet we can't go down this road.

@jonathanolson we could look for other sources for new SVG icons.

@samreid for user-cog, we could combine two FA 4 icons (user + gear).

@samreid suggested asking @kathy-phet check with legal. What needs to be done to upgrade to new FA license? @samreid will put on agenda for next status meeting. Could also ask FA if they'd give us special license terms.

Assigned to @samreid to bring up at status meeting.

kathy-phet commented 3 years ago

CC-BY is how we license the simulations, and it should be compatible with even our licensed commercial products we offer in terms of PhET-iO. We just need to attribute the image to them, but I will check with my contacts at Creative Commons that doing so in the HTML code will be sufficient. It doesn't have any GPL type of issues.

kathy-phet commented 3 years ago

@samreid - Currently within the HTML sim code file we do have this text in our license section (taken from Build a Molecule):

"font-awesome-4.5.0": {

  | "text": [   | "Created by Dave Gandy"   | ],   | "license": "Font Awesome licensed under SIL OFL 1.1 · Code licensed under MIT License · Documentation licensed under CC BY 3.0",   | "projectURL": "http://fontawesome.io/",   | "notes": "Provides shapes and icons for phet-io wrappers, SVG for icons in FontAwesomeNode",   | "licenseText": [   | "Copyright (c) 2013, Dave Gandy - http://fontawesome.io",   | "with Reserved Font Name Font Awesome.",   | "",   | "This Font Software is licensed under the SIL Open Font License, Version 1.1.",   | "This license is copied below, and is also available with a FAQ at:",   | "http://scripts.sil.org/OFL",   | "",   | "",   | "-----------------------------------------------------------",   | "SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007",   | "-----------------------------------------------------------",   | "",   | "PREAMBLE",   | "The goals of the Open Font License (OFL) are to stimulate worldwide",   | "development of collaborative font projects, to support the font creation",   | "efforts of academic and linguistic communities, and to provide a free and",   | "open framework in which fonts may be shared and improved in partnership",   | "with others.",   | "",   | "The OFL allows the licensed fonts to be used, studied, modified and",   | "redistributed freely as long as they are not sold by themselves. The",   | "fonts, including any derivative works, can be bundled, embedded,",   | "redistributed and/or sold with any software provided that any reserved",   | "names are not used by derivative works. The fonts and derivatives,",   | "however, cannot be released under any other type of license. The",   | "requirement for fonts to remain under this license does not apply",   | "to any document created using the fonts or their derivatives.",   | "",   | "DEFINITIONS",   | "\"Font Software\" refers to the set of files released by the Copyright",   | "Holder(s) under this license and clearly marked as such. This may",   | "include source files, build scripts and documentation.",   | "",   | "\"Reserved Font Name\" refers to any names specified as such after the",   | "copyright statement(s).",   | "",   | "\"Original Version\" refers to the collection of Font Software components as",   | "distributed by the Copyright Holder(s).",   | "",   | "\"Modified Version\" refers to any derivative made by adding to, deleting,",   | "or substituting -- in part or in whole -- any of the components of the",   | "Original Version, by changing formats or by porting the Font Software to a",   | "new environment.",   | "",   | "\"Author\" refers to any designer, engineer, programmer, technical",   | "writer or other person who contributed to the Font Software.",   | "",   | "PERMISSION & CONDITIONS",   | "Permission is hereby granted, free of charge, to any person obtaining",   | "a copy of the Font Software, to use, study, copy, merge, embed, modify,",   | "redistribute, and sell modified and unmodified copies of the Font",   | "Software, subject to the following conditions:",   | "",   | "1) Neither the Font Software nor any of its individual components,",   | "in Original or Modified Versions, may be sold by itself.",   | "",   | "2) Original or Modified Versions of the Font Software may be bundled,",   | "redistributed and/or sold with any software, provided that each copy",   | "contains the above copyright notice and this license. These can be",   | "included either as stand-alone text files, human-readable headers or",   | "in the appropriate machine-readable metadata fields within text or",   | "binary files as long as those fields can be easily viewed by the user.",   | "",   | "3) No Modified Version of the Font Software may use the Reserved Font",   | "Name(s) unless explicit written permission is granted by the corresponding",   | "Copyright Holder. This restriction only applies to the primary font name as",   | "presented to the users.",   | "",   | "4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font",   | "Software shall not be used to promote, endorse or advertise any",   | "Modified Version, except to acknowledge the contribution(s) of the",   | "Copyright Holder(s) and the Author(s) or with their explicit written",   | "permission.",   | "",   | "5) The Font Software, modified or unmodified, in part or in whole,",   | "must be distributed entirely under this license, and must not be",   | "distributed under any other license. The requirement for fonts to",   | "remain under this license does not apply to any document created",   | "using the Font Software.",   | "",   | "TERMINATION",   | "This license becomes null and void if any of the above conditions are",   | "not met.",   | "",   | "DISCLAIMER",   | "THE FONT SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,",   | "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF",   | "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT",   | "OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE",   | "COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,",   | "INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL",   | "DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING",   | "FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM",   | "OTHER DEALINGS IN THE FONT SOFTWARE.",   | ""   | ]   | },

samreid commented 3 years ago

Font Awesome 5.0's free license says:

Icons — CC BY 4.0 License: In the Font Awesome Free download, the CC BY 4.0 license applies to all icons packaged as .svg and .js files types.

So Font Awesome is CC-BY. There was a recent article from creative commons, saying that even the more restrictive "CC-BY-SA" is one-way compatible with GPL. https://creativecommons.org/2015/10/08/cc-by-sa-4-0-now-one-way-compatible-with-gplv3/. So since we would be using the less-restrictive CC-BY, it seems permissible.

@kathy-phet thanks for reminding me that the attributions appear in the built HTML files. Since we are already providing attribution, it seems like we can proceed with this. I recall in Thursday's meeting @jonathanolson and @pixelzoom raised other concerns or commented on these concerns, so I'll reassign to them for further discussion. @ariel-phet also asked me to add an agenda item for Thursday status meeting--we can also touch base then if we haven't concluded discussion in the issue beforehand.

pixelzoom commented 3 years ago

I recall in Thursday's meeting @jonathanolson and @pixelzoom raised other concerns or commented on these concerns, so I'll reassign to them for further discussion.

The concern I raised was simply that you can't upgrade sherpa to a new version of FA, or cherry-pick icons (via their web interface) from newer versions of FA, because the license has changed. It's up to PhET to decide how to proceed with evaluating the new license, resolving any licensing issues, and/or finding other sources for SVG icons.

Advice on licensing issues is not a service that PixelZoom provides, so unassigning myself.

jonathanolson commented 3 years ago

D. 'PhET HTML Common Source Code': MIT License "PhET HTML Simulation Source Code" is a collection of original common libraries and tools developed by PhET, including but not limited to source code (JavaScript/HTML/CSS), images, audio and text.

PhET licenses PhET HTML Simulation Source Code under the MIT License. The full text of the MIT License is available here: http://opensource.org/licenses/MIT

If joist/sun/scenery-phet is relying on that (and it doesn't look MIT-compatible, see https://opensource.stackexchange.com/questions/7435/mit-licensed-project-with-cc-by-sa-dependency), then I'm concerned.

Strong preference to either use alternatives, or have someone look into whether we wouldn't run into issues.

samreid commented 3 years ago

The links you described refer to "CC-BY-SA" but Font Awesome is "CC-BY" without the "SA" restrictions. Does the same argument apply?

jonathanolson commented 3 years ago

The links you described refer to "CC-BY-SA" but Font Awesome is "CC-BY" without the "SA" restrictions. Does the same argument apply?

A quick read of https://creativecommons.org/licenses/by/4.0/legalcode doesn't seem compatible with the MIT license.

kathy-phet commented 3 years ago

@jonathanolson - My understanding here is that the code remains MIT and the images then remain CC-BY. They can be combined and redistributed, but we will need to specify that the images are CC-BY. We handle this fine in the HTML file. The license needs a tweak. And I will need to consult the lawyers as well.

jonathanolson commented 3 years ago

My concern is that the derived work is specifically embedded and checked into our MIT'ed source code, e.g. https://github.com/phetsims/sun/blob/master/js/FontAwesomeNode.js

kathy-phet commented 3 years ago

I've sent an email to my contacts at Creative Commons for a consult.

samreid commented 3 years ago

What if we move the font awesome path strings out of FontAwesomeNode?

kathy-phet commented 3 years ago

I see github allows you to make a repository that is CC-BY. Is there a way to give FontAwesome its own repo, and just mix them in the build process? That would be ideal

samreid commented 3 years ago

Maybe it would be more inline with PhET's process to put the font awesome data in the "sherpa" repo, which already supports various 3rd party licensing.

kathy-phet commented 3 years ago

I thought sherpa was just where we tracked the licenses? Is that were we put the third party images when we have them? If so, yes.

samreid commented 3 years ago

Sherpa contains the 3rd party licenses as well as the 3rd party code.

kathy-phet commented 3 years ago

If FontAwesome svgs can live there that is perfect.

samreid commented 3 years ago

I'll open an issue about moving that data to sherpa.

samreid commented 3 years ago

In https://github.com/phetsims/sherpa/issues/82 I moved the font awesome 4.5 data from FontAwesomeNode to sherpa as a batch. There are more steps necessary to accommodate 5.0+, one of which should be discussed before we proceed. I think we should move to a "one string per file" paradigm instead of having multiple SVG's batched together. This will mean that only sims that need the "camera" icon will include the "camera" icon.

I also think it would be simplest if we move completely to 5 or 6 and eliminate 4 so we are not mixing versions. But I haven't done a side-by-side comparison to see if the icons we currently use are different in 5 or 6. Checking the raw data of "camera", I can tell that it is different, but I haven't checked to see if they actually look different.

If we don't want to take the time to compare those icons now, we could (temporarily?) leave 4.5 where it is and add 5.0 next to it.

UPDATE: I looked at "camera" and "check" in 4 and 5 and couldn't tell the difference.

Summarizing the main questions:

samreid commented 3 years ago

@kathy-phet said it is not problematic to mix 4/5 icons. A developer (I think it was @pixelzoom?) said it could be preferable to move icons to separate files. @pixelzoom also recommended rectifying the names with the font awesome names, instead of giving our own names. @zepumph asked what would be necessary to move to 5 icons. I replied that we would probably want to look at them side-by-side, (SVG diff is noisy). @kathy-phet mentioned that the designers may want to review the changes before we jump from 4 to 5 for all icons.

pixelzoom commented 3 years ago

A developer (I think it was @pixelzoom?) said it could be preferable to move icons to separate files.

To clarify... I recommended separating v4 and v5 icons into 2 separate files. But a file-per-icon might also be nice, would like to discuss more.

ariel-phet commented 3 years ago

Re Legal concerns:

Kathy wrote to a contact at Creative Commons:

I hope you are weathering the pandemic OK and staying safe and healthy despite the many challenges.

I'm writing to see if you, or someone there at CC, might be able to help us figure out whether what we are doing with licenses will still be OK or whether we need to make changes to what we do given Font Awesome's adoption of CC-BY for its svg files which we use for icons.

I am hoping to walk through what we do now, and understand what we need to change (if anything) before we pull in their new library and new license. The challenges lie around the fact that their .svg files end up within our code. Our common code libraries are MIT licensed, and within github you to pick a license per repository. We have a credits approach we have used for a long time, and within the published HTML5 simulations, there is a human readable section that has all the credit and licenses associated with each sim. But with the use of their icons within our simulations, it becomes a question what to do within the repository itself and how this should work given that we desire to license the code itself as MIT.

Any chance someone there would be able to take a look at the situation with us?

Thanks for any help, and I understand if its just too crazy of a time ...

And then KP followed up with:

I think we came up with a proper way to do this.

But if there is someone to review our approach, that would be good too. We moved the svg files into a separate repository so the code has its own and the svg files can still be marked CC-BY.

The contact wrote back:

Good to hear from you.

Yes - I think your solution is an elegant one.

Wishing you both good health and a happy holiday season,

samreid commented 3 years ago

Dev meeting notes

Regarding licensing:

@jonathanolson expressed concerns that CC-BY material could not be licensed in a bundle with GPL license. We did see https://creativecommons.org/2015/10/08/cc-by-sa-4-0-now-one-way-compatible-with-gplv3/ which says you can license a GPL thing containing CC-BY. But @ariel-phet said @kathy-phet had reached out to contacts. We noticed the preceding comments mention MIT but not GPL. So @ariel-phet will reach out to @kathy-phet about that.

Regarding moving forward: The proposal from today's dev meeting is to have one file per icon, name with a "FontAwesome" prefix, and wrap the data in new Shape. Those shapes would all be transformed with Matrix3.createFromPool( 0.025, 0, 0, 0, -0.025, 0, 0, 0, 1 ) by default. Batches should be able to share a scale, so that should be factored out.

Where should the new files go?

@pixelzoom recommends to get rid of the sherpa js/ directory. In part because it is not linted.

@pixelzoom recommends an icons repo, with subdirectories for icon source. It will have package.json and be lintable, etc. (+1 by @Denz1994 and @jbphet)

Which versions should we do this for?

@pixelzoom recommends moving the font awesome 4 icons to the new repo. Those could remain as a batch.

@ariel-phet recommends waiting until we get legal confirmation.

@pixelzoom points out that @jessegreenberg can construct the user-gear icon out of FA 4 icons (user + gear).

@jessegreenberg said he could use a placeholder.

@ariel-phet said we can proceed with creating the icons repo and creating the thin wrappers (create Shape, use default transform), linting, etc.

@ariel-phet said we may volunteer someone for this in the new year. Or if someone wants to go for it, make a note in the issue, and go for it!

@pixelzoom I could do it quickly, but would prefer to wait to hear about licensing.

pixelzoom commented 3 years ago

@Denz1994 mentioned that PhET's solution should consider the upcoming FA6 release. That's a great point, because apparently FA6 is going to have a different license than FA5. From the FAQ at https://fontawesome.com/6:

I already have a Font Awesome 5 license. Will Version 6 require a new one?

We still support a number of older licenses from our Kickstarter and Pre-release of Version 5 days. But those have different terms than the one you will need to use Font Awesome 6. You can continue to use Font Awesome 5 under the old licenses but will have to adhere to the terms of the Font Awesome Pro license for any use of Font Awesome 6.

Maybe this applies only to FA Pro users? I can't find any info on FA6 Free license, and "any use of Font Awesome 6" sure makes it sound like Pro and Free versions will have the same license.

pixelzoom commented 3 years ago

This issue does not seem to be in a "ready for review" state, so I'm removing that label.

Our most recent dev-meeting notes in https://github.com/phetsims/sherpa/issues/81#issuecomment-747684564 say:

@jonathanolson expressed concerns that CC-BY material could not be licensed in a bundle with GPL license. We did see https://creativecommons.org/2015/10/08/cc-by-sa-4-0-now-one-way-compatible-with-gplv3/ which says you can license a GPL thing containing CC-BY. But @ariel-phet said @kathy-phet had reached out to contacts. We noticed the preceding comments mention MIT but not GPL. So @ariel-phet will reach out to @kathy-phet about that.

... so assigning to @ariel-phet for followup with @kathy-phet.

ariel-phet commented 3 years ago

Marking for developer meeting (in case this does not get covered in status meeting)

jbphet commented 3 years ago

Discussed in 1/25/2021 dev meeting, @samreid is going to set up a meeting with @kathy-phet to see if we can come to some final conclusion on this. @jonathanolson will also be included in the discussion.

UPDATE from @samreid: @jessegreenberg indicated he would need icons in about 3 weeks.

samreid commented 3 years ago

I sent a slack message to @kathy-phet and @jonathanolson for scheduling. On hold until we meet.

samreid commented 3 years ago

Summarizing this issue to prepare for our discussion:

Originally, we were incorrectly putting Font Awesome data in sun and marking it with a different copyright. That has been resolved.

Font Awesome 4 was SIL, but it is missing fonts we would like to use, such as the user+gear.

Font Awesome 5 is CC-BY 4.0

There was a recent article from creative commons, saying that even the more restrictive "CC-BY-SA" is one-way compatible with GPL. https://creativecommons.org/2015/10/08/cc-by-sa-4-0-now-one-way-compatible-with-gplv3/. So since we would be using the less-restrictive CC-BY, it seems permissible.

JO said:

A quick read of https://creativecommons.org/licenses/by/4.0/legalcode doesn't seem compatible with the MIT license.

Kathy wrote to a contact at Creative Commons:

Our common code libraries are MIT licensed [...] We moved the svg files into a separate repository so the code has its own and the svg files can still be marked CC-BY. The reply was: Yes - I think your solution is an elegant one.

That conversation did not discuss GPL.

CM volunteered to create the icons repo and creating the thin wrappers (create Shape, use default transform), linting, etc. I think this also includes one-file-per-shape, but he said he would like to wait until after licensing discussions complete.

We also need to discuss FA5 vs 6. FA6 has new icons and new styles.

https://fontawesome.com/6#i-already-have-a-font-awesome-5-license-will-version-6-require-a-new-one [you] have to adhere to the terms of the Font Awesome Pro license for any use of Font Awesome 6.

FA Free says: https://fontawesome.com/license/free

Font Awesome Free is free, open source, and GPL friendly. You can use it for commercial projects, open source projects, or really almost whatever you want.

We've kept attribution comments terse, so we ask that you do not actively work to remove them from files, especially code. They're a great way for folks to learn about Font Awesome.

Here's a file with attribution in the "Free" desktop variety:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M436 160c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h320c26.5 0 48-21.5 48-48v-48h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20zm-68 304H48V48h320v416zM208 256c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm-89.6 128h179.2c12.4 0 22.4-8.6 22.4-19.2v-19.2c0-31.8-30.1-57.6-67.2-57.6-10.8 0-18.7 8-44.8 8-26.9 0-33.4-8-44.8-8-37.1 0-67.2 25.8-67.2 57.6v19.2c0 10.6 10 19.2 22.4 19.2z"/></svg>
pixelzoom commented 3 years ago

CM volunteered to create the icons repo and creating the thin wrappers (create Shape, use default transform), linting, etc. I think this also includes one-file-per-shape, but he said he would like to wait until after licensing discussions complete.

Afraid I'm going to have to back out of this one. I'm getting a little bogged down, and need to (re)focus on Fourier.

samreid commented 3 years ago

Discussion with @jonathanolson @kathy-phet and @samreid

A published sim is licensed as CC-BY. Our libraries are MIT Sim-specific code is GPL to provide PhET some protection from other companies taking and adapting our simulations without sharing it back.

KP: When we publish sims on our website, we package them as CC-BY, so that should be compatible with Font Awesome CC-BY, right? JO: This seems resolve things. Since we only combine the Font Awesome on the build, it doesn't even seem that FA needs to be GPL or MIT compatible. I don't see a conflict. Also, since FA5 says they are GPL friendly on https://fontawesome.com/license/free, it seems completely fine. My concern came from thinking we delivered the sims as GPL--that may have been more problematic. KP: Maybe for the next RC we should check the attributions to make sure they are complete and correct.

We built number-line-operations and confirmed it has the correct FA 4 SIL license attribution.

JO: Since we only deliver sims as CC-BY, we can use any 3rd party licenses that are compatible with CC-BY, right? We don't have to restrict ourselves to using MIT any more, right?

KP: We don't want to use any GPL libraries, we can't take GPL code from another group and include it into our artifacts. Also, we do license PhET-iO artifacts differently. If there is a requirement for it to be open, then we can't.

JO: How do we license the PhET-iO sims?

KP: Those are not openly licensed, just to specific clients who have a license agreement. But CC-BY is compatible with this commercial product.

FA website says:

You can use it for commercial projects, open source projects, or really almost whatever you want.

JO: It will still have the attribution embedded in the PhET-iO sim, right? KP: Yes.

JO: We have tried to keep 3rd party licenses MIT in the past, can/should this be relaxed?
KP: Code is typically not CC-BY, but if you see an asset like that, run it past me.

JO: What would help help the dev team is a list of licenses we are allowed to use for code and for assets. Make it simple for designers and developers to have a quick list we can use.

Can we use: Code: MIT: yes CC-BY-4.0: yes SIL: yes GPL: no Apache 2.0: yes BSD-3: yes BSD-2: yes LGPL: no, JO thinks not compatible because it places constraints on how the artifact can be licensed. Public Domain: yes MPL: unclear, we will evaluate this if/when we see an MPL project we would like to use

assets: CC-BY-4.0: yes Public Domain: yes

Next steps going forward:

SR: Why one "icons" repo? JO: It is overhead to keep creating new repos. KP: Where will we put the PhET-created icons? JO: We put those in scenery-phet or sim code typically. KP: What about just using sherpa for this? JO: That sounds good to me. SR: That sounds preferable to a new "just icons" directory that mixes different icons We will need to make sure sherpa can do linting on its js/ directory.

samreid commented 3 years ago

Scheduling for a brief Thursday check-in to verify the above plan sounds good. If it seems good, we'll ask for volunteers.

samreid commented 3 years ago

I created a file with a table that indicates what licenses can be used as PhET simulation dependencies: https://github.com/phetsims/sherpa/blob/master/compatible-licenses.md

chrisklus commented 3 years ago

From 2/4/21 dev meeting:

No objections - everyone is on board with this.

SR note: The wrapper files should not begin with the CU copyright, but a separate license.

@samreid will take this on and pass it over to @zepumph for review.

samreid commented 3 years ago

@zepumph also mentioned we may not want to use grunt for this, but perhaps just node

samreid commented 3 years ago

I'm at a good commit point, but I don't want to check in "everything" until discussion with a reviewer, because it would be over 3200 files. I'll check in the parts I can, then wait for discussion before doing the rest.

What's complete

Questions for the reviewer

  1. How should we deal with icons that are supposed to take the same footprint, but have different dimensions? For example, a face with a hat might be 300px wide and a face without a hat might be 200px wide. If we set maxWidth=100 on both, then the faces will be very different sizes. Or should we just use scale:... for those cases?
  2. Should we capture the bounding box metadata supplied by Font Awesome? Would it help with the preceding point?
  3. What files from font-awesome should we check in? For reference, the modulified files are 2.1MB in 1618 files (a) the expanded directory 6MB and 1600 files (b) the compressed directory 2.3MB in 1 file (c) Just the JSON file with the metadata 3.3MB in 1 file (d) Don't check anything in? I'd like to be conservative about this so as not to bog down sherpa git history unnecessarily.
  4. By the same token, do we really want to check in all 1600 icon files? Sorry if I am being miserly, but I don't see us using most of these in the near future, and they are easy to generate when needed. Also, when we agreed to "check everything in" I'm not sure we were aware there were 1600+ icons.
  5. Some icons such as JediOrder have rendering path problems. How to deal with these?
  6. The prior version scaled everything down by 0.025 or so, should we do that in this version? If so, why?
  7. Should sherpa be runnable? Have a demo? Where should we put a test harness for this? Do we need one?
  8. Note the changes between FANode and FontAwesomeNode, we no longer cache the shapes, we no longer scale or invert. Are any of those changes important to keep?
  9. By adding font awesome 5 to build.json, every sim will report its licensing, whether it uses icons from it or not. This is how it worked for Font Awesome 4 (but I believe every sim is using at least one font awesome 4 icon). Is this OK or do we want to detect usage before including the license? Or will all sims be using a FA5 icon soon anyways?

Icons that exhibit a failure:

``` Amazon Aviato Bitcoin CanadianMapleLeaf CcAmex CcJcb CcVisa Confluence DAndDBeyond Discord Discourse DumpsterFire Ember Evernote FilePdf FireAlt FirefoxBrowser FreeCodeCamp Frog GithubSquare Grav Gripfire Grunt Hooli Hornbill ItchIo ItunesNote Java JediOrder Jira Keycdn KissWinkHeart Language Lastfm Lyft Mdb Napster Odnoklassniki Pagelines Paypal Phabricator PinterestSquare Playstation Pushed PuzzlePiece RProject Rebel Ribbon Rockrms Salesforce Sass Shopify Studiovinari StumbleuponCircle Usps Viber Vnv WatchmanMonitoring Wix WizardsOfTheCoast Wordpress Yarn YoutubeSquare Zhihu ```

Demo

```diff Index: js/view/CCKCScreenView.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/js/view/CCKCScreenView.js b/js/view/CCKCScreenView.js --- a/js/view/CCKCScreenView.js (revision 4fed48e3c19da4a24ca841557cc88d3d23cfb18b) +++ b/js/view/CCKCScreenView.js (date 1612550239152) @@ -17,10 +17,13 @@ import StopwatchNode from '../../../scenery-phet/js/StopwatchNode.js'; import TimeControlNode from '../../../scenery-phet/js/TimeControlNode.js'; import KeyboardUtils from '../../../scenery/js/accessibility/KeyboardUtils.js'; +import DragListener from '../../../scenery/js/listeners/DragListener.js'; import AlignBox from '../../../scenery/js/nodes/AlignBox.js'; import AlignGroup from '../../../scenery/js/nodes/AlignGroup.js'; +import HBox from '../../../scenery/js/nodes/HBox.js'; import Node from '../../../scenery/js/nodes/Node.js'; import VBox from '../../../scenery/js/nodes/VBox.js'; +import iconList from '../../../sherpa/js/fontawesome-5/iconList.js'; import Tandem from '../../../tandem/js/Tandem.js'; import CCKCConstants from '../CCKCConstants.js'; import CCKCQueryParameters from '../CCKCQueryParameters.js'; @@ -426,6 +429,34 @@ } model.stepEmitter.addListener( dt => this.stepOnce( dt ) ); + + const iconAlignGroup = new AlignGroup(); + const icons = iconList.map( Icon => { + try { + return new Icon( { + maxWidth: 75, maxHeight: 75, + fill: 'black' + // fill: new Color( Math.round( Math.random() * 255 ), Math.round( Math.random() * 255 ),Math.round( Math.random() * 255 ) + } ); + } + catch( e ) { + console.log( 'failure on ' + Icon.name ); + return null; + } + } ).filter( n => n !== null ).map( node => iconAlignGroup.createBox( node, {} ) ); + const groups = _.chunk( icons, 12 ).map( g => new HBox( { spacing: 1, children: g } ) ); + const node = new Node( { + children: [ new VBox( { spacing: 1, children: groups, centerTop: this.layoutBounds.centerTop } ) ] + } ).rasterized({ + resolution: 2 + }); + this.addChild( node ); + node.mouseArea = node.localBounds.dilated( 2 ); + node.touchArea = node.localBounds.dilated( 2 ); + node.cursor = 'pointer'; + node.addInputListener( new DragListener( { + translateNode: true + } ) ); } // @public - called from model steps ```

image

zepumph commented 3 years ago

Should sherpa be runnable? Have a demo? Where should we put a test harness for this? Do we need one?

I don't think we should build out sherpa to be runnable. To me this feels like a scenery-phet thing, since that is where these font-awesome icons are used (in phet sims). If you want to create a sherpa demo though, that's fine.

zepumph commented 3 years ago

Discussed with @samreid, he will do a bit more work before my review.

samreid commented 3 years ago

I pushed icons.json from fontawesome, keeping the same directory structure in case we later decide to commit more of that library.

In discussion, @zepumph and I agreed to commit and push all font awesome icons. However, some are having Shape assembly errors, so I'll leave those off of the master list for now.

It added a 5 second delay to start up scenery-phet, so @zepumph and I discussed adding it as an isolated scenery test.

samreid commented 3 years ago

I added a scrollable, zoomable test at scenery/tests/fontawesome5.html. I think everything is all set for review. @zepumph please let me know if I've missed anything.

zepumph commented 3 years ago

Sherpa was not linted because of this line (and others) https://github.com/phetsims/chipper/blob/6e4d288b017138d901e982e75638b22e9fc5eeb0/js/grunt/lint.js#L30. I noticed you added an eslintignore file, but I couldn't get our linter to work with multiple eslintignore files. Perhaps just a defect of the NodeAPI we use in lint.js (which takes an arg of a single ignore file). I updated the project to lint sherpa, and I added a top level eslintrc file in sherpa that is set up to ignore the necessary files. please review.

fontawesome5.html is very cool. Can you describe the use of it? Is it to test that the icons work? I don't see a way to use that to pick my icon, as I don't know how to go from icon to name. Likely this isn't the purpose of the html scrap. Do you want to do anything with this? Load it on CT? Perhaps like:

Index: js/listContinuousTests.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/listContinuousTests.js b/js/listContinuousTests.js
--- a/js/listContinuousTests.js (revision 85ccba1aa6c5d75f685e6c3ac86540b52dac7bdc)
+++ b/js/listContinuousTests.js (date 1613526983532)
@@ -275,7 +275,8 @@
       'tests/',
       'tests/playground.html',
       'tests/renderer-comparison.html?renderers=canvas,svg,dom',
-      'tests/text-quality-test.html'
+      'tests/text-quality-test.html',
+      'tests/fontawesome5.html'
     ]
   }
 ].forEach( ( { repo, urls } ) => {

It looks like https://github.com/phetsims/sherpa/issues/83 is for discussing if we get rid of all font awesome 4 content in the project. Without knowing any of the details, it would be nice to do that!

Swapping the import lines for the individual generated icons' template means that the output icons don't change when autoformatting. Please review my commit.

Thanks for doing all this awesome work!

samreid commented 3 years ago

sherpa/.eslintrc.js looks great, I tried commenting out a line to see that font awesome would be linted and it worked as expected, thanks!

fontawesome5.html was developed as a manual test harness to see if all the icons could render. It helped us identify this issue: https://github.com/phetsims/kite/issues/88. I don't think it should be added to CT--it takes too long to run and would be testing code that is unlikely to change.

I think we covered everything, back to @zepumph to close if we are all set.