Hyphenation for German

I’m trying to get hyphenation to work in Anki since I have German words in quite a large font.

I’ve been using this css setup as found somewhere on stack-overflow:

.MeaningFront{
	margin-top:30vh;
	font-size: 50px;
   	font-family: Helvetica;
	color: var(--highlight)
    word-break: normal;
 	-webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}

and of course I have lang=de set on the div I want it to be applied to.

I get not result from any of this. My words break after any letter and without displaying any hyphens. Has anyone here experienced similar issues or has a similar scenario working for themselves?

Reading about hyphenation on the web I’ve seen statements that this feature is still quite browser-specific. Is Anki’s built-in browser not capable of hyphenation?

I’m running Anki 2.1.42 on Linux.

Edit: I tried this on AnkiDroid as well but no luck so I’m moving this from “Anki Desktop” to “Card Design”.

1 Like

The web toolkit Anki desktop uses is based on Chromium. According to this page, hyphens has been supported since Chrome 88 on all platforms, but the toolkit is based on a slightly older version of Chromium (see here), so it probably doesn’t work on Anki for the time being, except on Mac OS. In the future, when the version of Chromium that the toolkit is based on is upgraded and Anki adopts it, you should be able to use hyphens.

I’m not sure why it doesn’t work on AnkiDroid, but it might depend on the Android OS version.

2 Likes

Damn! Only after v88? I thought it would’ve been implemented a lot earlier. (I guess I learned that my normal browser also doesn’t support hyphens then, lmao)

Alright, thanks for the answer! Gonna look into Ankidroid a bit more then, I didn’t do diligent tests on there.