google / google/fonts

API Response Suggestion

Open
#7,527 0 comments 0 reactions 1 assignee Claimed by @m4rc1e View on GitHub
I API / Website / Platform I Request I Tools / workflow / repo
Dominant language
HTML
Stars
20.5k
Forks
2.9k
Avg merge
1d 21h
Merged PRs (30d)
95

Description

**Describe the issue**
The naming convention for the regular weight doesn't align with the rest of the style names.

**To Reproduce**
Here's the API response after fetching the "Roboto" font family

```
{
"kind": "webfonts#webfontList",
"items": [
{
"family": "Roboto",
"variants": [
"100",
"100italic",
"300",
"300italic",
"regular", --------------------->> This can be 400
"italic", --------------------->> This can be 400italic
"500",
"500italic",
"700",
"700italic",
"900",
"900italic"
],
"files": {
"100": "https://fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1MmgWxPKTM1K9nz.ttf",
"100italic": "https://fonts.gstatic.com/s/roboto/v30/KFOiCnqEu92Fr1Mu51QrIzcXLsnzjYk.ttf",
"300": "https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5vAx05IsDqlA.ttf",
"300italic": "https://fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjARc9AMX6lJBP.ttf",
"regular": "https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf", -------------->> This can be 400
"italic": "https://fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu52xPKTM1K9nz.ttf", -------------->> This can be 400italic
"500": "https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9vAx05IsDqlA.ttf",
"500italic": "https://fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51S7ABc9AMX6lJBP.ttf",
"700": "https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlvAx05IsDqlA.ttf",
"700italic": "https://fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBhc9AMX6lJBP.ttf",
"900": "https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmYUtvAx05IsDqlA.ttf",
"900italic": "https://fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TLBBc9AMX6lJBP.ttf"
}
}
]
}
```

**Expected behavior**
The regular weight could be labeled simply as "400" to harmonize with the other weight values. Weight 400 is equivalent to the regular weight. This adjustment would eliminate the need for additional, complex code to map "regular" to 400.

**Additional Context**
I understand that these names are decided carefully and for a reason. Please consider this as constructive feedback.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.