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]: Issue with Displaying Variable Fonts in AnkiDroid #17601

Open
3 of 4 tasks
e-chehil opened this issue Dec 14, 2024 · 4 comments
Open
3 of 4 tasks

[BUG]: Issue with Displaying Variable Fonts in AnkiDroid #17601

e-chehil opened this issue Dec 14, 2024 · 4 comments

Comments

@e-chehil
Copy link

e-chehil commented Dec 14, 2024

Checked for duplicates?

  • This issue is not a duplicate

Does it also happen in the desktop version?

  • This bug does not occur in the latest version of Anki Desktop

What are the steps to reproduce this bug?

I am experiencing an issue with the rendering of variable TrueType fonts (TTF) in AnkiDroid. While the same font displays correctly on AnkiWeb and Windows, with full support for various font weights (e.g., Regular, Semibold, Bold), AnkiDroid seems to only recognize and display the Regular and Bold weights.

I suspect this issue may be related to how AnkiDroid handles variable fonts, as it appears that intermediate weights (such as Semibold) are not displayed. Instead, only the default Regular and Bold options are available.

Could you please look into this issue and clarify if there are any specific font rendering limitations or if there's a way to make AnkiDroid fully support all the weights in a variable font? I would greatly appreciate any guidance on this matter, as variable fonts offer great flexibility and support for a more diverse set of weights.

Thank you for your time and the continued development of AnkiDroid!

Expected behaviour

Style

.card {
	font-family: 'Source Han Serif', serif;
	font-weight: 600;
}

@font-face {
  font-family: 'Source Han Serif';
  src: url("_SourceHanSerifSC-VF.ttf");
}

FONT

Source Han Serif

Variable OTCs :: TTF :: Variable Simplified Chinese (简体中文)

Debug info

AnkiDroid Version = 2.20.0 (d41d16a45c00b0bdbd3b13ac988143db5ef8ae90)

Backend Version = 0.1.48-anki24.11 (24.11 c47638ca36f99dd4f3b81ae82d964aec66e392e0)

Android Version = 10 (SDK 29)

ProductFlavor = play

Manufacturer = HUAWEI

Model = CDL-AN50

Hardware = kirin820E

Webview User Agent = Mozilla/5.0 (Linux; Android 10; CDL-AN50 Build/HUAWEICDL-AN50; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/99.0.4844.88 Mobile Safari/537.36

ACRA UUID = f2699055-35be-4899-8f55-8bd8a50cf1ea

FSRS = 1.4.3 (Enabled: false)

Crash Reports Enabled = true

(Optional) Anything else you want to share?

No response

Research

  • I have checked the manual and the FAQ and could not find a solution to my issue
  • (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)
Copy link

welcome bot commented Dec 14, 2024

Hello! 👋 Thanks for logging this issue. Please remember we are all volunteers here, so some patience may be required before we can get to the issue. Also remember that the fastest way to get resolution on an issue is to propose a change directly, https://github.com/ankidroid/Anki-Android/wiki/Contributing

@david-allison
Copy link
Member

david-allison commented Dec 14, 2024

Chrome/99.0.4844.88

Are you on the latest Android System WebView update? 131.0.6778.104 is the latest for me

@e-chehil
Copy link
Author

Are you on the latest Android System WebView update? 131.0.6778.104 is the latest for me

I am from China, and it seems that the Android System WebView app is not available on my device. After reading your message, I installed the latest version (131.0.6678.135) of Android System WebView, but unfortunately, there doesn't seem to be any change in AnkiDroid’s behavior.

@mikehardy
Copy link
Member

I wonder if this is still a problem in the new reviewer?
That is, if you go to Settings -> About -> Tap the logo 6 times and turn on developer options
Then in developer options you go all the way to the bottom and enable "New reviewer", maybe - just maybe! - it renders differently?

It may have no effect.

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

No branches or pull requests

3 participants