Is there an X-platform (well Mac and Windows) of determining the system language?
I am workin with Truetype/Opentype font files. Getting the information I want from the font files about the fonts is relatively easy. (Though I am guess at the meanings of some things).
The files contain strings of the font family and style names in the various languages the font support (I think!). I think I can retrieve all the or , the strings for any specific language, but of course the ones I would usually want would the ones for the system language.
Is there anyway I can determine the system on language on Mac and Win? I know the language codes returned (if I can get them!) won’t be the same Xplatform, but I can deal with that.
It would seem to me the Xojo framework should have a way to to this but if so I am missing it… If not I could deal with declares.
Thanks… It gives me a way forward is there is not a better one.
I had not thought to use locale because I avoided the Xojo framework well as API 2 so far (Don’t me started ranting about API 2 again!)
TruetypeFiles use platform specific numeric language codes that (I think) correlate with what you would get from declares not iso-639 strings… I suspect the truetype standard predates the iso standard.
I guess I can try and and construct dictionaries to go from iso-639 strings to the platform specific codes so I know which strings to look for.
I originally thought about using localized constants but that seemed rather cumbersome and was hoping to be able to get the OS specific codes not to have to worry about the details so much…
Thanks, but I won’t need the declares… After seeing tehresult of teh declare, my best guess is that the Mac language codes that Truetype files use are from pre-OSX classic Mac OS as that is when the spec was originally created.
Looks l will need to create a dictionary or another mechanism to look up the codes truetype uses myself.
I suspect the windows numeric code could be gotten from some sort of declare as nothing ever goes away there!
Looks like I needed to read the truetype spec more… I did not fully grasp the language handling… The string Locale returns may be there…
I only looked at Format 0 and did not even look at Format 1 for the name table. I figured Format 0 would be always be there no matter how old the font, so it would be best just to use that…
However Format 1 which came later has the language strings… And if the table is Format 1 then the numeric language codes for individual strings CAN BE (but don’t have to be) indexes to the language strings and not the Format 0 codes
So I need to be able to handle both the old codes as well as the newer language string like those locale returns even if it is Format 1 if i want to handle all cases.