MattMcFarland / com.mattmcfarland.fontawesome

Font Awesome meets Appcelerator Titanium Alloy
GNU General Public License v2.0
78 stars 23 forks source link

What would be the possible cause(s) of icons not reacting to fontSize? #8

Open daveeel opened 10 years ago

daveeel commented 10 years ago

I have an icon showing in a view, say detail.xml, but no matter how I change the fontSize of the related class in detail.tss, the icon size remain unchanged. Changing the icon is fine though.

Having tried almost all combinations. I finally swapped the content of detail.xml with your browse_icon.html and detail.tss with your app.tss. Strangely enough, all icon sizes are the same as my previous test and can't change. Changing icon color in the .tss of fa-icon works though.

So, what could be the possible cause? Is it possible that the parent window affects the rendering of child window?

By the way, though size can't change, the code runs ok in iOS simulator. But I got the following error message by running from Android Emulator:

[ERROR] :  TiExceptionHandler: (main) [8,8170] ----- Titanium Javascript Runtime Error -----
[ERROR] :  TiExceptionHandler: (main) [0,8170] - In alloy/widgets/com.mattmcfarland.fontawesome/controllers/widget.js:11,59
[ERROR] :  TiExceptionHandler: (main) [0,8170] - Message: Uncaught Error: Java Exception occurred
[ERROR] :  TiExceptionHandler: (main) [0,8170] - Source:                 for (var property in tag) Ti.API.debug(tag[property]);
[ERROR] :  V8Exception: Exception occurred at alloy/widgets/com.mattmcfarland.fontawesome/controllers/widget.js:11: Uncaught Error
: Java Exception occurred
daveeel commented 10 years ago

As an aside, having no luck to use your convenient way with control, but wanting to use the icons, I'm now temporarily using the custom font way and use unicode for text input. i.e. in .tss:

".fa-icon": {
top:'8',
color:'red',
font: {
    fontFamily: 'FontAwesome',
    fontSize:'40dp',
},
}

and in the .xml:

        <Label class='fa-icon' text="&#xf01d;"/>

A bit tedious, but at least under my control ...

MattMcFarland commented 10 years ago

Strange, did you try build -> clean? That might be the problem, sometimes it gets stubborn.

MattMcFarland commented 10 years ago

You could make it less tedious by using multiple classes

<label class= 'fa-star fa-large'/>

daveeel commented 10 years ago

Yes, I learned to build clean from the previous issue.

MattMcFarland commented 9 years ago

I'm not sure what you're doing differently, but the example repo has a large icon in use, maybe you can refer to that and see what you've done differently??