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
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
steve.x.northo...@oracle.com wrote:
Let's use
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
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
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
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
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
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
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