From: Benjamin R. <b.r...@tu...> - 2008-05-22 18:36:41
|
Hi Daniel, Pat, "Daniel A. Steffen" writes: > You can ask for any numeric weight along a font's weight variation > axis (if present), or with CoreText (10.5 and later) for normalized > numeric weights between -1.0 and 1.0: > http://developer.apple.com/documentation/Carbon/Reference/CTFontDescriptorRef/Reference/reference.html#/ > /apple_ref/doc/uid/TP40005107-CH4-SW1 > so the approach you used for Xft of choosing some arbitrary numeric > font weight to correspond to a given symbolic name could work on OSX > as well. Right now in the Tk code, the font attributes are stored internally using the old QuickDraw font attributes. That is partly a holdover from the old QuickDraw code and partly for the sake of the function TkMacOSXInitControlFontStyle which is used in conjunction with the Control Manager function SetControlFontStyle to initialize native controls with QuickDraw-style font attributes. QuickDraw compatibility functions from the Font Manager are used to get from those attributes to the actual ATSUI font objects. QuickDraw only has "bold" as an attribute, nothing else AFAIK. But we could go away from the QuickDraw compatibility code and use a more ATSUI-like function to get font objects. > You can also enumerate all font instances of a given font and > compare their names to the asked-for weight name, that would allow > finding e.g. a defined 'semibold' instance of a given font if > present. It seems to me that would introduce more "intelligence" (aka "guesswork") into the system, on top of what the OS does already in this regard. I don't like that idea. benny |