Permalink
Browse files

bug fix, added ligature flag option

  • Loading branch information...
1 parent 5d1cc3d commit e25faf75f2e2d674eee03969edf89cc8e9337b5b @k0sukey committed Dec 1, 2012
View
@@ -0,0 +1,65 @@
+# Makefile to start Titanium Mobile project from the command line.
+
+# This is the ONLY option you should / need to configure
+ANDROID_SDK_PATH='~/Android'
+
+# Please dont change settings below here
+PROJECT_ROOT=$(shell pwd)
+
+iphone=$(iphone)
+
+android=$(android)
+
+BUILD_TYPE=$(build_type)
+
+DEVICE_TYPE=$(platform)
+
+MAKETI_DIR=$(dir $(lastword $(MAKEFILE_LIST)))
+
+
+help:
+ @echo ""
+ @echo "**************************************************************"
+ @echo "* Welcome to MakeTi, the make system for Titanium! *"
+ @echo "**************************************************************"
+ @echo "The commands avaliable to you are as follows:"
+ @echo ""
+ @echo " $ make run - (will run as iphone for default, use the platform flag to set the platform)"
+ @echo " $ make clean - (will clean your build directory)"
+ @echo ""
+ @echo "The options for the build command are:"
+ @echo ""
+ @echo " $ make run platform=ipad - (Other platforms are iphone, ipad, or android)"
+ @echo " $ make run iphone=4.3 - (Where 4.3 is, put whatever iOS SDK you want to use)"
+ @echo " $ make run android=10 - (Where 10 is, put the Android API level you wish to use)"
+ @echo ""
+ @echo "**************************************************************"
+ @echo ""
+
+run:
+ @if [ "${DEVICE_TYPE}" == "" ]; then\
+ echo "No platform selected... running as iphone.";\
+ fi
+
+ @echo "Building with Titanium... as ${BUILD_TYPE}"
+ @mkdir -p '${PROJECT_ROOT}/${PROJECT_NAME}/build/iphone/'
+ @mkdir -p '${PROJECT_ROOT}/${PROJECT_NAME}/build/android/'
+ PROJECT_ROOT='${PROJECT_ROOT}' DEVICE_TYPE=${DEVICE_TYPE} bash '${MAKETI_DIR}/bin/titanium.sh'
+
+deploy:
+ @if [ "${DEVICE_TYPE}" == "" ]; then\
+ echo "No platform selected... building for iphone.";\
+ fi
+
+ @echo "Building with Titanium... as ${BUILD_TYPE}"
+ @mkdir -p '${PROJECT_ROOT}/${PROJECT_NAME}/build/iphone/'
+ @mkdir -p '${PROJECT_ROOT}/${PROJECT_NAME}/build/android/'
+ PROJECT_ROOT='${PROJECT_ROOT}' DEVICE_TYPE=${DEVICE_TYPE} BUILD_TYPE='device' bash '${MAKETI_DIR}/bin/titanium.sh'
+
+clean:
+ @rm -rf '${PROJECT_ROOT}/build/iphone/'
+ @mkdir -p '${PROJECT_ROOT}/build/iphone/'
+ @echo "Deleted: ${PROJECT_ROOT}/build/iphone/*"
+ @rm -rf '${PROJECT_ROOT}/build/android/'
+ @mkdir -p '${PROJECT_ROOT}/build/android/'
+ @echo "Deleted: ${PROJECT_ROOT}/build/android/*"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -3,8 +3,18 @@
backgroundColor: '#fff'
});
- var fontawesome = require('lib/IconicFont').IconicFont({ font: 'lib/FontAwesome' });
- var ligaturesymbols = require('lib/IconicFont').IconicFont({ font: 'lib/LigatureSymbols' });
+ var fontawesome = require('lib/IconicFont').IconicFont({
+ font: 'lib/FontAwesome',
+ ligature: false // optional
+ });
+ var ligaturesymbols = require('lib/IconicFont').IconicFont({
+ font: 'lib/LigatureSymbols',
+ ligature: false // optional
+ });
+ var sspika = require('lib/IconicFont').IconicFont({
+ font: 'lib/ti.ss-pika',
+ ligature: true // optional
+ });
var wrapView = Ti.UI.createView({
height : 200
@@ -12,6 +12,7 @@ exports.IconicFont = (function(global){
}
if (!options) { options = {}; }
+ self.ligature = options.ligature || false;
var Font = require(options.font);
self.font = new Font();
@@ -23,8 +24,9 @@ exports.IconicFont = (function(global){
IconicFont.prototype.icon = function(options){
var self = this;
- options.forEach(function(value){
- if(typeof value === 'string') {
+ if (options instanceof Array) {
+ options.forEach(function(value){
+ if (self.ligature) {
icons.push(self.font.getCharcode(value));
} else {
icons.push(String.fromCharCode(self.font.getCharcode(value)));
@@ -33,10 +35,11 @@ exports.IconicFont = (function(global){
return icons;
} else {
- if(typeof options === 'string') {
+ if (self.ligature) {
return self.font.getCharcode(options);
} else {
return String.fromCharCode(self.font.getCharcode(options));
+ }
}
};
Oops, something went wrong.

0 comments on commit e25faf7

Please sign in to comment.