Merge pull request #1001 from NativeScript/fonts-fixes

Fonts fixes
This commit is contained in:
Vladimir Enchev
2015-10-30 11:44:30 +02:00
11 changed files with 10 additions and 1 deletions

BIN
apps/fonts/Entypo.ttf Normal file

Binary file not shown.

BIN
apps/fonts/EvilIcons.ttf Normal file

Binary file not shown.

BIN
apps/fonts/FontAwesome.ttf Normal file

Binary file not shown.

BIN
apps/fonts/Foundation.ttf Normal file

Binary file not shown.

BIN
apps/fonts/Ionicons.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
apps/fonts/Octicons.ttf Normal file

Binary file not shown.

BIN
apps/fonts/Zocial.ttf Normal file

Binary file not shown.

3
apps/fonts/package.json Normal file
View File

@ -0,0 +1,3 @@
{
"name": "fonts"
}

View File

@ -7,6 +7,8 @@
<TabViewItem.view> <TabViewItem.view>
<StackLayout> <StackLayout>
<Label ios:text="&#xf179;" android:text="&#xf17b;" style="font-family: FontAwesome; font-size: 25;" />
<HtmlView html="&lt;span&gt;&lt;font color='#ff0000'&gt;Test&lt;/font&gt;&lt;/span&gt;" /> <HtmlView html="&lt;span&gt;&lt;font color='#ff0000'&gt;Test&lt;/font&gt;&lt;/span&gt;" />
<WebView src="&lt;html&gt;&lt;body&gt;&lt;span style='color:red'&gt;Test&lt;/span&gt;&lt;/body&gt;&lt;/html&gt;" /> <WebView src="&lt;html&gt;&lt;body&gt;&lt;span style='color:red'&gt;Test&lt;/span&gt;&lt;/body&gt;&lt;/html&gt;" />

View File

@ -175,7 +175,11 @@ function registerCustomFonts() {
if (fs.Folder.exists(fs.path.join(fontsFolderPath, fileEntity.name))) { if (fs.Folder.exists(fs.path.join(fontsFolderPath, fileEntity.name))) {
return true; return true;
} }
ios.registerFont(fileEntity.name);
if (fileEntity instanceof fs.File &&
((<fs.File>fileEntity).extension === ".ttf" || (<fs.File>fileEntity).extension === ".otf")) {
ios.registerFont(fileEntity.name);
}
return true; return true;
} }