Re: iOS Default font is wrong

2013-10-30 Thread Stephen F Northover
Eh? Just create a bogus native control, query the font and throw the control away. No text node necessary. Stege On 2013-10-30 4:27 PM, Richard Bair wrote: The only problem is that the CSS requires a UI control, so just putting a Text node up gets the wrong size. Also the API we have to say

Re: iOS Default font is wrong

2013-10-30 Thread Richard Bair
The only problem is that the CSS requires a UI control, so just putting a Text node up gets the wrong size. Also the API we have to say get the default font will be wrong. We could just hard-code in a hack for iOS maybe? Richard On Oct 30, 2013, at 12:41 PM, Felipe Heidrich wrote: > Could we

Re: iOS Default font is wrong

2013-10-30 Thread Oldrich Maticka
At least on iOS 7.0 - recommended (default) font for UIButton is not bold. It is System 15.0 (family: Helvetica Neue, style: Regular, size: 15.0) in Interface Builder. Oldrich On 10/30/13 8:41 PM, Felipe Heidrich wrote: Could we call UIFont using Objective-C Runtime Something like: id class

Re: iOS Default font is wrong

2013-10-30 Thread Felipe Heidrich
Could we call UIFont using Objective-C Runtime Something like: id class_UIFont = objc_getClass("UIFont"); SEL sel_labelFontSize = sel_registerName("labelFontSize"); float size = objc_msgSend_fpret(class_UIFont, sel_labelFontSize); ? Anyway, we are back to the original question: What font to

Re: iOS Default font is wrong

2013-10-30 Thread Oldrich Maticka
Hi, CTFontCreateUIFontForLanguage() returns fonts with same sizes for both iOS and Mac OS X. See table below. Unfortunately I made a mistake when I wrote 15.0 for CTFontCreateUIFontForLanguage(kCTFontPushButtonFontType) font size, unfortunately it is 13.0. Other sizes reported were correct (

Re: iOS Default font is wrong

2013-10-30 Thread Felipe Heidrich
Hi, Correct me if I'm wrong, to use UIWhatever or NSWhatever we will need Objective-C (or use the ugly objc_msgSend). That is more work as we don't have Objective-C in native font code. Besides, creating a Button requires, usually, a lot more boilerplate code. We will also have to link to UIKi

Re: iOS Default font is wrong

2013-10-30 Thread Richard Bair
And then eventually some iOS style sheet needs to be created that will give the right defaults for the other controls. I'm hoping to convince Hendrick and Claudette to take on that task :-) > On Oct 30, 2013, at 6:38 AM, Stephen F Northover > wrote: > > Let's use UIButton as this seems to mat

Re: iOS Default font is wrong

2013-10-30 Thread Stephen F Northover
Let's use UIButton as this seems to match the stack overflow discussion. Steve On 2013-10-30 7:51 AM, Oldrich Maticka wrote: I have tried simple app with several controls. Fonts in Interface Builder - UIButton - System 15.0 UILabel - System 17.0 UITextField - System 14.0 UITextView - System

Re: iOS Default font is wrong

2013-10-30 Thread Oldrich Maticka
I have tried simple app with several controls. Fonts in Interface Builder - UIButton - System 15.0 UILabel - System 17.0 UITextField - System 14.0 UITextView - System 14.0 Same fontsize - 15.0 has UIButton's label created at runtime. UIFont class methods for getting system font information ret

Re: iOS Default font is wrong

2013-10-29 Thread Stephen F Northover
I was going to create a dummy control (say a Button) and ask for the font. Just an idea. Steve On 2013-10-29 2:18 PM, Felipe Heidrich wrote: The code Richard sent is creating a dummy font and asking for its size. The problem is that there are about 3 thousand different fonts on the Mac ;-)

Re: iOS Default font is wrong

2013-10-29 Thread Felipe Heidrich
The code Richard sent is creating a dummy font and asking for its size. The problem is that there are about 3 thousand different fonts on the Mac ;-) Here we are creating a CTFont. For Mac OS X most native apps probably would be using a NSFont (cause that is what cocoa controls take). Likewise

Re: iOS Default font is wrong

2013-10-29 Thread Stephen F Northover
If the OS is reporting the wrong value for the default a classic trick is to create a dummy control that normally has the font we want and query that. Steve On 2013-10-29 11:21 AM, Richard Bair wrote: Hi guys, The default font for iOS is supposed to be System Bold 15 (according to http://st

iOS Default font is wrong

2013-10-29 Thread Richard Bair
Hi guys, The default font for iOS is supposed to be System Bold 15 (according to http://stackoverflow.com/questions/17325152/what-size-font-is-the-title-in-a-default-uibutton anyway), and it does look more correct to me. Our code is getting to this native method in MacFontFinder.c JNIEXPORT jf