rapi-doc / RapiDoc

RapiDoc -WebComponent for OpenAPI Spec
https://rapidocweb.com
MIT License
1.71k stars 285 forks source link

Font rendering is different in examples #992

Closed CoenraadS closed 11 months ago

CoenraadS commented 11 months ago

Hello

On my api page, the font was too thin/low contrast for me to read, while on the example page it looked fine.

I was then comparing the Font Style and Font Size pages, and noticed the same problem

image

On the left is the Font Style page, using Open Sans

On the right is the Font-Size page, using Default Size (also Open Sans)

I checked via HTML Inspector, and as far as I can see, all the fonts, sizes etc are the same. But the text on the right is clearly a bit bolder (and I am trying to achieve this look locally, but mine looks like on the left)

I checked both Firefox and Edge, and it occurs in both.

CoenraadS commented 11 months ago

Turns out the thin font is loaded from https://fonts.gstatic.com/s/opensans/v40/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTVOmu1aB.woff2

While the thicker font is from: https://fonts.gstatic.com/s/opensans/v40/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTS-muw.woff2

Is there any way I can specify to use the latter url?

CoenraadS commented 11 months ago

I added the following line to make it look like the example:

<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&amp;family=Roboto+Mono&amp;display=swap" rel="stylesheet">