Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13164] mobileweb rendered @font-face declaration is not valid

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionWon't Fix
Resolution Date2018-03-12T14:22:02.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsMobileWeb
Labels@font-face, css, css3, fontfamily, mobileweb
ReporterCarter Lathrop
AssigneeChris Barber
Created2013-03-14T11:07:07.000+0000
Updated2018-04-04T23:20:29.000+0000

Description

*When using a custom font, rendered CSS code is not valid.*

Steps to reproduce

create a new Titanium project (Single Window Application template)

_alloy new_ it

create assets/fonts directory and put any -- supported non-system -- font in there

change Label element style so it calls the mentioned font

"Label": {
    color: "#000",
    font: {
        fontFamily: "Comic Zine OT"
    }
}

see the font not being applied to the element

Analysis

When opening the built mobileweb/titanium.css, our font declaration at the very end of the file is
@font-face {
  font-family: fonts/comic_zine_ot.otf;
  src: url(fonts/comic_zine_ot.otf);
}
To be usable by browser, it should be
@font-face {
  font-family: "Some Font Name";
  src: url(fonts/comic_zine_ot.otf);
}
To be working, "Some Font Name" should be a valid string and the same as in the defined _tss_ file.

Workaround

I cannot see any workaround since the rendered _font-family_ is expecting a *user defined* font identifier. May be adding a _font-face_ declaration could do the trick.

Attachments

FileDateSize
comic_zine_ot.otf2013-03-22T09:47:20.000+0000117384
titanium.css2013-03-21T09:55:38.000+000037917

Comments

  1. Carter Lathrop 2013-03-20

    Hello Damien, When reporting an issue it is general good practice to provide a sample test case as well as the problem code to show the issue by just copy and pasting into an app.js and in this case running on mobile web. Would you mind providing such a test case so that this issue may get reviewed in a more timely manner? For future reference: https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report Thank you, Carter
  2. Damien Caselli 2013-03-21

    Attached the rendered build/mobileweb/titanium.css file.
  3. Damien Caselli 2013-03-21

    Hi Carter, I've added some more informations about the related problem in the description. Sorry about the previous incomplete description. Damien
  4. Carter Lathrop 2013-03-21

    Thanks Damien, I reopened and am looking into this issue, if possible would you mind attaching the font .otf as well? Thanks, Carter
  5. Carter Lathrop 2013-03-21

    Also, to clarify, is this issue only being seen in alloy?
  6. Damien Caselli 2013-03-22

    I have added the font file used (it's the same file used in Kitchen Sink). I also tested rendering in a non-alloyed app, and the font-face declaration is not rendered properly either.
       @font-face{font-family:fonts/comic_zine_ot.otf;src:url(fonts/comic_zine_ot.otf);
       
  7. Rene Pot 2018-03-12

    Mobileweb was dropped. So no fix is required anymore
  8. Eric Merriman 2018-04-04

    Closing as will not fix.

JSON Source