mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
cleanup
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nativescript/core",
|
"name": "@nativescript/core",
|
||||||
"version": "9.0.0-alpha.5",
|
"version": "9.0.0-alpha.6",
|
||||||
"description": "A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.",
|
"description": "A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "index",
|
"main": "index",
|
||||||
|
@ -147,7 +147,6 @@ function getNativeFontWeight(fontWeight: FontWeightType): number {
|
|||||||
|
|
||||||
export namespace ios {
|
export namespace ios {
|
||||||
export function registerFont(fontFile: string) {
|
export function registerFont(fontFile: string) {
|
||||||
console.log('registerFont knownFolders.currentApp().path: ' + knownFolders.currentApp().path);
|
|
||||||
let filePath = path.join(knownFolders.currentApp().path, FONTS_BASE_PATH, fontFile);
|
let filePath = path.join(knownFolders.currentApp().path, FONTS_BASE_PATH, fontFile);
|
||||||
if (!File.exists(filePath)) {
|
if (!File.exists(filePath)) {
|
||||||
filePath = path.join(knownFolders.currentApp().path, fontFile);
|
filePath = path.join(knownFolders.currentApp().path, fontFile);
|
||||||
@ -163,8 +162,6 @@ export namespace ios {
|
|||||||
throw new Error('Could not load font from: ' + fontFile);
|
throw new Error('Could not load font from: ' + fontFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('registerFont filePath:', filePath);
|
|
||||||
|
|
||||||
const error = new interop.Reference<NSError>();
|
const error = new interop.Reference<NSError>();
|
||||||
if (!CTFontManagerRegisterGraphicsFont(font, error)) {
|
if (!CTFontManagerRegisterGraphicsFont(font, error)) {
|
||||||
if (Trace.isEnabled()) {
|
if (Trace.isEnabled()) {
|
||||||
@ -182,8 +179,6 @@ function registerFontsInFolder(fontsFolderPath) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
console.log(`registerFontsInFolder, Registering font: ${fileEntity.name}, extension: ${fileEntity.extension}`);
|
|
||||||
if (fileEntity instanceof File && (fileEntity.extension === 'ttf' || fileEntity.extension === 'otf')) {
|
if (fileEntity instanceof File && (fileEntity.extension === 'ttf' || fileEntity.extension === 'otf')) {
|
||||||
ios.registerFont(fileEntity.name);
|
ios.registerFont(fileEntity.name);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user