Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download Google fonts from github, not broken Google fonts download url #57153

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

nyalldawson
Copy link
Collaborator

Note that not all fonts available from Google fonts are present on the github repo for some reason, eg Open Sans Condensed is not.

Fixes #57070

Note that not all fonts available from Google fonts are present on
the github repo for some reason, eg Open Sans Condensed is not.

Fixes qgis#57070
@github-actions github-actions bot added this to the 3.38.0 milestone Apr 15, 2024
Copy link
Contributor

@nirvn nirvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's hope it'll last for an eternity.

Ideally we need this backported to restore functionality in 3.36 and LTR 3.34

@nyalldawson nyalldawson merged commit 5e85f29 into qgis:master Apr 18, 2024
30 checks passed
@nyalldawson
Copy link
Collaborator Author

Ideally we need this backported to restore functionality in 3.36 and LTR 3.34

I'll try to remember to do this in a couple of months :)

@nyalldawson nyalldawson deleted the fix_google_font_download branch April 18, 2024 01:32
@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented May 14, 2024

@nyalldawson, it seems to me the issue still occurs even using recent builds on Windows.

The following warning are still displayed and the "fonts" folder is still empty:

WARNING Open Sans font installation failed
WARNING Error opening zip archive: 'C:/Users/Andrea/AppData/Local/Temp/QGIS3.inRUfS' (Error code: 19)

See the following connection log:

  {
    "Bytes Received": 0,
    "Bytes Total": 0,
    "Cache (control)": "Load from cache if available, otherwise load from network",
    "Cache (save)": "Can store result in cache",
    "Headers": {
      "User-Agent": "Mozilla/5.0 QGIS/33700/Windows 10 Version 1903"
    },
    "ID": "src/core/textrenderer/qgsfontmanager.cpp:2090 (run)",
    "Initiator": "QgsFontDownloadTask",
    "Operation": "GET",
    "Replies": 1,
    "Reply": {
      "Cache (result)": "Read from network",
      "Headers": {
        "Access-Control-Allow-Origin": "",
        "Cache-Control": "no-cache",
        "Content-Length": "0",
        "Content-Security-Policy": "default-src 'none'; base-uri 'self'; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com api.githubcopilot.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/",
        "Content-Type": "text/html; charset=utf-8",
        "Date": "Tue, 14 May 2024 23:26:11 GMT",
        "Location": "https://raw.githubusercontent.com/google/fonts/main/ofl/opensans/OpenSans%5Bwdth%2Cwght%5D.ttf",
        "Referrer-Policy": "no-referrer-when-downgrade",
        "Server": "GitHub.com",
        "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
        "Vary": "X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With",
        "X-Content-Type-Options": "nosniff",
        "X-Frame-Options": "deny",
        "X-GitHub-Request-Id": "CB85:2AA6A8:494223:4AC4C1:6643F340",
        "X-XSS-Protection": "0"
      },
      "Status": "302"
    },
    "Thread": "0x00000252ae088270",
    "Total time (ms)": 303,
    "URL": "https://github.com/google/fonts/raw/main/ofl/opensans/OpenSans[wdth,wght].ttf"
  },
  {
    "Bytes Received": 0,
    "Bytes Total": 532636,
    "Cache (control)": "Load from cache if available, otherwise load from network",
    "Cache (save)": "Can store result in cache",
    "Headers": {
      "User-Agent": "Mozilla/5.0 QGIS/33700/Windows 10 Version 1903"
    },
    "Initiator": "unknown",
    "Operation": "GET",
    "Replies": 2,
    "Reply": {
      "Cache (result)": "Used entry from cache",
      "Headers": {
        "Accept-Ranges": "bytes",
        "Access-Control-Allow-Origin": "*",
        "Content-Length": "532636",
        "Content-Security-Policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
        "Content-Type": "application/octet-stream",
        "Cross-Origin-Resource-Policy": "cross-origin",
        "Date": "Tue, 14 May 2024 23:22:31 GMT",
        "ETag": "W/\"43cfa2ae7e736f491a167297b214d2e2bd8ae764313cdb2553062beb70a63dbc\"",
        "Expires": "Tue, 14 May 2024 23:27:31 GMT",
        "Source-Age": "0",
        "Strict-Transport-Security": "max-age=31536000",
        "Vary": "Authorization,Accept-Encoding,Origin",
        "Via": "1.1 varnish",
        "X-Cache": "MISS",
        "X-Cache-Hits": "0",
        "X-Content-Type-Options": "nosniff",
        "X-Fastly-Request-ID": "ecbbd3ad5dbeb45593fafbc34adbdea3cbadcf55",
        "X-Frame-Options": "deny",
        "X-GitHub-Request-Id": "E204:926C0:FFB07E:10FEB5C:664142D8",
        "X-Served-By": "cache-lin1730060-LIN",
        "X-Timer": "S1715728952.633673,VS0,VE313",
        "X-XSS-Protection": "1; mode=block"
      },
      "Status": "200"
    },
    "Thread": "0x00000252ae088270",
    "Total time (ms)": 5,
    "URL": "https://raw.githubusercontent.com/google/fonts/main/ofl/opensans/OpenSans%5Bwdth%2Cwght%5D.ttf"
  },
  {
    "Bytes Received": 0,
    "Bytes Total": 0,
    "Cache (control)": "Load from cache if available, otherwise load from network",
    "Cache (save)": "Can store result in cache",
    "Headers": {
      "User-Agent": "Mozilla/5.0 QGIS/33700/Windows 10 Version 1903"
    },
    "ID": "src/core/textrenderer/qgsfontmanager.cpp:2090 (run)",
    "Initiator": "QgsFontDownloadTask",
    "Operation": "GET",
    "Replies": 1,
    "Reply": {
      "Cache (result)": "Read from network",
      "Headers": {
        "Access-Control-Allow-Origin": "",
        "Cache-Control": "no-cache",
        "Content-Length": "0",
        "Content-Security-Policy": "default-src 'none'; base-uri 'self'; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com api.githubcopilot.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/",
        "Content-Type": "text/html; charset=utf-8",
        "Date": "Tue, 14 May 2024 23:26:11 GMT",
        "Location": "https://raw.githubusercontent.com/google/fonts/main/ofl/opensans/OpenSans-Italic%5Bwdth%2Cwght%5D.ttf",
        "Referrer-Policy": "no-referrer-when-downgrade",
        "Server": "GitHub.com",
        "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
        "Vary": "X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With",
        "X-Content-Type-Options": "nosniff",
        "X-Frame-Options": "deny",
        "X-GitHub-Request-Id": "CB85:2AA6A8:49429F:4AC555:6643F340",
        "X-XSS-Protection": "0"
      },
      "Status": "302"
    },
    "Thread": "0x00000252ae088270",
    "Total time (ms)": 188,
    "URL": "https://github.com/google/fonts/raw/main/ofl/opensans/OpenSans-Italic[wdth,wght].ttf"
  },
  {
    "Bytes Received": 0,
    "Bytes Total": 583992,
    "Cache (control)": "Load from cache if available, otherwise load from network",
    "Cache (save)": "Can store result in cache",
    "Headers": {
      "User-Agent": "Mozilla/5.0 QGIS/33700/Windows 10 Version 1903"
    },
    "Initiator": "unknown",
    "Operation": "GET",
    "Replies": 2,
    "Reply": {
      "Cache (result)": "Used entry from cache",
      "Headers": {
        "Accept-Ranges": "bytes",
        "Access-Control-Allow-Origin": "*",
        "Content-Length": "583992",
        "Content-Security-Policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
        "Content-Type": "application/octet-stream",
        "Cross-Origin-Resource-Policy": "cross-origin",
        "Date": "Tue, 14 May 2024 23:22:32 GMT",
        "ETag": "W/\"979e5b9b35593a390672afe0163c0c5a9f91f04285006fcb10e391cace5195c6\"",
        "Expires": "Tue, 14 May 2024 23:27:32 GMT",
        "Source-Age": "0",
        "Strict-Transport-Security": "max-age=31536000",
        "Vary": "Authorization,Accept-Encoding,Origin",
        "Via": "1.1 varnish",
        "X-Cache": "MISS",
        "X-Cache-Hits": "0",
        "X-Content-Type-Options": "nosniff",
        "X-Fastly-Request-ID": "1ec81bf56344739fc340672c856652aba5f5e0f1",
        "X-Frame-Options": "deny",
        "X-GitHub-Request-Id": "B29C:B3E23:BD4806:C85A33:664142DA",
        "X-Served-By": "cache-lin1730060-LIN",
        "X-Timer": "S1715728953.581637,VS0,VE229",
        "X-XSS-Protection": "1; mode=block"
      },
      "Status": "200"
    },
    "Thread": "0x00000252ae088270",
    "Total time (ms)": 5,
    "URL": "https://raw.githubusercontent.com/google/fonts/main/ofl/opensans/OpenSans-Italic%5Bwdth%2Cwght%5D.ttf"
  },
  {
    "Bytes Received": 0,
    "Bytes Total": 0,
    "Cache (control)": "Load from cache if available, otherwise load from network",
    "Cache (save)": "Can store result in cache",
    "Headers": {
      "User-Agent": "Mozilla/5.0 QGIS/33700/Windows 10 Version 1903"
    },
    "ID": "src/core/textrenderer/qgsfontmanager.cpp:2115 (run)",
    "Initiator": "QgsFontDownloadTask",
    "Operation": "GET",
    "Replies": 1,
    "Reply": {
      "Cache (result)": "Read from network",
      "Headers": {
        "Access-Control-Allow-Origin": "",
        "Cache-Control": "no-cache",
        "Content-Length": "0",
        "Content-Security-Policy": "default-src 'none'; base-uri 'self'; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com api.githubcopilot.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/",
        "Content-Type": "text/html; charset=utf-8",
        "Date": "Tue, 14 May 2024 23:26:12 GMT",
        "Location": "https://raw.githubusercontent.com/google/fonts/main/ofl/opensans/OFL.txt",
        "Referrer-Policy": "no-referrer-when-downgrade",
        "Server": "GitHub.com",
        "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
        "Vary": "X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With",
        "X-Content-Type-Options": "nosniff",
        "X-Frame-Options": "deny",
        "X-GitHub-Request-Id": "CB85:2AA6A8:494330:4AC5EE:6643F340",
        "X-XSS-Protection": "0"
      },
      "Status": "302"
    },
    "Thread": "0x00000252ae088270",
    "Total time (ms)": 158,
    "URL": "https://github.com/google/fonts/raw/main/ofl/opensans/OFL.txt"
  },
  {
    "Bytes Received": 0,
    "Bytes Total": 0,
    "Cache (control)": "Load from cache if available, otherwise load from network",
    "Cache (save)": "Can store result in cache",
    "Headers": {
      "User-Agent": "Mozilla/5.0 QGIS/33700/Windows 10 Version 1903"
    },
    "Initiator": "unknown",
    "Operation": "GET",
    "Replies": 2,
    "Reply": {
      "Cache (result)": "Used entry from cache",
      "Headers": {
        "Accept-Ranges": "bytes",
        "Access-Control-Allow-Origin": "*",
        "Content-Encoding": "gzip",
        "Content-Security-Policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
        "Content-Type": "text/plain; charset=utf-8",
        "Cross-Origin-Resource-Policy": "cross-origin",
        "Date": "Tue, 14 May 2024 23:22:33 GMT",
        "ETag": "W/\"9eb464e7bdc26b365f9cc1f4ad0f51128a9706a6cb834b452297943726bedec8\"",
        "Expires": "Tue, 14 May 2024 23:27:33 GMT",
        "Source-Age": "0",
        "Strict-Transport-Security": "max-age=31536000",
        "Vary": "Authorization,Accept-Encoding,Origin",
        "Via": "1.1 varnish",
        "X-Cache": "MISS",
        "X-Cache-Hits": "0",
        "X-Content-Type-Options": "nosniff",
        "X-Fastly-Request-ID": "0e97347e8684c584cb119f6c5bb8e005f6a07e0f",
        "X-Frame-Options": "deny",
        "X-GitHub-Request-Id": "19A4:2D83F3:21FD7EC:23F54C5:66415977",
        "X-Served-By": "cache-lin1730060-LIN",
        "X-Timer": "S1715728953.272308,VS0,VE197",
        "X-XSS-Protection": "1; mode=block"
      },
      "Status": "200"
    },
    "Thread": "0x00000252ae088270",
    "Total time (ms)": 4,
    "URL": "https://raw.githubusercontent.com/google/fonts/main/ofl/opensans/OFL.txt"
  }

@nyalldawson
Copy link
Collaborator Author

@agiudiceandrea
some of those replies are showing 0 bytes received -- looks like the download didn't happen correctly.

@agiudiceandrea
Copy link
Contributor

some of those replies are showing 0 bytes received -- looks like the download didn't happen correctly.

Do you think it may be a connection issue on my side? The issue is consistent, while other QGIS connections (plugins, feed, OGC servers, ...) work well.

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented May 25, 2024

The issue still occurs on my Windows 10 Home 64-bit using the latest QGIS 3.37.0-Master b2a8801 (OSGeo4W). Maybe on Windows QGIS is not able to follow the redirection?

@agiudiceandrea
Copy link
Contributor

The issue still occur using QGIS 3.38.0 (OSGeo4W) on Windows with a new QGIS user profile.

@agiudiceandrea
Copy link
Contributor

Ideally we need this backported to restore functionality in 3.36 and LTR 3.34

I'll try to remember to do this in a couple of months :)

Hi @nyalldawson do you remember to backport this PR and #57844 to release-3_34 branch?

@agiudiceandrea
Copy link
Contributor

Ideally we need this backported to restore functionality in 3.36 and LTR 3.34

I'll try to remember to do this in a couple of months :)

Hi @nyalldawson do you remember to backport this PR and #57844 to release-3_34 branch?

See #58524.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Open Sans font installation failed
4 participants