Custom font does not render for the first word of a card

Hoping someone can help me understand my issue: custom font does not render for the first word of a card · Issue #19176 · ankidroid/Anki-Android · GitHub. I have a workaround, so I don’t need help getting my card to display correctly, but I don’t understand why it’s a template issue. Basic summary: I have a custom font that works fine on desktop, but does not work on AnkiDroid for one of my cards. I discovered that wrapping the first parameter in a span or even adding   fixes it, which leads me to believe th at the way AnkiDroid renders the HTML for the card is wrong.

Please paste ‘Debug Info’ (Settings > About > ‘Copy debug info’) below:

AnkiDroid Version = 2.22.3 (4f2ec681da36b8307a865f05192498b8425adf0f)  
Backend Version = 0.1.60-anki25.07.5 (25.07.5 7172b2d26684c7ef9d10e249bd43dc5bf73ae00c)  
Android Version = 16 (SDK 36)  
ProductFlavor = play  
Device Info = Google | google | tokay | tokay | Pixel 9 | tokay  
Webview User Agent = Mozilla/5.0 (Linux; Android 16; Pixel 9 Build/BP3A.250905.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/140.0.7339.51 Mobile Safari/537.36  
ACRA UUID = 1686eaaa-5dc2-4bc3-9dbe-6906fb97d66e  
FSRS = 4.1.1 (Enabled: true)  
Crash Reports Enabled = true
2 Likes

That should be “even adding  

I’m able to reproduce this with your note type and font.

  • When the front template is <span>{{Tengwar}}</span> – the character displays on all platforms.
  • When the front template is {{Tengwar}} – the character fails to display on AnkiDroid, but displays fine on desktop and AnkiMobile.

I think you’re right that this is something AnkiDroid specific, and I’m asking the developers to take another look.

Does it work on the new study screen? (About > tap logo 6 times > enable developer options> enable new study screen in the developer options)

Or does it show correctly on the card preview (either the one from the browser or the one from the note editor)?

On 2.22.3, it’s an interesting mix –

Does not display:

  • Regular study screen
  • Card browser table

Displays:

  • New study screen
  • Preview from card browser
  • Preview from note editor

The new study screen will be out in the next release, so consider it fixed.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.