gravitystorm / openstreetmap-carto

A general-purpose OpenStreetMap mapnik style, in CartoCSS
Other
1.53k stars 819 forks source link

`get-fonts` fails, due to fonts.google.com not returning a zip. #5013

Open amandasaurus opened 1 week ago

amandasaurus commented 1 week ago

The scripts/get-fonts.sh fails.

The problem appears to be line 124 where it attempts to download the Noto Emoji font as a zip from https://fonts.google.com/download?family=Noto%20Emoji. However fonts.google.com now returns a HTML page, not a zip file.

When you open the page in a browser, Google has a nice download page and a “Download zip file” appears and you can do that in the browser. However I can't see the proper URL in my web browser network tab.

Dimitar5555 commented 1 week ago

The individual file URLs are hidden in a JSON file. Not sure where the ZIP file is coming from.

https://fonts.google.com/download/list?family=Noto%20Emoji

)]}'
{
  "zipName": "Noto_Emoji.zip",
  "manifest": {
    "files": [
      {
        "filename": "OFL.txt",
        "contents": "Copyright 2013 Google LLC\r\n\r\nThis Font Software is licensed under the SIL Open Font License, Version 1.1.\r\nThis license is copied below, and is also available with a FAQ at:\r\nhttps://openfontlicense.org\r\n\r\n\r\n-----------------------------------------------------------\r\nSIL OPEN FONT LICENSE Version 1.1 - 26 February 2007\r\n-----------------------------------------------------------\r\n\r\nPREAMBLE\r\nThe goals of the Open Font License (OFL) are to stimulate worldwide\r\ndevelopment of collaborative font projects, to support the font creation\r\nefforts of academic and linguistic communities, and to provide a free and\r\nopen framework in which fonts may be shared and improved in partnership\r\nwith others.\r\n\r\nThe OFL allows the licensed fonts to be used, studied, modified and\r\nredistributed freely as long as they are not sold by themselves. The\r\nfonts, including any derivative works, can be bundled, embedded, \r\nredistributed and/or sold with any software provided that any reserved\r\nnames are not used by derivative works. The fonts and derivatives,\r\nhowever, cannot be released under any other type of license. The\r\nrequirement for fonts to remain under this license does not apply\r\nto any document created using the fonts or their derivatives.\r\n\r\nDEFINITIONS\r\n\"Font Software\" refers to the set of files released by the Copyright\r\nHolder(s) under this license and clearly marked as such. This may\r\ninclude source files, build scripts and documentation.\r\n\r\n\"Reserved Font Name\" refers to any names specified as such after the\r\ncopyright statement(s).\r\n\r\n\"Original Version\" refers to the collection of Font Software components as\r\ndistributed by the Copyright Holder(s).\r\n\r\n\"Modified Version\" refers to any derivative made by adding to, deleting,\r\nor substituting -- in part or in whole -- any of the components of the\r\nOriginal Version, by changing formats or by porting the Font Software to a\r\nnew environment.\r\n\r\n\"Author\" refers to any designer, engineer, programmer, technical\r\nwriter or other person who contributed to the Font Software.\r\n\r\nPERMISSION \u0026 CONDITIONS\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of the Font Software, to use, study, copy, merge, embed, modify,\r\nredistribute, and sell modified and unmodified copies of the Font\r\nSoftware, subject to the following conditions:\r\n\r\n1) Neither the Font Software nor any of its individual components,\r\nin Original or Modified Versions, may be sold by itself.\r\n\r\n2) Original or Modified Versions of the Font Software may be bundled,\r\nredistributed and/or sold with any software, provided that each copy\r\ncontains the above copyright notice and this license. These can be\r\nincluded either as stand-alone text files, human-readable headers or\r\nin the appropriate machine-readable metadata fields within text or\r\nbinary files as long as those fields can be easily viewed by the user.\r\n\r\n3) No Modified Version of the Font Software may use the Reserved Font\r\nName(s) unless explicit written permission is granted by the corresponding\r\nCopyright Holder. This restriction only applies to the primary font name as\r\npresented to the users.\r\n\r\n4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font\r\nSoftware shall not be used to promote, endorse or advertise any\r\nModified Version, except to acknowledge the contribution(s) of the\r\nCopyright Holder(s) and the Author(s) or with their explicit written\r\npermission.\r\n\r\n5) The Font Software, modified or unmodified, in part or in whole,\r\nmust be distributed entirely under this license, and must not be\r\ndistributed under any other license. The requirement for fonts to\r\nremain under this license does not apply to any document created\r\nusing the Font Software.\r\n\r\nTERMINATION\r\nThis license becomes null and void if any of the above conditions are\r\nnot met.\r\n\r\nDISCLAIMER\r\nTHE FONT SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT\r\nOF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE\r\nCOPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\nINCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL\r\nDAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r\nFROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM\r\nOTHER DEALINGS IN THE FONT SOFTWARE.\r\n"
      },
      {
        "filename": "README.txt",
        "contents": "Noto Emoji Variable Font\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nThis download contains Noto Emoji as both a variable font and static fonts.\n\nNoto Emoji is a variable font with this axis:\n  wght\n\nThis means all the styles are contained in a single file:\n  NotoEmoji-VariableFont_wght.ttf\n\nIf your app fully supports variable fonts, you can now pick intermediate styles\nthat aren’t available as static fonts. Not all apps support variable fonts, and\nin those cases you can use the static font files for Noto Emoji:\n  static/NotoEmoji-Light.ttf\n  static/NotoEmoji-Regular.ttf\n  static/NotoEmoji-Medium.ttf\n  static/NotoEmoji-SemiBold.ttf\n  static/NotoEmoji-Bold.ttf\n\nGet started\n-----------\n\n1. Install the font files you want to use\n\n2. Use your app\u0027s font picker to view the font family and all the\navailable styles\n\nLearn more about variable fonts\n-------------------------------\n\n  https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts\n  https://variablefonts.typenetwork.com\n  https://medium.com/variable-fonts\n\nIn desktop apps\n\n  https://theblog.adobe.com/can-variable-fonts-illustrator-cc\n  https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts\n\nOnline\n\n  https://developers.google.com/fonts/docs/getting_started\n  https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide\n  https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts\n\nInstalling fonts\n\n  MacOS: https://support.apple.com/en-us/HT201749\n  Linux: https://www.google.com/search?q\u003dhow+to+install+a+font+on+gnu%2Blinux\n  Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows\n\nAndroid Apps\n\n  https://developers.google.com/fonts/docs/android\n  https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts\n\nLicense\n-------\nPlease read the full license text (OFL.txt) to understand the permissions,\nrestrictions and requirements for usage, redistribution, and modification.\n\nYou can use them in your products \u0026 projects – print or digital,\ncommercial or otherwise.\n\nThis isn\u0027t legal advice, please consider consulting a lawyer and see the full\nlicense for all details.\n"
      }
    ],
    "fileRefs": [
      {
        "filename": "static/NotoEmoji-Light.ttf",
        "url": "https://fonts.gstatic.com/s/notoemoji/v50/bMrnmSyK7YY-MEu6aWjPDs-ar6uWaGWuob_10jwvS-FGJCMY.ttf",
        "date": {
          "seconds": 1718059252,
          "nanos": 829000000
        }
      },
      {
        "filename": "static/NotoEmoji-Regular.ttf",
        "url": "https://fonts.gstatic.com/s/notoemoji/v50/bMrnmSyK7YY-MEu6aWjPDs-ar6uWaGWuob-r0jwvS-FGJCMY.ttf",
        "date": {
          "seconds": 1718059252,
          "nanos": 829000000
        }
      },
      {
        "filename": "static/NotoEmoji-Medium.ttf",
        "url": "https://fonts.gstatic.com/s/notoemoji/v50/bMrnmSyK7YY-MEu6aWjPDs-ar6uWaGWuob-Z0jwvS-FGJCMY.ttf",
        "date": {
          "seconds": 1718059252,
          "nanos": 829000000
        }
      },
      {
        "filename": "static/NotoEmoji-SemiBold.ttf",
        "url": "https://fonts.gstatic.com/s/notoemoji/v50/bMrnmSyK7YY-MEu6aWjPDs-ar6uWaGWuob911TwvS-FGJCMY.ttf",
        "date": {
          "seconds": 1718059252,
          "nanos": 829000000
        }
      },
      {
        "filename": "static/NotoEmoji-Bold.ttf",
        "url": "https://fonts.gstatic.com/s/notoemoji/v50/bMrnmSyK7YY-MEu6aWjPDs-ar6uWaGWuob9M1TwvS-FGJCMY.ttf",
        "date": {
          "seconds": 1718059252,
          "nanos": 829000000
        }
      },
      {
        "filename": "NotoEmoji-VariableFont_wght.ttf",
        "url": "https://fonts.gstatic.com/s/notoemoji/v50/bMrymSyK7YY-MEu6aWjPFMS4X3MKy2M.ttf",
        "date": {
          "seconds": 1718059252,
          "nanos": 829000000
        }
      }
    ]
  }
}
imagico commented 1 week ago

Seems like a re-surfacing of #4956. Someone will need to rework the font downloads, researching reliable sources, preferably with fallbacks for added robustness. #4893 provides a lot of groundwork already. This needs an in-depth review.