diff -r ecfbfa484e1b src/fontcache.cpp
--- a/src/fontcache.cpp	Tue Mar 31 17:46:18 2009 +0000
+++ b/src/fontcache.cpp	Thu Apr 23 19:56:55 2009 +0200
@@ -2,6 +2,19 @@
 
 /** @file fontcache.cpp Cache for characters from fonts. */
 
+#ifdef __APPLE__
+/**
+* Here comes the part which is required, if an Apple computer is to choose a
+ * suitable font for languages which are not English.
+ * We require the ATSUI library and try to restrict us to routines which
+ * are not deprecated under OS-X 10.5 and which will (hopefully) work on 64 bit machines,
+ * too. This library is part of the carbon framework.
+ * Online reference found at:
+ * http://developer.apple.com/documentation/Carbon/Reference/ATSUI_Reference/Reference/reference.html
+ */
+#include <ApplicationServices/ApplicationServices.h>
+#endif /* __APPLE__ */
+
 #include "stdafx.h"
 #include "spritecache.h"
 #include "fontcache.h"
@@ -321,8 +334,39 @@
 	return 0; // stop enumerating
 }
 
-bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid)
+bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, const char *string)
 {
+#ifdef __APPLE__
+	/**
+	 * Here we have to find the locale info with the help of the ATSUI or carbon environment supplied 
+	 * functions and then use that to actually select a font. We do that all differently from the
+	 * linux and windows stuff, guarded by the #ifdef __APPLE__s
+	 */
+	OSStatus ap_err = noErr;
+	
+	// Initilizing the Variables for font matching, casting the types where necessary to ATSU types
+	ATSUTextLayout     text_layout    = (ATSUTextLayout)string;
+	UniCharCount       text_length    = size_of(string);
+	ATSUFontID         *font_ID       = NULL;
+	ATSUStyle          *font_style    = NULL;
+	
+	ap_err = ATSUCreateStyle(text_style);
+	ap_err = ATSUCreateTextLayoutWithTextPtr((ConstUniCharArrayPtr)string,
+													   0,                // Starting char in the text
+													   text_length,      // length of the paragraph
+													   text_length,      // length of the overall text
+													   kATSUToTextEnd,   // same style for the whole text
+													   text_style,       // default style. Maybe needs changing <-- TODO
+													   text_layout);     // return value: Text Layout
+	ap_err = ATSUMatchFontsToText(text_layout,        // Text Layout as obtained above
+								  0,                  // Starting char in the text
+								  text_length,        // lenght of the text
+								  font_ID,            // return value: suggested substitute Apple FontID
+								  changed_offset,     // offset which required a font change
+								  changed_length);    // lenght of section not drawable with current font
+	
+	
+#else
 	EFCParam langInfo;
 	if (GetLocaleInfo(MAKELCID(winlangid, SORT_DEFAULT), LOCALE_FONTSIGNATURE, (LPTSTR)&langInfo.locale, sizeof(langInfo.locale) / sizeof(TCHAR)) == 0) {
 		/* Invalid langid or some other mysterious error, can't determine fallback font. */
@@ -341,6 +385,7 @@
 	int ret = EnumFontFamiliesEx(dc, &font, (FONTENUMPROC)&EnumFontCallback, (LPARAM)&langInfo, 0);
 	ReleaseDC(NULL, dc);
 	return ret == 0;
+#endif
 }
 
 #elif defined(WITH_FONTCONFIG)
@@ -410,7 +455,7 @@
 	return err;
 }
 
-bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid)
+bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, const char *string)
 {
 	if (!FcInit()) return false;
 
@@ -479,6 +524,13 @@
 bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid) { return false; }
 #endif /* WITH_FONTCONFIG */
 
+#ifdef __APPLE__
+/**
+ * Here comes the part which enables an Apple computer to choose a
+ * suitable font for languages which are not English
+ */
+#endif /* __APPLE__ */
+
 /**
  * Loads the freetype font.
  * First type to load the fontname as if it were a path. If that fails,
diff -r ecfbfa484e1b src/strings.cpp
--- a/src/strings.cpp	Tue Mar 31 17:46:18 2009 +0000
+++ b/src/strings.cpp	Thu Apr 23 19:56:55 2009 +0200
@@ -2,6 +2,10 @@
 
 /** @file strings.cpp Handling of translated strings. */
 
+#ifdef __APPLE__
+#include <ApplicationServices/ApplicationServices.h>
+#endif
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "currency.h"
@@ -30,11 +34,15 @@
 #include "video/video_driver.hpp"
 #include "engine_base.h"
 #include "strgen/strgen.h"
+#include "debug.h"
 #include "gfx_func.h"
 
 #include "table/strings.h"
 #include "table/control_codes.h"
 
+
+#define MAX_APPLE_STRINGTYPES 1024
+
 DynamicLanguages _dynlang;
 uint64 _decode_parameters[20];
 
@@ -1541,22 +1549,201 @@
 					} else if (c == SCC_SETXY) {
 						string += 2;
 					} else if (IsPrintable(c) && c != '?' && GetGlyph(FS_NORMAL, c) == question_mark) {
-#ifdef WITH_FREETYPE
+#ifdef WITH_FREETYPE						
 						if (!retry) {
 							/* We found an unprintable character... lets try whether we can
 							 * find a fallback font that can print the characters in the
 							 * current language. */
 							retry = true;
+							
+							FreeTypeSettings backup;
+							memcpy(&backup, &_freetype, sizeof(backup));		
 
-							FreeTypeSettings backup;
-							memcpy(&backup, &_freetype, sizeof(backup));
-
-							bool success = SetFallbackFont(&_freetype, _langpack->isocode, _langpack->winlangid);
+#ifdef __APPLE__
+							/* We could (maybe should) also hook here for apple font detection:
+							*ATSUMatchFontsToText
+							*	
+							*	Examines a text range for characters that cannot be drawn with the current font and suggests a substitute font, if necessary.
+							*	
+							*	OSStatus ATSUMatchFontsToText (
+							*								   ATSUTextLayout iTextLayout,
+							*								   UniCharArrayOffset iTextStart,
+							*								   UniCharCount iTextLength,
+							*								   ATSUFontID *oFontID,
+							*								   UniCharArrayOffset *oChangedOffset,
+							*								   UniCharCount *oChangedLength
+							*								   );
+							*	http://developer.apple.com/documentation/Carbon/Reference/ATSUI_Reference/Reference/reference.html
+							*/
+							OSStatus ap_err = noErr;
+							
+							// Initilizing the Variables for font matching, casting the types where necessary to ATSU types
+							ATSUTextLayout     text_layout;
+							ATSUFontID         *font_ID;
+							ATSUStyle          text_style;
+							UniCharArrayOffset *changed_offset; 
+							UniCharCount       *changed_length; 
+							TextToUnicodeInfo  apple_text2unicodeInfo;
+							
+							/* For the fun and maybe for test purposes:
+								ATSUDrawText (myTextLayout,
+											  kATSUFromTextBeginning,
+											  kATSUToTextEnd,
+											  myXLocation,
+											  myYLocation);
+							*/
+							
+							DEBUG(freetype,1, "Apple font detection: running CreateTextEncoding");
+							const TextEncoding apple_textencoding = CreateTextEncoding(kTextEncodingUnicodeDefault,kTextEncodingDefaultVariant,kUnicodeUTF8Format);
+							/*
+							 struct UnicodeMapping {
+								 TextEncoding unicodeEncoding;
+								 TextEncoding otherEncoding;
+								 UnicodeMapVersion mappingVersion;
+							 };
+							 typedef struct UnicodeMapping UnicodeMapping;
+							 typedef UnicodeMapping * UnicodeMappingPtr;
+							 
+							 We need somewhat to create a useful entitiy of UnicodeMapping struct. Probably not quite correct
+							 as here...
+							 */							 
+							UnicodeMapping apple_UnicodeMapping;
+							apple_UnicodeMapping.unicodeEncoding = apple_textencoding;
+							apple_UnicodeMapping.otherEncoding = kUnicodeCanonicalDecompVariant;
+							apple_UnicodeMapping.mappingVersion = kUnicodeUseLatestMapping;							
+							
+							/**	  OSStatus CreateTextToUnicodeInfo (
+																	ConstUnicodeMappingPtr iUnicodeMapping,
+																	TextToUnicodeInfo *oTextToUnicodeInfo
+																	);
+							 */
+							DEBUG(freetype,1, "Apple font detection: running CreateTextToUnicodeInfo");
+							ap_err = CreateTextToUnicodeInfo( &apple_UnicodeMapping, &apple_text2unicodeInfo);
+							if (ap_err != noErr) DEBUG(freetype,1,"Apple font detection: CreateTextToUnicodeInfo returned %i",ap_err);
+							
+							/*
+							 OSStatus ConvertFromTextToUnicode (
+																TextToUnicodeInfo iTextToUnicodeInfo,
+																ByteCount iSourceLen,
+																ConstLogicalAddress iSourceStr,
+																OptionBits iControlFlags,
+																ItemCount iOffsetCount,
+																const ByteOffset iOffsetArray[],
+																ItemCount *oOffsetCount,
+																ByteOffset oOffsetArray[],
+																ByteCount iOutputBufLen,
+																ByteCount *oSourceRead,
+																ByteCount *oUnicodeLen,
+																UniChar oUnicodeStr[]
+																);
+							 */	
+							DEBUG(freetype,7, "Apple font detection: running ConvertFromTextToUnicode");
+							ItemCount *unicode_itemcount = NULL;
+							ByteOffset unicode_offsetarray[MAX_APPLE_STRINGTYPES];
+							ByteCount unicode_outputbuflen = (ByteCount) 0;
+							ByteCount unicode_sourceread_ptr = (ByteCount) 0;
+							ByteCount unicodelen_ptr = (ByteCount) 0;
+							UniChar unichar_strg[MAX_APPLE_STRINGTYPES];
+							ap_err = ConvertFromTextToUnicode(
+															  apple_text2unicodeInfo,
+															  (ByteCount) sizeof(string),
+															  &string,
+															  kUnicodeUseFallbacksMask,
+															  (ItemCount) 0,
+															  (ByteOffset) 0,
+															  unicode_itemcount,
+															  unicode_offsetarray,
+															  unicode_outputbuflen,
+															  &unicode_sourceread_ptr,
+															  &unicodelen_ptr,
+															  unichar_strg);
+							/* see explanation of ap_err http://developer.apple.com/documentation/Carbon/Reference/Text_Encodin_sion_Manager/Reference/reference.html#//apple_ref/doc/uid/TP30000123-CH5g-RCM0098 */
+							if (ap_err != noErr) DEBUG(freetype,1,"Apple font detection: ConvertFromTextToUnicode returned %i",ap_err);
+								  
+							// TODO: The style needs to account for text sizes and so on.
+							DEBUG(freetype,7, "Apple font detection: running ATSUCreateStyle");
+							ap_err = ATSUCreateStyle(&text_style);
+							if (ap_err != noErr) { DEBUG(freetype,1, "Apple font detection: ATSUCreateStyle returned %i",ap_err); }
+							//ap_err = ATSUConvertTextToUnicode(
+							
+							DEBUG(freetype,7, "Apple font detection: running ATSUCreateTextLayoutWithTextPtr");
+							ap_err = ATSUCreateTextLayoutWithTextPtr(
+																	 unichar_strg,                   // The actual text to be found a new font for
+																	 kATSUFromTextBeginning,         // Starting char in the text
+																	 kATSUToTextEnd,                 // length of the paragraph
+																	 kATSUToTextEnd,                 // length of the overall text
+																	 (ItemCount) 0,                  // Number of text styles
+																	 (UniCharCount*) kATSUToTextEnd, // Apply Style to whole text
+																	 &text_style,                    // default style. Maybe needs changing <-- TODO
+																	 &text_layout);                  // return value: Text Layout
+							if (ap_err != noErr) DEBUG(freetype,1,"Apple font detection: ATSUCreateTextLayoutWithTextPtr returned %i",ap_err);
+							/** Now we need to loop until we are sure to have gone through the whole string
+								* or reached the end thereof; The function only scans until the first unknown
+								* Glyph and then terminates, proposing a font which (also) displays that - if
+								* such one can be found.
+								*/
+							int loop_counter = 0;
+							DEBUG(freetype,7, "Apple font detection: running loop of ATSUMatchFontsToText");
+							while (1) {
+								loop_counter++;
+								ap_err = ATSUMatchFontsToText(text_layout,             // Text Layout as obtained above
+															  kATSUFromTextBeginning,  // Starting char in the text
+															  kATSUToTextEnd,          // lenght of the text
+															  font_ID,                 // return value: suggested substitute Apple FontID
+															  changed_offset,          // offset which required a font change
+															  changed_length);         // lenght of section not drawable with current font
+								if (ap_err != noErr) DEBUG(freetype,1,"Apple font detection: ATSUMatchFontsToText returned %i",ap_err);
+								if (ap_err == noErr || loop_counter == 50) { break; }
+							}
+							if (ap_err == noErr) { DEBUG(freetype,7, "Apple font detection: ATSUMatchFontsToText succeeded!"); }
+							bool success = (ap_err == noErr);
+							/* Now we "just" need to convert the font_ID into something which OpenTTD understands
+							 * as a font, so that it can be handled by the existing routines
+							 */
+							if (success) {
+								ItemCount *max_font_indices = NULL;
+								DEBUG(freetype,7, "Apple font detection: running ATSUCountFontNames");
+								ap_err = ATSUCountFontNames(*font_ID, max_font_indices);
+								if (ap_err != noErr) { DEBUG(freetype,1, "Apple font detection: ATSUCountFontNames failed."); }
+								if ( (int) max_font_indices < 1) {
+									success = false;
+									continue;
+								}
+								uint max_name_length = 1024;
+								
+								// Initilize and allocate output variables of ATSUGetIndFontName;
+								char *name_ptr[max_name_length];
+								ByteCount *name_length = 0;
+								FontNameCode *font_name_code         = NULL;
+								FontPlatformCode *font_platform_code = NULL;
+								FontScriptCode *font_script_code     = NULL;
+								FontLanguageCode *font_language_code = NULL;
+								
+								ItemCount font_name_index = 0; // first matching font will be chosen
+								DEBUG(freetype,7, "Apple font detection: running ATSUGetIndFontName");
+								ap_err = ATSUGetIndFontName(
+															*font_ID,                 // font_ID to get info about
+															font_name_index,          // index of the font_ID to look for
+															max_name_length,          // maximum length for the font name
+															*name_ptr,                // output: ptr to string buffer which holds the name of the font
+															name_length,              // output: actual length of the name
+															font_name_code,           // output: ptr to FontNameCode (UInt32): namecode of the font
+															font_platform_code,       // output: ptr to FontPlatformCode (kFontUnicodPlatform, kFontMacintoshPlatform, kFontreservedPlatform, kFontMicrosoftPlatform, kFontCustomPlatform)
+															font_script_code,         // output: ptr to FontScriptCode (e.g. kFontRomanScript... - see SFNTTTypes.h header file for possible values)
+															font_language_code);      // output: FontLanguageCode (e.g. kFontNorwegianLanguage... - see SFNTTTypes.h header file for possible values)
+								if (ap_err != noErr) DEBUG(freetype,1,"Apple font detection: ATSUGetIndFontName returned %i",ap_err);
+								if (ap_err == noErr) {
+									
+								}
+								free(name_ptr);
+							}
+#else // not __APPLE__
+							bool success = SetFallbackFont(&_freetype, _langpack->isocode, _langpack->winlangid, string);
+#endif // __APPLE__...else
 							if (success) {
 								UninitFreeType();
 								InitFreeType();
 							}
-
 							memcpy(&_freetype, &backup, sizeof(backup));
 
 							if (success) continue;
@@ -1567,7 +1754,7 @@
 							UninitFreeType();
 							InitFreeType();
 						}
-#endif
+#endif // WITH_FREETYPE
 						/*
 						 * The character is printable, but not in the normal font.
 						 * This is the case we were testing for. In this case we
