custom-font

Can't use custom font in iOS app

倾然丶 夕夏残阳落幕 提交于 2019-11-30 16:20:13
I'm trying to use custom font for my iOS app. Here is what I do I added my custom font (m.tff) to Xcode Supporting files directory. Also I create entry called Fonts provided by application with value name of the font (m.tff) in myApp.plist In my view I have a label UILabel *label = [[UILabel alloc]initWithFrame:CGRect(10, 20, 230, 30)]; label.font = [UIFont fontWithName:@"My custom font" size:15]; etc... The problem is that when I launch the app the text in label is with default font instead of using the specific one. What I miss here ? EDITED Well it seem works now, but the font applies only

iOS custom font path for UIWebViews

邮差的信 提交于 2019-11-30 15:57:28
问题 I have a UIWebView and I have a custom font I want to load into an editable html document that I will be displaying through the UIWebView. In my SupportingFiles (resources) folder I have "Nosifer-Regular.ttf"... To use the custom font in my HTML I need the path (URL) to the font tile... I tried doing this, but it didn't seem to work... any ideas? bundle = [NSBundle mainBundle]; pathFont = [bundle bundlePath]; fontURL = [NSBundle pathForResource:@"Nosifer-Regular" ofType:@"ttf" inDirectory

iOS custom font path for UIWebViews

Deadly 提交于 2019-11-30 15:26:42
I have a UIWebView and I have a custom font I want to load into an editable html document that I will be displaying through the UIWebView. In my SupportingFiles (resources) folder I have "Nosifer-Regular.ttf"... To use the custom font in my HTML I need the path (URL) to the font tile... I tried doing this, but it didn't seem to work... any ideas? bundle = [NSBundle mainBundle]; pathFont = [bundle bundlePath]; fontURL = [NSBundle pathForResource:@"Nosifer-Regular" ofType:@"ttf" inDirectory:pathFont]; path_font = [fontURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

How to use custom fonts in a mac application?

别来无恙 提交于 2019-11-30 14:01:14
I try to use custom fonts in my swift app, but they don't load. I copy the fonts.ttf in my resources folder, and I added the names in Info.plist under "Fonts provided by application " key. I've try with "Application fonts resource path" key from .plist , but no results. Here is the code I used to apply my font. I've try with : "MyFont.ttf" , and "MyFont" @IBOutlet weak var label:NSTextField! override func awakeFromNib() { label.font = NSFont(name: "MyFont.ttf", size: 15) } Leo Dabus First add the desired font you want to embed to your OSX app to your project: Then click project > Info, then

How to Insert NSAttributedString using custom keyboard extension?

﹥>﹥吖頭↗ 提交于 2019-11-30 12:57:05
I want to write text in some custom fonts using keyboard Extension as these apps ( 1 , 2 , 3 , 4 ) are doing. I know how we can insert normal string in document proxy. [self.textDocumentProxy insertText:mystring]; I have tried to insert NSAttributedString using above approach but I can't see any way to insert NSAttributedString to document proxy. Some one can guide what will the best way to get rid of this issue? any suggestion will be appreciated. It is not possible to insert attributed strings (or otherwise rich content) using the text document proxy. The keyboards you have linked are not

Assets folder in Android Studio?

丶灬走出姿态 提交于 2019-11-30 03:01:45
Im trying to use a custom font, and I've read that I suppose to place the fonts in assets/fonts. I'm using Android Studio and it doesn't seem like I have a assets folder. So I created one. But my app crashes when I place the assets folder in src/main. Im using this code to load my fonts. Typeface fontRegular = Typeface.createFromAsset(getAssets(), "fonts/DroidSans.ttf"); Typeface fontBold = Typeface.createFromAsset(getAssets(), "fonts/DroidSans-Bold.ttf"); myDeviceModelTxt.setTypeface(fontRegular); What am I doing wrong? I am not sure if there has been any bug fixes since this was asked, but I

Can't use custom font in iOS app

[亡魂溺海] 提交于 2019-11-29 23:59:40
问题 I'm trying to use custom font for my iOS app. Here is what I do I added my custom font (m.tff) to Xcode Supporting files directory. Also I create entry called Fonts provided by application with value name of the font (m.tff) in myApp.plist In my view I have a label UILabel *label = [[UILabel alloc]initWithFrame:CGRect(10, 20, 230, 30)]; label.font = [UIFont fontWithName:@"My custom font" size:15]; etc... The problem is that when I launch the app the text in label is with default font instead

How to Insert NSAttributedString using custom keyboard extension?

↘锁芯ラ 提交于 2019-11-29 18:20:23
问题 I want to write text in some custom fonts using keyboard Extension as these apps (1,2,3,4) are doing. I know how we can insert normal string in document proxy. [self.textDocumentProxy insertText:mystring]; I have tried to insert NSAttributedString using above approach but I can't see any way to insert NSAttributedString to document proxy. Some one can guide what will the best way to get rid of this issue? any suggestion will be appreciated. 回答1: It is not possible to insert attributed strings

custom fonts with different vertical metrics between OS's

戏子无情 提交于 2019-11-29 14:54:03
问题 I am trying to include a custom font for a page I am building. My problem is that the font vertical alignment looks different on my ubuntu development machine and on windows pc's. First, here are the images to understand the problem Edit: unfortunately as a new user I cannot post images, so here is a description: The issue is the distance between the fonts baseline and the element beneath it. There is an unexplained gap on my ubuntu machine that it's not a padding/margin. Even if you select

Custom font not working in lollipop

。_饼干妹妹 提交于 2019-11-29 07:59:42
Is there any way to use geomanist(custom) font in android lollipop. But it works in all other version. Here is my code In MyApplication class FontsOverride.setDefaultFont(this, "DEFAULT", "geomanist-lightnew.ttf"); FontsOverride.setDefaultFont(this, "MONOSPACE", "geomanist-lightnew.ttf"); FontsOverride.setDefaultFont(this, "SERIF", "geomanist-lightnew.ttf"); FontsOverride.setDefaultFont(this, "SANS_SERIF", "geomanist-lightnew.ttf"); public final class FontsOverride { public static void setDefaultFont(Context context, String staticTypefaceFieldName, String fontAssetName) { final Typeface