I don’t have any great suggestions myself unfortunately. I took a quick look at 
CoreText APIs (which I would suggest for you over using Cocoa, probably) and 
didn’t see an immediate replacement API for answering “widest character”. I’m 
sure it would be possible to run through the font and look at the width of each 
character to identify the widest one. Or, if you’re always making this call for 
Geneva, and never any other font, you could also just run this code on 10.11, 
make a note of the results, and hardcode those results in your app for cases 
where FetchFontInfo returns an error. The Geneva font certainly isn’t going to 
change its metrics ever again.

-eric


> On Nov 11, 2016, at 5:29 PM, Mark Lucas <catkee...@aol.com> wrote:
> 
> Hi Eric,
> 
> Thanks for the prompt reply.
> 
> Okay I’m totally out of my depth here — in millions of user-hours logged 
> against this widely-used code just within our app alone, this AFAIK is the 
> first time FetchFontInfo’s ever failed here (and since unfortunately thanks 
> to a decades-old coding error it crashes our app, I think I’d probably have 
> heard).
> 
> This is down inside WASTE’s WENew code, so I’m not really sure how to go 
> about trying to replace it with ATSUI (which IIRC wants an actual block of 
> text in addition to a font, size, and face to generate metrics, and at this 
> stage there isn’t any….) or whether that’s likely to make any difference. Of 
> course I could guess, but is there a straightforward way to actually identify 
> the widest character in a font so I could pass that? Is there perhaps a Cocoa 
> API I could readily fall back to in these situations? It only has to work in 
> Sierra+...
> 
> When I file a bug on this, should I include a copy of our user’s 
> Geneva.dfont? Is there anything that would be useful?
> 
> Thanks!
> -Mark
> 
> 
>> On Nov 11, 2016, at 7:41 PM, Eric Schlegel <eri...@apple.com> wrote:
>> 
>> Doesn’t sound like anything I’ve heard of in Sierra, so I’m afraid I have no 
>> suggestions offhand. Most likely it’s fallout from ongoing changes to the 
>> font system (adding support for San Francisco as the system font, for 
>> example).
>> 
>> -eric


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (Carbon-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/carbon-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to