add iOS icon font support
This commit is contained in:
parent
73c0a5e7ab
commit
49854cc825
2
doric-demo/.gitignore
vendored
2
doric-demo/.gitignore
vendored
@ -1,4 +1,4 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
build/
|
build/
|
||||||
bundle/
|
bundle/src
|
||||||
package-lock.json
|
package-lock.json
|
BIN
doric-demo/bundle/iconfont.ttf
Normal file
BIN
doric-demo/bundle/iconfont.ttf
Normal file
Binary file not shown.
@ -47,12 +47,12 @@ class TextDemo extends Panel {
|
|||||||
}),
|
}),
|
||||||
text({
|
text({
|
||||||
text: "This is Icon Font text \ue631",
|
text: "This is Icon Font text \ue631",
|
||||||
font: 'iconfont/iconfont.ttf'
|
font: 'iconfont'
|
||||||
}),
|
}),
|
||||||
text({
|
text({
|
||||||
text: "This is Icon Font text \ue631",
|
text: "This is Icon Font text \ue631",
|
||||||
textSize: 30,
|
textSize: 30,
|
||||||
font: 'iconfont/iconfont.ttf'
|
font: 'iconfont'
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
{
|
{
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
8B429D94241B66A300572570 /* iconfont.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8B429D93241B66A200572570 /* iconfont.ttf */; };
|
||||||
8BCADA7C23CD5B65005EEF96 /* NavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BCADA7B23CD5B64005EEF96 /* NavigationController.m */; };
|
8BCADA7C23CD5B65005EEF96 /* NavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BCADA7B23CD5B64005EEF96 /* NavigationController.m */; };
|
||||||
A1E221FB2DCA40D85C4D9520 /* libPods-ExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F233ACD236542275AED3DE0 /* libPods-ExampleTests.a */; };
|
A1E221FB2DCA40D85C4D9520 /* libPods-ExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F233ACD236542275AED3DE0 /* libPods-ExampleTests.a */; };
|
||||||
CC537F4B9F59400BA5B4FF8F /* libPods-Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DEE8411A69609CC9C86063CC /* libPods-Example.a */; };
|
CC537F4B9F59400BA5B4FF8F /* libPods-Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DEE8411A69609CC9C86063CC /* libPods-Example.a */; };
|
||||||
@ -46,6 +47,7 @@
|
|||||||
3D75F592D76A665674B31A66 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = "<group>"; };
|
3D75F592D76A665674B31A66 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
4F233ACD236542275AED3DE0 /* libPods-ExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
4F233ACD236542275AED3DE0 /* libPods-ExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
8231E841CCAF382F85C9F576 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = "<group>"; };
|
8231E841CCAF382F85C9F576 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
8B429D93241B66A200572570 /* iconfont.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = iconfont.ttf; path = "../../../doric-demo/bundle/iconfont.ttf"; sourceTree = "<group>"; };
|
||||||
8BCADA7A23CD5B5F005EEF96 /* NavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NavigationController.h; sourceTree = "<group>"; };
|
8BCADA7A23CD5B5F005EEF96 /* NavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NavigationController.h; sourceTree = "<group>"; };
|
||||||
8BCADA7B23CD5B64005EEF96 /* NavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NavigationController.m; sourceTree = "<group>"; };
|
8BCADA7B23CD5B64005EEF96 /* NavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NavigationController.m; sourceTree = "<group>"; };
|
||||||
B93423722F2E06DC238CDD18 /* Pods-ExampleUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ExampleUITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ExampleUITests/Pods-ExampleUITests.release.xcconfig"; sourceTree = "<group>"; };
|
B93423722F2E06DC238CDD18 /* Pods-ExampleUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ExampleUITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ExampleUITests/Pods-ExampleUITests.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
@ -152,6 +154,7 @@
|
|||||||
E2334AED22E9D2060098A085 /* Example */ = {
|
E2334AED22E9D2060098A085 /* Example */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
8B429D93241B66A200572570 /* iconfont.ttf */,
|
||||||
E2C9315823B0A263007933D9 /* src */,
|
E2C9315823B0A263007933D9 /* src */,
|
||||||
E2334AEE22E9D2060098A085 /* AppDelegate.h */,
|
E2334AEE22E9D2060098A085 /* AppDelegate.h */,
|
||||||
E2334AEF22E9D2060098A085 /* AppDelegate.m */,
|
E2334AEF22E9D2060098A085 /* AppDelegate.m */,
|
||||||
@ -301,6 +304,7 @@
|
|||||||
E2334AFB22E9D2070098A085 /* LaunchScreen.storyboard in Resources */,
|
E2334AFB22E9D2070098A085 /* LaunchScreen.storyboard in Resources */,
|
||||||
E2334AF822E9D2070098A085 /* Assets.xcassets in Resources */,
|
E2334AF822E9D2070098A085 /* Assets.xcassets in Resources */,
|
||||||
E2334AF622E9D2060098A085 /* Main.storyboard in Resources */,
|
E2334AF622E9D2060098A085 /* Main.storyboard in Resources */,
|
||||||
|
8B429D94241B66A300572570 /* iconfont.ttf in Resources */,
|
||||||
E2C9315923B0A263007933D9 /* src in Resources */,
|
E2C9315923B0A263007933D9 /* src in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
@ -52,5 +52,9 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>UIAppFonts</key>
|
||||||
|
<array>
|
||||||
|
<string>iconfont.ttf</string>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@ -72,6 +72,10 @@ - (void)blendView:(UILabel *)view forPropName:(NSString *)name propValue:(id)pro
|
|||||||
font = [UIFont fontWithDescriptor:fontDescriptor size:0];
|
font = [UIFont fontWithDescriptor:fontDescriptor size:0];
|
||||||
}
|
}
|
||||||
view.font = font;
|
view.font = font;
|
||||||
|
} else if ([name isEqualToString:@"font"]) {
|
||||||
|
NSString *iconfont = prop;
|
||||||
|
UIFont *font = [UIFont fontWithName:iconfont size:view.font.pointSize];
|
||||||
|
view.font = font;
|
||||||
} else {
|
} else {
|
||||||
[super blendView:view forPropName:name propValue:prop];
|
[super blendView:view forPropName:name propValue:prop];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user