Search code examples
windows-desktop-gadgets

Non-system font on Windows Gadget


Let me preface this by saying I'm aware that gadgets have been discontinued, so this is really just a personal project. Any exercise is good exercise I say.

Is there any way to supply your own font to a gadget by defining a font-face or otherwise, like one would in a browser? Currently, here's my css:

@font-face {
        font-family:FinkHeavy;
        src:url(font/FinkHeavy.eot);
    }

And my markup, where the g:text object is declared:

min_disp = imgBackground.addTextObject("Te", "FinkHeavy", 46, "SaddleBrown", "235", "100");

And finally, that file is definitely there. I've tried both the .eot and .woff, since these are what are supported by various versions of IE. The files are also valid, as they render in a browser.

Is there any way to package in a font with my gadget?


Solution

  • So far, @font-face works for me

    • when the specified font name is used in a css attribute (font, font-family) for an html element
    • when an "eot" src font is used
    • in script by using "element.style.fontFamily" -

    It does not work for me

    • when used with the "addTextObject" method or the resulting g:text object's font property - either onload or subsequently.
    • when a woff src font is used
    • when any format is specified for the eot font.