property pFontMap,pFontMap2

on new me
 
 set pFontMap = mGetFontTab(me,the text of member "fontmap")
 
 return me
end new


on mGetFontTab me,myText
 set myLines = the number of lines of myText
 set myList = [:]
 sort(myList)
 
 repeat with x = 1 to myLines
   set myLine = line x of myText
   repeat while offset("=",myLine) > 0
     set myOffset = offset("=",myLine)
     if myOffset > 0 then
       set myMacVal = char 1 to myOffset - 1 of myLine
       set myWinVal = char myOffset + 2 to myOffset + 5 of myLine
       set myLine   = char myOffset + 6 to length(myLine) of myLine
       addProp(myList,value(myMacVal),value(myWinVal))
     end if
   end repeat
 end repeat
 
 return myList
end mGetFontTab


on mChangeFontMap me,myInputText
 set myOutputText = myInputText
 
 if myInputText <> "" then
   if the machineType = 256 then
     set myOutputText = ""
     repeat with x = 1 to the number of chars in myInputText
       set myChar = char x of myInputText
       set myCharCode = charToNum(myChar)
       if myCharCode > 127 then
         set myOutputText = myOutputText & numToChar(getProp(pFontMap,myCharCode))
       else
         if myCharCode <> 9 then
           set myOutputText = myOutputText & myChar
         else
           set myOutputText = myOutputText & "     "
         end if
       end if
     end repeat
   end if
 end if
 
 return myOutputText
end mChangeFontMap
