Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: CoreGraphics encodings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreGraphics encodings




On Feb 25, 2011, at 1:11 AM, Adriaan van Os wrote:

Scott Thompson wrote:
Generally speaking, you shouldn't  be using Core Graphics to draw text.  If you want to draw text use Core Text, Cocoa Text, or (possibly) ATSUI.

Programming the Mac is more and more getting a religious issue instead of a scientific. We are no longer supposed to solve technical issues based on logical reasoning and precise facts. No, a priest is telling us what to do to receive Apple Salvation and Apple Absolution. And when there is a problem, we will look away, as God himself will take care of it.

Thank you for you your treatise on comparative theology.  I am certain that the next time I need an in-depth discussion on theology it is to the enlightened people of the Netherlands whose religious persecution induced my country's forbearers to see indentured servitude and a life of hardship in an unsettled new world that I will turn.  Although I must express a concern for your own well being because, if the trials of Geert Wilders, extending from the farsical definition your countrymen attach to Freedom of Speech are any indication, it would appear that the officials of your country may not look kindly on any of your public attempts at the aforementioned comparative theology.

But I digress.  Theology was your own concern I was trying to impart information based on my experience.

From the tenor of your questions on this list, I gather that you may have been only recently been introduced to the programming environment of the Macintosh.  I consider, therefore, that you may not have the benefit of having seen my presentation on the font system in Mac OS X at Apple's World Wide developer's conference in the early 2000's.  Your original question also suggests that you probably missed the book I wrote on Core Graphics which was published late in 2006 which goes into rather significant detail about why the text handling routines in Core Graphics are, most of the time, insufficiently powerful to fully handle the complex task of rendering text in the modern era of unicode (an in particular recent inventions like the Euro).

I will, therefore, look with understanding upon your naivete and provide you with a more direct answer to your question.  I will be very careful to trace the logic of my answer for you lest you fear that I am once again trying to present you with "religious" exposition.

MacRoman is a text encoding which was developed to support an extended character set of 256 characters.  Those 256 characters can be viewed on the Wikipedia page for Mac OS Roman given here:

http://en.wikipedia.org/wiki/Mac_OS_Roman

So far as I know, the MacRoman encoding dates to the earliest days of the Macintosh.  As I recall there was a table presenting the characters in the set in the first volume of Inside Macintosh.  My copy came from around 1986 and I believe it was the second edition of the book. (You will have to forgive me if I don't go into the attic and dig up the book itself).

Also according to Wikipedia, it would appear that the Euro, as a currency, dates from the mid 1990's.  I hope that pure logic will lead you to realize that this was approximately 10 years, a full decade, after the character encodings of the MacRoman characters set had been established.

As such, we should not be surprised that the Euro symbol is not accounted for in the MacRoman encoding.  While Apple does seem to be prescient on a great many details, in my quarter of a century experience with the company those details have not typically revolved around global currency markets.  But again, I digress.

Given that the MacRoman character set does not contain the Euro symbol.  We must conclude that any drawing routine whose extent is limited to MacRoman would probably not be the ideal choice when trying to convert a string from that encoding into a set of glyphs to be drawn on a computer.  Your own scientific research, carefully conducted no doubt, led you to realize that Core Graphics highest-level text drawing routine was limited in this regard.

And so you turned to the Quartz-Dev forum, presumably looking for individuals who might know better than you yourself do, how to solve your problem.

In my response I tried to point out your error gently.  I could have said "You are a fool who does not know what he is doing.  Obviously you should be using a higher level API to perform the task you are trying to perform.  Please learn about Core Text."  However calling you a fool, when your problem is mere ignorance, would have been unconscionably rude.

Instead I tried to give you a direction in which to further your research, your scientific investigation. I tried to give you Rule of Thumb to guide your exploration.  I'm not certain that the english idiomatic _expression_ "Rule of Thumb" carries into international markets.  (I believe it should as it originated with German brewers who lacked proper thermometers and needed guidance to help them find the right temperatures for their mashes).  Still, just in case it does not, we turn again to Wikipedia where the definition of the rule of thumb is given as:

rule of thumb is a principle with broad application that is not intended to be strictly accurate or reliable for every situation.

This is precisely what I hoped to provide.

Now Arthur C. Clark would have us believe that "Any sufficiently advanced technology is indistinguishable from magic".  In this case we might understand that "science" is knowledge hard won through long years of careful research, experimentation, and observation.  We might also understand that "magic" is very close to "religion" in many contexts.  From that we might conclude that an overly ignorant person might mistake the sage advice of a scientist, one steeped in the lore hard won through research, experimentation and observation, as merely as statement of "magic" or "religion".  But Arthur C. Clarke was a writer of fiction books, fantasy and stories.  Surely this line of thinking could never apply in the real world.  Could it?


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >CoreGraphics encodings (From: Adriaan van Os <email@hidden>)
 >Re: CoreGraphics encodings (From: Scott Thompson <email@hidden>)
 >Re: CoreGraphics encodings (From: Adriaan van Os <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.