custom-font

how to load a custom font in iOS app from a file (not from info.plist)?

谁都会走 提交于 2021-02-19 05:42:27
问题 I am wondering if it's possible to load a font from a file (say, internet URL) into my iOS app, before using it in my controls (UILabel, UIButton, etc). I already know the usual technique of pre-packaging it and referencing inside info.plist, but I'm looking for a less static option.... doable? Thanks! 回答1: Yes. It's absolutely possible. You need to look at CTFontManagerRegisterGraphicsFont . Here’s a usage example: NSData *inData = /* your decrypted font-file data */; CFErrorRef error;

Angular web component bundle external custom fonts package

雨燕双飞 提交于 2020-06-13 02:25:15
问题 I have created a web component using custom elements with Angular 8. Part of the component is to show some custom icons (developed and packaged as a different app). I have included the package of the custom icons in the package.json file of the component: "dependencies": { "@somelibrary/icons": "1.0.34" } I gets correctly installed in the node modules. In the angular.json file I include the css file in the styles: "styles": [ "src/styles.css", "node_modules/@somelibrary/icons/css/fontface.css

Flutter custom font not getting applied

给你一囗甜甜゛ 提交于 2020-02-05 04:18:12
问题 Am trying to set a custom font to my Text in Flutter . I have tried everything I know but it didn't work. Is this a bug or something? flutter: uses-material-design: true assets: - assets/images/onboarding1.png - assets/images/onboarding2.png - assets/images/onboarding3.png fonts: - family: Gilroy fonts: - asset: assets/fonts/gilroy_extrabold.otf Dart File SizedBox(height: 30.0), Text( 'Connect with Mentors', style: TextStyle( fontFamily: 'Gilroy', fontSize: 35.0, ), ), 回答1: As mentioned in

UIButton Custom font issue

老子叫甜甜 提交于 2020-01-25 07:07:25
问题 I have added a custom font in to my application and i set that custom font for some of the buttons by sub classing the custom font,in xib custom font set perfectly but while execute in device the font auto adjust to upside in all the button. Here is my custom font sub class code. @interface ButtonWithBebasNeueFont : UIButton @end @implementation ButtonWithBebasNeueFont - (void)awakeFromNib { [super awakeFromNib]; self.titleLabel.font = [UIFont fontWithName:@"BebasNeue" size:self.titleLabel

Issues with custom font in iOS

烈酒焚心 提交于 2020-01-21 06:04:30
问题 I followed the steps outlined in various locations using the UIAppFonts property list key. I'm using the Aller Light font. I've added it as a resource, added the font name correctly in the info property list, and am now attempting to use it, however every attempt to do so results in the default font being displayed. So far I've tried: [leader setFont:[UIFont fontWithName:@"Aller Light" size:20.0]]; [leader setFont:[UIFont fontWithName:@"AllerLight" size:20.0]]; [leader setFont:[UIFont

Custom fonts in rails 5 app and Heroku

删除回忆录丶 提交于 2020-01-16 16:26:21
问题 can you please instruct me on how to add custom fonts to my rails 5 application? i've added my custom fonts files to fonts folder in app/assets. i went on to use the @fontface and font-url in .scss , but my fonts wont take effect after before and[enter image description here pushing to heroku. enter image description here 回答1: I suggest you go modify your application.html and add the fonts there. I don't know what you are trying to do but adding a simple <link href="fonts.googleapis.com/css

Custom fonts in rails 5 app and Heroku

醉酒当歌 提交于 2020-01-16 16:26:00
问题 can you please instruct me on how to add custom fonts to my rails 5 application? i've added my custom fonts files to fonts folder in app/assets. i went on to use the @fontface and font-url in .scss , but my fonts wont take effect after before and[enter image description here pushing to heroku. enter image description here 回答1: I suggest you go modify your application.html and add the fonts there. I don't know what you are trying to do but adding a simple <link href="fonts.googleapis.com/css

Custom Fonts in Java

ⅰ亾dé卋堺 提交于 2020-01-11 02:26:11
问题 How to fix problem with custom fonts in Java? For example, my app uses font, that isn't on all computers. Can I somehow include it in compiled executable and then call it from there, if it doesn't exists on clients computer? What are other alternatives? I could make all fonts chars as images (before, in some graphics app) and then display image for each char... is it ok? 回答1: Here's an utility method I'm using to load a font file from a .ttf file (can be bundled): private static final Font

Custom font for spinner in android [duplicate]

会有一股神秘感。 提交于 2020-01-06 18:52:41
问题 This question already has answers here : How to set font custom font to Spinner text programmatically? (7 answers) Closed 5 years ago . I want to set the custom font for spinner. Here is my pojo class, which is used as spinner item. public class City { private String cityId; private String cityName; public String getCityId() { return cityId; } public void setCityId(String cityId) { this.cityId = cityId; } public String getCityName() { return cityName; } public void setCityName(String cityName

iOS UIWebView totally fails to understand more than one @font-face?

血红的双手。 提交于 2020-01-05 04:11:27
问题 Notice this simple css/html which is being displayed in a local UIWebView: there's the simulator showing it... Notice there are two @font-face definitions. But ... only the second one works. If you swap them around, only the second one works. So here ... @font-face { font-family:'aaa'; src: local('SourceSansPro-Regular'), url('SourceSansPro-Regular.ttf') format('truetype'); } @font-face { font-family:'bbb'; src: local('SourceSansPro-BoldIt'), url('SourceSansPro-BoldItalic.ttf') format(