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

[bug] font issue of og image in Chinese and Japanese language #355

Open
JinIgarashi opened this issue Jul 12, 2023 · 5 comments · Fixed by #357
Open

[bug] font issue of og image in Chinese and Japanese language #355

JinIgarashi opened this issue Jul 12, 2023 · 5 comments · Fixed by #357

Comments

@JinIgarashi
Copy link
Contributor

JinIgarashi commented Jul 12, 2023

When we select Japanese or Chinese language, social image's font has an issue.

https://docs.qfield.org/assets/images/social/get-started/concepts.ja.png

https://docs.qfield.org/assets/images/social/get-started/concepts.zh.png

According to the documentation, there is a way to set font family in mkdocs.yml, but I am not sure how we can change font family dynamically according to the language of content.

@JinIgarashi
Copy link
Contributor Author

I asked a question in their repo for this issue.

squidfunk/mkdocs-material#5704

@JinIgarashi
Copy link
Contributor Author

@m-kuhn Do you have access to Material for Mkdocs Insiders version? I saw you are setting MKDOCS_INSIDERS_TOKEN in Github action.

- name: Install Python requirements insiders
run: pip install -r requirements-insiders.txt
env:
MKDOCS_INSIDERS_TOKEN: ${{ secrets.MKDOCS_INSIDERS_TOKEN }}

See the below documentation of typography. Looks like insiders version can solve this issue by adding font family and font style for each markdown file.
https://squidfunk.github.io/mkdocs-material/setup/setting-up-social-cards/#typography

If QField can use insiders version of the module, this can be solved easily. I think you can insert the following YAML into each ja.md and zh.md file programatically.

size: { width: 1200, height: 630 }
layers:
  - font:
        family: Noto Sans JP or Noto Sans SC
        style: Bold

Could you try this?

@JinIgarashi
Copy link
Contributor Author

I got response from material for mkdocs author.

squidfunk/mkdocs-material#5704 (reply in thread)

maybe you can try insiders version. I can’t do it since I have no access to insiders.

@JinIgarashi
Copy link
Contributor Author

@why-not-try-calmer looks like this bug is still not solved

@why-not-try-calmer
Copy link
Contributor

@why-not-try-calmer looks like this bug is still not solved

I now realize that:

It's currently not supported to scope the application of metadata through .meta.yml files based on file extension (source)

Unfortunately this repository is structured in a way that requires this unsupported method for using metadata based on file extension. In other words, solving this issue requires that either upstream supports using metadata based on file extension, or that we change the file structure. Not really promising :(

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.

2 participants