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

Preserve case in axis names #138

Closed
BackThePortal opened this issue Jun 26, 2023 · 0 comments · Fixed by datalogix/google-fonts-helper#46
Closed

Preserve case in axis names #138

BackThePortal opened this issue Jun 26, 2023 · 0 comments · Fixed by datalogix/google-fonts-helper#46

Comments

@BackThePortal
Copy link

In fonts such as Geologica, one of the axis (in that case, sharpness) for some reason requires its name to be written in capitals in the URL.

In Google Fonts, getting a style of Geologica with the sharpness set to 75 returns this URL:

https://fonts.googleapis.com/css2?family=Geologica:SHRP@75&display=swap

However, when using this module with, for example, the following configuration:

families: {
	Geologica: {
		wght: [200, 400],
		SHRP: [75],
		},
	},
},

I get the following error:

 ERROR   (400 Bad Request (https://fonts.googleapis.com/css2?family=Geologica:shrp,wght@0,200;0,400;1,75&display=swap))                                                                                                                                                               nuxt:google-fonts 9:42:20 PM

  at processTicksAndRejections (node:internal/process/task_queues:96:5)
  at async $fetch2 (node_modules/ofetch/dist/shared/ofetch.d438bb6f.mjs:239:15)
  at async Downloader.execute (node_modules/google-fonts-helper/dist/index.mjs:181:24)
  at async setup (node_modules/@nuxtjs/google-fonts/dist/module.mjs:60:9)
  at async normalizedModule (node_modules/@nuxt/kit/dist/index.mjs:2140:17)
  at async installModule (node_modules/@nuxt/kit/dist/index.mjs:2409:95)
  at async initNuxt (node_modules/nuxt/dist/index.mjs:3164:7)
  at async load (node_modules/nuxi/dist/chunks/dev.mjs:204:9)
  at async _applyPromised (node_modules/nuxi/dist/chunks/dev.mjs:96:10)

Note how the 'SHRP' got changed to 'shrp'. These requests are case sensitive, and this change causes the error.

To fix this, capitals need to be preserved when creating the URL.

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 a pull request may close this issue.

1 participant