[TIMOB-13164] mobileweb rendered @font-face declaration is not valid
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2018-03-12T14:22:02.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | MobileWeb |
Labels | @font-face, css, css3, fontfamily, mobileweb |
Reporter | Carter Lathrop |
Assignee | Chris Barber |
Created | 2013-03-14T11:07:07.000+0000 |
Updated | 2018-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
File | Date | Size |
---|---|---|
comic_zine_ot.otf | 2013-03-22T09:47:20.000+0000 | 117384 |
titanium.css | 2013-03-21T09:55:38.000+0000 | 37917 |
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
Attached the rendered build/mobileweb/titanium.css file.
Hi Carter, I've added some more informations about the related problem in the description. Sorry about the previous incomplete description. Damien
Thanks Damien, I reopened and am looking into this issue, if possible would you mind attaching the font .otf as well? Thanks, Carter
Also, to clarify, is this issue only being seen in alloy?
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.
Mobileweb was dropped. So no fix is required anymore
Closing as will not fix.