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
Inconsistent font in example generation #3369
Comments
This raise a fair point. The documentation NEEDS to be 100% "reproducible" regardless of the system used to build it. I guess we don't need to force the font used for text in the HTML pages (this is insane). We should focus only on the font used by generated images. I'm favorable to use Noto. The screenshot you provided looks good, and it's popular on the web (and it's what I use as my default font, me too 🙃 ). Also, according to Wikipedia:
|
this will make locally generated documentation not consistent in font for text and images the only way is to force both, mb optionally and enable that option only for generating website, but not in local build |
Truly forcing a font for a web page is impossible. Firefox has a built-in option to prevent that, and userstyles can override And I haven't seen a place in the doc's text where typesetting and font width matter. It's only the generated example images that break with different fonts. I think it would be enough to use the common |
that just make zero sense: for example, userstyles are quite a hack to be a concern for any of front end developers and more you go, less logical it is - uninstalling the whole font from the system not the most convenient way to opt out from some style options for a user |
I don't see the text font as an issue. We can't control what font will be used by the browser to display text. That's why I dismissed it. Do we really need it to be the same as the one used in generated images? Hmm.... You actually may be right 🤷. All the font used should "look alike"... Even for code blocks, we have to use a monospaced variant of the same font. It shouldn't cost too much to revisit the CSS rules for fonts.
I mostly agree with this. I don't see why we should add the preferred font as an optional dependency, tho. Even for local use, the doc is served as a website, so we have to stick to "serving a website rules". It doesn't make sense to force the server to have the font, only the client matter here, and we can't control it with our dependencies. I also don't see what's wrong with |
we can control it in site style, but if user purposely chosen to override some of the styles - we should respect that choice and not thinking of possible ways to force it my main point what introducing hardcoded font instead of 'sans' will make image preview in local awesome build to use some boring font instead of godsent Fantasque Sans Mono, which is not acceptable to me (and as you can see on preview, in case of local build both fonts in preview and text are the same: thats why hardcoding font for docs (which should happen for both generated images and text styles) should be optional and enabled by default only for generating pages under https://awesomewm.org/doc/ |
I guess this issue got sidetracked on "consistency between HTML content and SVG images", which is not what it is about. The problem described in the initial message is the fact that the font used to generate example images is inconsistent between different machines (e.g. CI vs. developer machine). Whoever wrote that example for Hardcoding the font in the examples theme does take away some customization options for a person working with a local build, but that same customization can be achieved by applying a simple, short patch before installation. |
still non convinced what adding new font as a dep for awesome is better than learning cmake options as you've got into offtopic regarding those boxes in the docs - i think it would be better to reuse awful.tooltip or textbox.compute_text_width + margin size instead of hardcoding the sizes at first place |
The point of the issue is that everyone working on an example for the documentation should build it with the same, pre-defined font to ensure consistency and prevent the issues presented. And there is no "either font or cmake option". Those two things are independent of each other.
On the contrary, that was quite on-topic, given that those tooltips exhibit the exact same issue that I illustrated in the opening message. |
The font used in the theme for examples is not properly fixed to a specific value, which can lead to inconsistent text dimensions:
Current API doc for master:
My local version:
Currently, the font is set to
sans 8
, which will vary between developer systems based on what their preferred font is (e.g. Noto Sans in my example above). It may even change in CI if something there decides to switch default fonts.So the question is: Which font do we want to fix this to?
The text was updated successfully, but these errors were encountered: