2016-03-29 5 views
0

erkannt Meine Apps erkennen die Schriftarten-Dateien nicht mehr mit SDK> = 5.2.0.GA.Appcelerator: Schriftarten werden nicht von SDK 5.2.0.GA

Mit SDK < = 5.1.2.GA das kein Problem

enter image description here

die Dokumentation Lesen ich nichts zu diesem Problem im Zusammenhang gefunden haben, oder bin ich falsch?


TiApp.xml

<ios> 
    <plist> 
     <dict> 
      <key>UIAppFonts</key> 
      <array> 
       <string>/fonts/icons.ttf</string> 
      </array> 
      .... 
     </dict> 
    </plist> 
</ios> 

Font-Verzeichnis

enter image description here

Beispiel für Symbol

var IconicFont = require('/icon/IconicFont'); 
var Icons = new IconicFont({ 
    font : '/icon/ListIcons' 
}); 

var myBtn = Ti.UI.createButton({ 
    height : 50, 
    width : 50, 
    color : 'white', 
    font : { 
     fontSize : 30, 
     fontFamily : Icons.fontfamily 
    }, 
    title : Icons.icon("nameicon"), 
    textAlign : Ti.UI.TEXT_ALIGNMENT_CENTER, 
    verticalAlign : Ti.UI.TEXT_VERTICAL_ALIGNMENT_CENTER 
}); 

IconicFont.js

function IconicFont(params) { 
    params = params || {}; 

    this._font = require(params.font); 
} 

Object.defineProperties(IconicFont.prototype, { 
    font: { 
     set: function(param){ 
      this._font = require(param); 
     }, 
     get: function(){ 
      return this._font; 
     } 
    }, 
    fontfamily: { 
     get: function(){ 
      return this._font.fontfamily; 
     } 
    } 
}); 

IconicFont.prototype.icon = function(param){ 
    var result = []; 

    if (!Array.isArray(param)) { 
     param = [param]; 
    } 

    for (var i = 0; i < param.length; i++) { 
     result.push(String.fromCharCode(this._font.charcode[param[i]])); 
    } 

    return result.join(''); 
}; 

module.exports = IconicFont; 

ListIcons.js

exports.fontfamily = 'FontName'; 
exports.charcode = { 
    'image':0xf11a, 
    '.....':...... 
}; 
+0

Sicherlich die Appcelerator Foren wäre ein besserer Ort für Ihre Frage? – trojanfoe

+0

SO ist das neue Appcelerator-Forum. http://www.appcelerator.com/blog/2016/01/embracing-stack-overflow-for-appcelerator-community-support/ – WhiteLine

+0

Hahah, was für ein Witz. – trojanfoe

Antwort

0

/platform/iphone/fonts ist eine wirklich seltsame Ort, die appcelerator docs Sie sagen ihnen Platz in/app/assets/[android] [iphone]/fonts, versuchen, sie hier zu platzieren.

+0

http://docs.appcelerator.com/platform/latest/#!/guide/Custom_Fonts-section-29004935_CustomFonts-Usingacustomfont(Classicaapplication) – WhiteLine

+0

Es ist immer noch das falsche Verzeichnis für ein nicht legiertes Projekt, es ist/Ressourcen/iphone/Fonts, nicht/platform/iphone/Fonts. –

+0

In der Tat sollte Schriftdatei in Resources-Verzeichnis platziert werden. Ich lege meinen Ordner nicht in den iPhone-Ordner, nur in den Ressourcen –

Verwandte Themen