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

Font endpoint gives 404 but the font seems loaded #1284

Closed
jacopofar opened this issue Apr 3, 2024 · 2 comments
Closed

Font endpoint gives 404 but the font seems loaded #1284

jacopofar opened this issue Apr 3, 2024 · 2 comments
Labels

Comments

@jacopofar
Copy link

Hello,
I'm trying to use the (very useful!) font conversion/serving function of Martin, but am facing some problem which may have to do with the spaces in the font name.

If I start martin with -f Noto_Sans, I see in the log it loaded it:

[2024-04-03T13:12:06Z INFO martin::fonts] Configured font Noto Sans Black with 3006 glyphs (0000-FFFD) from Noto_Sans/static/NotoSans-Black.ttf

and indeed I see them under /catalog:

[...]
"fonts": {
    "Noto Sans Black": {
      "family": "Noto Sans",
      "style": "Black",
      "glyphs": 3006,
      "start": 0,
      "end": 65533
    },
    "Noto Sans Black Italic": {
      "family": "Noto Sans",
      "style": "Black Italic",
      "glyphs": 3003,
      "start": 0,
      "end": 65533
    },
[...]

yet I get a 404 trying to load them:

curl -v "http://localhost:3000/fonts/Noto%20Sans%20Black/0-255.pbf
...
< HTTP/1.1 404 Not Found

I tried changing the name of the file to remove spaces, but it seems Martin is using the metadata inside the file itself, and I'm not sure that's even the source of the issue. Am I missing something?

@sharkAndshark
Copy link
Collaborator

Hi @jacopofar Have a good day!
There is no .pbf on the request url. See doc.

zhangyijun@zhangyijundeMacBook-Pro Noto_Sans % martin -f /Users/zhangyijun/Downloads/Noto_Sans
[2024-04-08T14:43:36Z INFO  martin] Starting Martin v0.13.0
[2024-04-08T14:43:36Z INFO  martin] Config file is not specified, auto-detecting sources
[2024-04-08T14:43:36Z INFO  martin::config] Initializing main cache with maximum size 536870912B
[2024-04-08T14:43:36Z INFO  martin::fonts] Configured font Noto Sans Black with 3006 glyphs (0000-FFFD) from /Users/zhangyijun/Downloads/Noto_Sans/static/NotoSans-Black.ttf
[2024-04-08T14:43:36Z INFO  martin] Use --save-config to save or print Martin configuration.
[2024-04-08T14:43:36Z INFO  martin] Martin has been started on 0.0.0.0:3000.
[2024-04-08T14:43:36Z INFO  martin] Use http://0.0.0.0:3000/catalog to get the list of available sources.
...

And I tried this font either. It works.
Screenshot 2024-04-08 at 10 50 11 PM

@jacopofar
Copy link
Author

You are right -_-

Additionally, my URL had /fonts/ in the path, not /font/. Changing these two things made it work.

Thanks for checking it!

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

No branches or pull requests

2 participants