Crash when showing answer with custom font (Mac-10.9/Anki-2.0.18)

flerda's Avatar

flerda

23 Nov, 2013 02:29 PM

Application crashes when displaying answer.
Answer contains a custom font.
This is not 100% reproducible but quite common.

The font works elsewhere and I have been using successfully with older versions of Anki, but some time after 2.0 was release I started seeing this. I can binary search which specific version this issue has been introduced (my guess would be the one where an update to the QT libraries has occurred). The font is large (5MB) but not prohibitively so.

Crash file attached.

Styling is set to:

@font-face { font-family: kyoukasho; src: url('_kyoukasho.ttf'); }
.card {
 font-family: arial;
 font-size: 20px;
 text-align: center;
 color: black;
 background-color: white;
}
.card1 {
 font-family: arial;
 font-size: 20px;
 text-align: center;
 color: black;
 background-color: #ffffcc;
}
.card2 {
 font-family: arial;
 font-size: 20px;
 text-align: center;
 color: black;
 background-color: #ffffcc;
}
.card3 {
 font-family: arial;
 font-size: 20px;
 text-align: center;
 color: black;
 background-color: #ffccff;
}
.card4 {
 font-family: arial;
 font-size: 20px;
 text-align: center;
 color: black;
 background-color: #ccffcc;
}
  1. Support Staff 1 Posted by Damien Elmes on 23 Nov, 2013 06:54 PM

    Damien Elmes's Avatar
  2. 2 Posted by flerda on 23 Nov, 2013 07:34 PM

    flerda's Avatar

    Thanks, I had missed that note.

    However the link with the workaround on that page does not work (it is a link referring to a group that no longer exist).

    Is it possible to publish that information elsewhere?

  3. Support Staff 3 Posted by Damien Elmes on 23 Nov, 2013 07:44 PM

    Damien Elmes's Avatar

    Sure, I'll update the link when I have a chance. You can accomplish this as follows:

    Wrap the text you want to style with a custom name like 'mystyle':

    <div class="mystyle">{{myfield}}</div>

    Then in the styling, tell Anki to use a different font when running on a Mac, and use myfont otherwise.

    .mystyle { font-family: myfont; }
    .mac .mystyle { font-family: Helvetica; }

    It should not crash if the font was installed system wide instead of included on the template, so you can use the system font name in the bottom line, and 'myfont' as described in the custom fonts section for other platforms.

  4. 4 Posted by Soren Bjornstad on 26 Oct, 2014 12:15 AM

    Soren Bjornstad's Avatar

    This ticket has been automatically closed due to inactivity. If you are still having issues or need to continue this discussion, please feel free to reply.

    If you are not the original poster but are experiencing a similar issue, please create a new thread and include a link to this one if appropriate.

  5. Soren Bjornstad closed this discussion on 26 Oct, 2014 12:15 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac