Page 1 of 1

fontLanguage issue

Posted: Mon Jul 28, 2014 5:08 am
by WaltBrown
Hi!
I have a possible pilot error problem. I am trying to get the font languages for the installed fonts using this:

Code: Select all

on mouseUp
   put empty into tLanguages                             
   repeat for each line tLine in fld "fFonts"       // after filling it with the fontNames
      put the fontLanguage of tLine into tLang
      add 1 to tLanguages[tLang]
   end repeat
   put the keys of tLanguages into fld "fData"
end mouseUp
While the Windows 7 Font Manager shows me the wide array of languages used on the 201 installed fonts, LiveCode only gives me "ANSI" (193 instances) and "Hebrew" (8 instances). I have tried on both 5.5.5 Commercial and 6.6.2 Community. I looked through the existing bug reports and here, and saw no obvious answers. Anyone have any ideas on what I am doing wrong?

Thanks, Walt

Re: fontLanguage issue

Posted: Tue Jul 29, 2014 3:04 am
by WaltBrown
I had a Doh! moment and thought it would return a list, but alas no.

This returned the same results:

Code: Select all

on mouseUp
   local tLine, tLanguages, tData, tLang, tItem
   put empty into tLanguages                             
   repeat for each line tLine in fld "fFonts"       // after filling it with the fontNames
      put the fontLanguage of tLine into tLang
      repeat for each item tItem in tLang
         add 1 to tLanguages[tItem]
      end repeat
   end repeat
   put the keys of tLanguages into fld "fData"
   sort fld "fData"
end mouseUp

Re: fontLanguage issue

Posted: Tue Jul 29, 2014 4:35 am
by Simon
Hi Walt,
I'm getting the same sort of results but I think something else is going on.
If I pick Meiryo (Japanese font) when I type I still get English text, even the fonts that show foreign symbols next to them I get English.
This is Win 7 as well.
Interesting 193 + 8 = 201
I think fontLanguage is not what I thunk.

Simon

Re: fontLanguage issue

Posted: Thu Jul 31, 2014 3:08 am
by [-hh]
..........

Re: fontLanguage issue

Posted: Mon Aug 04, 2014 8:18 am
by Simon
Hey Walt,
We haven't heard back from you?
Did any of this help/not help. Did you find a workaround?

Simon

Re: fontLanguage issue

Posted: Mon Aug 04, 2014 11:43 am
by WaltBrown
Simon,
I gave up. On Windows the font files are not directly listed in the file explorer - the file explorer filters and presents font information in a "user friendly" way with a "virtual" display. I couldn't find a simple shell-based resource on Windows to get the information into LC.

To get the info I wanted I would have had to make a few trips through the Registry and .Net objects in a PowerShell script, which is not at the moment worth the effort. If I get the raw font file contents using LC I would need to write a TTF file parser, also not on my "Have Time To Do" list. Just getting to the raw files means a cryptic trip through the C:\Windows\winsxs subdirectories. There are probably further complexities I haven't gotten to yet.

Thanks
Walt