Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 51    Views: 853

mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
05/16/13 09:41 AM (10 years ago)

Need to add some flare, custom fonts?

I'm working with the button menu right now, but the font it's using (default) is pretty boring right now. I've never done anything with fonts beyond Danny's Design Menu. Could anyone suggest where I could download(?) new fonts and how to integrate them into buzztouch's screens like the button menu? Cheers! David https://buzztouchmods.com
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 09:47 AM (10 years ago)
if you go to iosfonts.com it will show you all the fonts that are available already built in. to change the font search in the xcode project for font and change whatever you need there
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
05/16/13 09:47 AM (10 years ago)
Hey David, I use fontspace.com - be sure to check the fonts licence though, some don't allow commercial use for free. Is this for Android or iOS?
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 09:53 AM (10 years ago)
@Kittsy - thanks, I'll take a look through xcode now! @raveyd, I'll be sure to check that out too! it's iOS :) Cheers mates. David https://buzztouchmods.com
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 09:57 AM (10 years ago)
@Kittsy is it me or do the fonts on that site look almost all the same? I literally only could find one font that looked different (other then bolding/sizes) :-( @raveyd, found an awesome font and downloaded it - any tips on where/how to implement it for the button menu? Cheers, David https://buzztouchmods.com
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
05/16/13 10:00 AM (10 years ago)
Hi David, for Android yes, for iOS no!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 10:00 AM (10 years ago)
Here's something from my bookmark list, it's about common mistakes but explains how it's done properly. You still need to do the search and replace the code http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 10:02 AM (10 years ago)
@raveyd I forgot that you're an android guy! LOL. Nice to see you again. @kittsy, I'll check the link out and do some work to find out. Thanks a ton for the information. Also thanks for the props in that other thread about push notifications, forsure I can help that person with a "push only" login page. Wish me luck! David https://buzztouchmods.com
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 10:07 AM (10 years ago)
I'll save you the xcode search its line 489 you need to amend in the BT_screen_menuButtons.m
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 10:11 AM (10 years ago)
NICE! So it would be: [buttonLabel setFont:[UIFont systemFontOfSize:buttonLabelFontSize]]; To: [buttonLabel setFont:[UIFont fontWithName:@"FONTNAMEHERE" size:20]]; ? Thanks for the quick tip!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 10:14 AM (10 years ago)
yup but you can change 20 to buttonLabelFontSize so you can still change the size in the cpanel
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 10:18 AM (10 years ago)
Just realized my mistake yup! Thanks. Seems I did everything correct but still no custom font. The tutorial you gave me shows his fonts as .otf, my font has a .ttf extension, could that possible be it? David
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 10:32 AM (10 years ago)
Sorry to be a pain when your making the array in the plist its called "UIAppFonts" not "Fonts provided by application" lol the code changed in the last update due to combining mac and iosapps together just checked my code snippet list
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 10:33 AM (10 years ago)
LAME. I thought it was a little different from Danny's implementation. Let me try that - thanks! David
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 10:37 AM (10 years ago)
You should see my snippet list it's that long now I may as well google it again
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 10:39 AM (10 years ago)
Haha! I have my own snippets list I just added this too, thought I was the only one! However no luck yet, thinking that .ttf may not work, perhaps otf? Still looking into this... standby! David
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 10:43 AM (10 years ago)
Works! Was not the extension, had to do with finding that damn correct font name. Can't believe there is no easier method! Thanks so much for the help guys, this is a really cool touch that I can add to my apps now. Cheers, David https://buzztouchmods.com
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 10:44 AM (10 years ago)
great stuff adding a different font does look incredibly cool when you get it right anyway lol
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 10:53 AM (10 years ago)
I can't believe I've never done it before! The font looks great, however, it collides (touches) with the button image, I need to make the font move a little further below the buttons. Now to search the code for Label Layout style "below buttons"! David
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 10:57 AM (10 years ago)
//if the label is "above or below" add height of label to top value if([buttonLabelLayoutStyle isEqualToString:@"above"] || [buttonLabelLayoutStyle isEqualToString:@"below"]){ top += labelHeight; } Looks like it's not a simple value that determines how much space is between the button and label. I tried changing labelHeight to a number, no changes shown. Looking further, might be useful for others!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 10:59 AM (10 years ago)
line 362 int labelHeight = self.buttonLabelFontSize + 8; change +8 to whatever
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 11:01 AM (10 years ago)
Hmm I've been messing with it but it doesn't seem to be the right case, it's moving the labels out of position but not "away" from the button (space between the label/button). I'll keep trying different numbers.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 11:03 AM (10 years ago)
YES adding them LOWERS the label, but then the buttons under the label do not move and overlap the label. LOL.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
05/16/13 11:05 AM (10 years ago)
Agree. Can transform a plain looking app into something awesome. A couple of things to look out for with custom fonts - they may not correspond to the correct sp sizes, try and compare to a regular device font in photoshop or something, make sure the characters are at least similar in size otherwise you may need to do a lot of font size tweaking, which you may be experiencing? Also, make sure every character has been created - on fontspace there are screen shots of all the characters. For example, it's annoying to add a font to find that all the numbers are asterisk's!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 11:09 AM (10 years ago)
is that not the button padding option. the button padding option controls both horizonatal and vertical so go to line 339 change int top = buttonPadding; to int top = buttonPadding + 10; or whatever you change the label too
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 11:11 AM (10 years ago)
I thought that too @kittsy, but that moves both the button AND the label down - weird right? @rave - a whole new world! Thanks for the tip! David
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 11:19 AM (10 years ago)
looks like I'm going to have to run some code lol
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 11:19 AM (10 years ago)
looks like I'm going to have to run some code lol
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 11:21 AM (10 years ago)
Haha! Thank you Kittsy, glad to have your support. David
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 11:27 AM (10 years ago)
that works when I test it whats your font called give me a few control panel dimensions see if we can recreate it
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 11:34 AM (10 years ago)
6 BUTTONS Grid Layout Below Buttons Allow Scrolling Small Device: Size: 123 Margin: 25 Corner: 20 Font: 25 http://www.fontspace.com/luedecke-design-font-co/dynasty
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 11:41 AM (10 years ago)
line 400 labelRect = CGRectMake(0, buttonSize + 10, buttonSize, labelHeight); note the + 10 did you remember to add buttonLabelFontSize To replace the 20: [buttonLabel setFont:[UIFont fontWithName:@"FONTNAMEHERE" size:20]]; if that doesn't work show me a screen shout as this looks fine on my end
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 11:44 AM (10 years ago)
[buttonLabel setFont:[UIFont fontWithName:@"Dynasty" size:buttonLabelFontSize]]; Like that right? The +10 was not there, adding it now, one second.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 11:47 AM (10 years ago)
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 11:58 AM (10 years ago)
//build screen -(void)layoutScreen{ [BT_debugger showIt:self theMessage:@"layoutScreen"]; //appDelegate favouritesplugin_appDelegate *appDelegate = (favouritesplugin_appDelegate *)[[UIApplication sharedApplication] delegate]; self.deviceWidth = [appDelegate.rootApp.rootDevice deviceWidth]; self.deviceHeight = [appDelegate.rootApp.rootDevice deviceHeight]; //if we are hiding the tabber we need to add some space at the bottom if([[BT_strings getStyleValueForScreen:[self screenData] nameOfProperty:@"hideBottomTabBarWhenScreenLoads" defaultValue:@"0"] isEqualToString:@"1"]){ self.deviceHeight += 40; } //if we are in landscape, swap width / height values self.deviceWidth = UIInterfaceOrientationIsPortrait(self.interfaceOrientation) ? [appDelegate.rootApp.rootDevice deviceWidth] : [appDelegate.rootApp.rootDevice deviceHeight]; //adjust scroller size... [self.myScrollView setFrame:CGRectMake(0, 0, deviceWidth, deviceHeight)]; //holds each view/button for tracking what was tapped self.menuItemViews = [[NSMutableArray alloc] init]; //we may be refreshing so we need to "empty" the scrollview for(UIView *subview in [self.myScrollView subviews]){ [subview removeFromSuperview]; } //possible button layout styles: grid, verticalLeft, verticalRight, horizontalTop, horizontalBottom //possible label layout styles: above, top, middle, bottom, below (labels are same width as buttons) //default values int left = buttonPadding; int top = buttonPadding; int tmpCount = 0; //controls go in a box so we can center everything. /* IMPORTANT. If the screen uses a transparent navigation bar, the buttons will appear underneath the navigation bar, move them down 44 pixels to prevent this. */ if([[BT_strings getStyleValueForScreen:self.screenData nameOfProperty:@"navBarStyle" defaultValue:@""] isEqualToString:@"transparent"]){ top = (top + 44); } //if this is a tabbed app, remove space for bottom tabs... if([appDelegate.rootApp.tabs count] > 0){ deviceHeight = (deviceHeight - 50); } //number of buttons in array int numButtons = [self.menuItems count]; //"box size" must get larger if label is "above" or "below" the button int boxWidth = self.buttonSize; int boxHeight = self.buttonSize; int labelHeight = self.buttonLabelFontSize + 8; //if we are using "grid" layout, we need to calculate how may buttons per row so columns/rows work out double buttonsPerRow = floor(deviceWidth / (boxWidth + buttonPadding)); //label and box frames depend on the buttonLabelLayoutStyle CGRect buttonRect = CGRectMake(0, 0, buttonSize, buttonSize); CGRect labelRect = CGRectMake(0, 0, buttonSize, labelHeight); //if label is above, frame for box needs to be taller. if([buttonLabelLayoutStyle isEqualToString:@"above"]){ boxHeight = (boxHeight + labelHeight); buttonRect = CGRectMake(0, labelHeight, buttonSize, buttonSize); labelRect = CGRectMake(0, 0, buttonSize, labelHeight); } //if label is on top, above icon if([buttonLabelLayoutStyle isEqualToString:@"top"]){ boxHeight = buttonSize; buttonRect = CGRectMake(0, 0, buttonSize, buttonSize); labelRect = CGRectMake(0, 0, buttonSize, labelHeight); } //label in middle if([buttonLabelLayoutStyle isEqualToString:@"middle"]){ boxHeight = buttonSize; buttonRect = CGRectMake(0, 0, buttonSize, buttonSize); labelRect = CGRectMake(0, (buttonSize / 2) - (labelHeight / 2), buttonSize, labelHeight); } //label on bottom, under icon if([buttonLabelLayoutStyle isEqualToString:@"bottom"]){ boxHeight = buttonSize; buttonRect = CGRectMake(0, 0, buttonSize, buttonSize); labelRect = CGRectMake(0, (buttonSize - labelHeight), buttonSize, labelHeight); } //label below box, frame for box needs to be taller. if([buttonLabelLayoutStyle isEqualToString:@"below"]){ boxHeight = (boxHeight + labelHeight); buttonRect = CGRectMake(0, 0, buttonSize, buttonSize); labelRect = CGRectMake(0, buttonSize + 10, buttonSize, labelHeight); } //setup scroll view. It's size depends on the button layout int contentWidth = 0; int contentHeight = 0; //grid if([buttonLayoutStyle isEqualToString:@"grid"] || [buttonLayoutStyle isEqualToString:@""]){ contentWidth = deviceWidth; contentHeight = ((boxHeight + labelHeight) * (numButtons + 10)) / buttonsPerRow - (deviceHeight * 1.5); if(contentHeight < deviceHeight) contentHeight = (deviceHeight + 50); self.myScrollView.frame = CGRectMake(0, 0, deviceWidth, deviceHeight); self.myScrollView.contentSize = CGSizeMake(contentWidth, contentHeight); } //verticalLeft if([buttonLayoutStyle isEqualToString:@"verticalLeft"]){ contentWidth = (boxWidth + buttonPadding); contentHeight = numButtons * (boxHeight + buttonPadding) + (boxHeight + buttonPadding) + 125; if(contentHeight < deviceHeight) contentHeight = (contentHeight + 100); self.myScrollView.frame = CGRectMake(0, 0, boxWidth + (buttonPadding * 2), deviceHeight); self.myScrollView.contentSize = CGSizeMake(contentWidth, contentHeight); } //verticalRight if([buttonLayoutStyle isEqualToString:@"verticalRight"]){ contentWidth = (boxWidth + buttonPadding); contentHeight = numButtons * (boxHeight + buttonPadding) + (boxHeight + buttonPadding) + 125; if(contentHeight < deviceHeight) contentHeight = (contentHeight + 100); self.myScrollView.frame = CGRectMake(deviceWidth - (boxWidth + buttonPadding + buttonPadding), 0, boxWidth + (buttonPadding * 2), deviceHeight); self.myScrollView.contentSize = CGSizeMake(contentWidth, contentHeight); } //horiztonalTop if([buttonLayoutStyle isEqualToString:@"horizontalTop"]){ contentWidth = (numButtons + 1) * (boxWidth + buttonPadding) + 100;; contentHeight = (boxHeight + labelHeight); if(contentWidth < deviceWidth) contentWidth = (contentWidth + 75); self.myScrollView.frame = CGRectMake(0, 0, deviceWidth, (boxHeight + labelHeight)); self.myScrollView.contentSize = CGSizeMake(contentWidth, contentHeight); } //horiztonalBottom if([buttonLayoutStyle isEqualToString:@"horizontalBottom"]){ contentWidth = (numButtons + 1) * (boxWidth + buttonPadding) + 100; contentHeight = (boxHeight + labelHeight); if(contentWidth < deviceWidth) contentWidth = (contentWidth + 75); //landscape or portrait...tabbed or not... if(UIInterfaceOrientationIsPortrait(self.interfaceOrientation)){ //portrait mode self.myScrollView.frame = CGRectMake(0, (deviceHeight - boxHeight - boxHeight), deviceWidth, (boxHeight + labelHeight)); }else{ //landscape mode favouritesplugin_appDelegate *appDelegate = (favouritesplugin_appDelegate *)[[UIApplication sharedApplication] delegate]; if([appDelegate.rootApp.tabs count] > 0){ self.myScrollView.frame = CGRectMake(0, (deviceHeight - boxHeight - boxHeight) - (45 + boxHeight + labelHeight), deviceWidth, (boxHeight + labelHeight)); } } self.myScrollView.contentSize = CGSizeMake(contentWidth, contentHeight); } //add each menuItem (button) for(int x = 0; x < numButtons; x++){ BT_item *thisMenuItem = [self.menuItems objectAtIndex:x]; tmpCount++; //create the label and the box after we figured out the frames. UIView *buttonBox = [[UIView alloc] initWithFrame:CGRectMake(left, top, boxWidth, boxHeight)]; [buttonBox setTag:x]; UILabel *buttonLabel = [[UILabel alloc] initWithFrame:labelRect]; [buttonLabel setBackgroundColor:[UIColor clearColor]]; [buttonLabel setNumberOfLines:1]; [buttonLabel setTextColor:buttonLabelFontColor]; [buttonLabel setTextAlignment:NSTextAlignmentCenter]; [buttonLabel setFont:[UIFont fontWithName:@"Dynasty" size:buttonLabelFontSize]]; if([[thisMenuItem jsonVars] objectForKey:@"titleText"]){ [buttonLabel setText:[[thisMenuItem jsonVars] objectForKey:@"titleText"]]; } //init a BT_button (this is background color or image) BT_button_view *thisButton = [[BT_button_view alloc] initWithButtonItemData:(BT_item *)[self.menuItems objectAtIndex:x] theParentMenuScreenData:[self screenData]]; [thisButton setFrame:buttonRect]; [thisButton setAlpha:buttonOpacity]; [thisButton setUserInteractionEnabled:YES]; [buttonBox addSubview:thisButton]; //fire the showImage function in BT_button (it runs in a background thread) [thisButton showImage]; [thisButton release]; thisButton = nil; //BT_button is a UIView, add a transparent button on top so it's "clickable" UIButton *tmpButton = [[UIButton alloc] initWithFrame:buttonRect]; [tmpButton addTarget:self action:@selector(menuItemTap:) forControlEvents:UIControlEventTouchUpInside]; [tmpButton setTag:x]; [buttonBox addSubview:tmpButton]; [tmpButton release]; tmpButton = nil; //add label after backround [buttonBox addSubview:buttonLabel]; //add buttonBox to items array so we can refer to it when it's tapped [self.menuItemViews addObject:buttonBox]; //add to scroll view [myScrollView addSubview:buttonBox]; //clean up [buttonBox release]; buttonBox = nil; [buttonLabel release]; buttonLabel = nil; ///////////////////////////////////////////////// //left and top depend on the buttonLayoutStyle //grid (resets rows / cols in loop) if([buttonLayoutStyle isEqualToString:@"grid"]){ //increment left left = (left + buttonSize + buttonPadding); //do left or top need reset? if(tmpCount >= buttonsPerRow){ left = buttonPadding; top = (top + (buttonSize + buttonPadding)); //if the label is "above or below" add height of label to top value if([buttonLabelLayoutStyle isEqualToString:@"above"] || [buttonLabelLayoutStyle isEqualToString:@"below"]){ top += labelHeight; } //reset tmpCount = 0; } } //verticalLeft or verticalRight (top changes, left constant) if([buttonLayoutStyle isEqualToString:@"verticalLeft"] || [buttonLayoutStyle isEqualToString:@"verticalRight"]){ top = (top + (boxHeight + buttonPadding)); } //horizontalTop or horizontalBottom (left changes, top constant) if([buttonLayoutStyle isEqualToString:@"horizontalTop"] || [buttonLayoutStyle isEqualToString:@"horizontalBottom"]){ left = (left + buttonSize + buttonPadding); } }//end for each button... //flag as not loading self.isLoading = FALSE; }
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 11:58 AM (10 years ago)
replace that entire method with this see what happens. change the app delegate stuff
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 12:02 PM (10 years ago)
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 12:03 PM (10 years ago)
All fixed!! You also seemed to have fixed the issue where you could scroll the buttons completely out of view to the top.. I was going to tackle that next! What changes were made? Digging into your paste now.. Thanks so much Kittsy. David
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 12:08 PM (10 years ago)
yeah it would make sense to comments in but duh line 400 this is so the font doesnt rest on top of the button above labelRect = CGRectMake(0, buttonSize + 10, buttonSize, labelHeight); i think its was line 497 causing you the problems [buttonLabel setFont:[UIFont fontWithName:@"Dynasty" size:buttonLabelFontSize]];
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 12:09 PM (10 years ago)
It's always a pleasure to help it's the Buzztouch way
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
05/16/13 12:12 PM (10 years ago)
Ha! See it now.. thanks a ton. Big learning experience this font thing. Hoping this thread will help others when doing fonts, as I could not find too many on buzztouch for it. It sure is... thanks again mate. David
 
tb
buzztouch Evangelist
Profile
Posts: 2050
Reg: Nov 03, 2011
Oxford
32,300
like
05/16/13 12:22 PM (10 years ago)
I really like the font 'Exo' I love it. Its free and available or commercial use. It has lots of variations. http://www.fontsquirrel.com/fonts/exo
 
shenry
Aspiring developer
Profile
Posts: 469
Reg: Jan 10, 2012
Orange County, ...
13,390
like
05/16/13 08:32 PM (10 years ago)
This may be completely different from what you're going for, but are you simply trying to create a button image with text - something like this? http://postimg.org/image/564344yw9/
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
06/08/13 06:55 AM (10 years ago)
@shenry I figured it out, thanks! @annadale... that's very cool. Looking for a similar one now! David https://buzztouchmods.com
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
07/17/13 06:22 AM (10 years ago)
Hi Guys, First of all, thanks a million for this post! I have successfully implemented a new font on a plugin. A couple of questions though: @Kittsy, @MrDavid: "[buttonLabel setFont:[UIFont fontWithName:@"FONTNAMEHERE" size:20]]; " "you can change 20 to buttonLabelFontSize so you can still change the size in the cpanel" What would be the exact syntax of the new line of code so it is still connected to the CP? I must be missing something but I am getting an error. Also, I would looooove to apply this fancy new font to the whole of the app (tab bar, nav bar and all plugins), is there a way to do that? Maybe this is not an advisable thing to do? Thanks again! Farcat
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/17/13 07:20 AM (10 years ago)
[buttonLabel setFont:[UIFont fontWithName:@"FONTNAMEHERE" size:buttonLabelFontSize]]; that is if that screen has a font size box in the control panel
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
07/17/13 07:34 AM (10 years ago)
@farcat the syntax would be: [buttonLabel setFont:[UIFont fontWithName:@"FONT" size:buttonLabelFontSize]]; you shouldn't have any errors of course unless the font label should be renamed depending on your plugin. this works for buttonlabel if you used titleLabel, you would have to make changes to both.
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
07/17/13 07:43 AM (10 years ago)
Sorry kittsy i didnt' see your reply. i was busy adding it to my code when i saw farcat's question!
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
07/17/13 01:44 PM (10 years ago)
Arghh, off course it couldn't work! Silly me. It wasn't a button menu plugin, yet I was trying "buttonlabel". Thanks for pointing this out. Any idea of how to use that method on the whole app? Maybe the font has to be set in all the different areas of the app? Thanks, Farcat
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/17/13 02:10 PM (10 years ago)
what screen do you want to change the font to. if you search for font in your project you will find all the instances you will see a lot of this audioStatusLabel.font = [UIFont systemFontOfSize:15]; and [quizTimeLabel setFont:[UIFont systemFontOfSize:16]]; scattered around the classes you would just change them to audioStatusLabel.font = [UIFont fontWithName:@"FONTNAME" size:15]; and [quizTimeLabel setFont:[UIFont fontWithName:@"FONTNAME" size:16]; experimentation is the key do one at a time
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
07/18/13 03:46 AM (10 years ago)
Thanks @Kittsy, I managed to change the fonts to all plugins I wanted. The tricky part was the nav bar , I posted an amended solution here: <a href="https://www.buzztouch.com/forum/thread.php?tid=E628479F58AF4765A8AE01C&command=isSearching&currentPage=1&topicTitle=&createdBy=Mackimack&repliedBy=&minViews=-1&maxViews=-1&minReplies=-1&maxReplies=-1&forumCategory=" target="_blank" rel="nofollow">https://www.buzztouch.com/forum/thread.php?tid=E628479F58AF4765A8AE01C&command=isSearching&currentPage=1&topicTitle=&createdBy=Mackimack&repliedBy=&minViews=-1&maxViews=-1&minReplies=-1&maxReplies=-1&forumCategory=</a> I can't find the right place to change the font for the Tab bar though. So far, I tried making the changes here: - on the appDelegate.m file (line 73), from : [UIFont systemFontOfSize:14.0f] to [UIFont fontWithName:@"Regencie" size:14.0f] - on the BT_viewUtilities.m file (line 150), from : [UIFont systemFontOfSize:16] to [UIFont fontWithName:@"Regencie" size:16] I combed all the files for Font references (including BT_Core) and couldn't find anymore. Any idea? Thanks, Farcat
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
07/18/13 12:53 PM (10 years ago)
Panic over, to change the font on the tab bar in the appDelegate.m file I have replaced: [UIFont systemFontOfSize:14.0f], UITextAttributeFont,nil] forState:UIControlStateHighlighted]; by [UIFont systemFontOfSize:14.0f], UITextAttributeFont,nil] forState:UIControlStateNormal]; Now are my fonts are consistent from top to bottom :)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.