Re: Meaning of NSFont italicAngle?
Re: Meaning of NSFont italicAngle?
- Subject: Re: Meaning of NSFont italicAngle?
- From: Henry McGilton <email@hidden>
- Date: Thu, 4 Nov 2004 11:45:40 -0800
On Thursday, November 4, 2004, at 10:47 AM, Thomas Lachand-Robert wrote:
Le 4 nov. 04, à 18:28, Henry McGilton a écrit :
On Wednesday, November 3, 2004, at 02:15 PM, Thomas Lachand-Robert
wrote:
Hi all,
I would like to know the true meaning of italicAngle for a NSFont.
The doc says:
- (float)italicAngle
Returns the receiver’s italic angle, the amount that the font is
slanted in degrees clockwise from the vertical, as read from its AFM
file.
What 'doc' are you reading? My documentation of NSFont says:
Returns the receiver's italic angle, the amount that the font
is slanted in degrees counterclockwise from the vertical,
as read from its AFM file.
Note 'counterclockwise'. Given that context, a clockwise slant
should
be interpreted as a negative number. In general, Adobe PostScript
(and
by extension, font metrics) use positive values to mean
counterclockwise
rotations.
I return you the question. (Maybe you got the doc for Tiger?) I just
copied and paste from Apple's developer doc. I get the same on the web
site:
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSFont.html#//apple_ref/doc/uid/
20000382/italicAngle
I was referencing my 10.2 developer reference documentation. The NSFont
page says its last update was July 1, 2002. That's where I got the
paragraph with the 'counterclockwise' in it.
I also checked with the Adobe Font Metrics Specification, Version 4.1,
dated 7 October 1998. It states that the Italic Angle is a
'counterclockwise'
angle.
The reference on Apple's web site that you provided above was updated on
August 31, 2004.
So it looks as if there are two or possibly even three problems.
1. Apple have decided to change the convention for the direction
of angles.
This scenario is unlikely, as NSBezierPath and NSAffineTransform
appear to be staying with the counterclockwise convention.
2. Somebody injected a 'bug' into the NSFont documentation in the
past couple of years.
This scenario sounds more likely to me.
3. The angles measured on the screen and the angles as reported by
NSFont's italicAngle method appear to be off by a factor of
ten.
I poked through the archives at mamsam and cocoabuilder, and the
only references to italicAngle are our discussion.
Would somebody at Apple please confirm the truth of both the
documentation and NSFont behaviour, before we file bugs?
I am surprised that this has not cropped up before. Maybe
none of applications using the text system know about using
italic correction --- I know for sure Micro$oft Internet
Exploder doesn't.
Anyway I don't mind much the sign, since I know how the fonts are
slanted in my case. I am looking for the amount.
And 1.5 degree is a very small angle, so it's probably not that
(but in radians, it's too much!). Could it be the tangent of the
angle?
I checked the AFM file for Times-Italic. The AFM file says that the
Italic angle is -15.5. I used TextEdit to display some Times-Italic
text at large size, and, using my trusty Protractors application,
measured
the angle as being approximately 15 degrees clockwise from the
vertical.
I also checked the AFM file for Helvetica-Oblique. The AFM file says
that the
Italic angle is -12.0. I used TextEdit to display some
Helvetica-Oblique
text at large size, and, using my trusty Protractors application,
measured
the angle as being approximately 12 degrees clockwise from the
vertical.
I also checked for Optima-Oblique (which for some obscure reason
Cocoa wants
to be called Optima-Italic). The AFM file says Italic angle is
-11.0 (this
is an old AFM file). The system reports the angle as -1.2.
Very unlikely that the number is the tangent. The tangent of -15.5
degrees
is about -0.278.
There does seem to be some kind of anomaly, though. It's as if the
system is
off by a factor of ten in every case.
Could somebody at Apple comment on this anomaly?
Yes I agree with you: it's probably a factor 10 or something. Anyway
you proved that it is NOT the value in the AFM file, so the doc is
definitely wrong.
Thanks for your comments and experiments,
Regards,
........ Henry
===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden | http://www.trilithon.com
|
===============================+============================
===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden | http://www.trilithon.com
|
===============================+============================
===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden | http://www.trilithon.com
|
===============================+============================
===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden | http://www.trilithon.com
|
===============================+============================
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden