Search code examples
widgetfont-faceibooks

How to set a custom font inside an iBook widget?


I am creating an iBook and I have a widget inside this iBook.

I'd like the widget to use a custom font, hence I've added inside the .WDGT folder a myfont/ folder containing myfont.ttf.

I call it from the widget main.html using CSS, which works perfectly fine when testing on Safari on the desktop. It fails in the iPhone. Am I missing some step? Do I have to somehow tell the iPad via a plist entry to look up in the folder?

Relevant CSS code:

 @font-face {
     font-family: kheldarfont;
      src: url('kheldarfont/kheldarfont.ttf');
  }

 #scorebox{
    font: xx-large "kheldarfont";
 }

Any hint?


Solution

  • In a Dashboard Widget, I would use:

    In Info.plist

    <key>Fonts</key>
    <array>
    <string>kheldarfont</string> 
     </array> 
    

    But unhappily, according to Apple's support:

    Fonts   iBooks Author widgets cannot use bundled fonts.