Both OS X and macOS can use files in various formats, including Type 1 (PostScript), TrueType (.ttf), TrueType Collection (.ttc), OpenType (.otf),.dfont, and Multiple Master. You'll often see files described as Windows fonts, but if they have one of those file types, they should work just fine on your Mac. Most of the characters you need will be in one of your fonts, particularly if you install the very large 40 MB foreign-language updates for OS X. My solution consists of three macros. One enables you to enter any Unicode character you like into a Word document by typing its hexadecimal code into the text.
Page Content
About the Script
Sinhala (Sri Lanka) is a syllabic alphabet in that it consists of consonants with vowel signs.
Although Unicode includes Sinhala, support from major software vendors has not caught up yet. Therefore many Sinhala sites may offer custom fonts or be written in the Latin alphabet.
Browser and Font RecommendationsTest Sites
If you have your browser configured correctly, the Web sites above should display the correct characters. If you have difficulties, see list below for font and browser configuration instructions.
Fonts by Platform
Open Type Third Party FontsSinhala Unicode Free Download
Read pages for instructions on whether it is Windows compliant or Linux compliant.
See also
Recommended Browsers
Windows
Macintosh OS X - in systems before OS X 10.7 Lion, some Sinhala vowel signs will be improperly displayed, even with the correct font installed.
Manually Switch Encoding
If you see Roman character gibberish instead of a South Asian script, you will need to manually switch from Western encoding view to the Unicode encoding under the View menu of your browser.
Setup for KeyboardingBasic Setup
In order to integrate foreign scripts into your computer, you must set up 'keyboard' or input utilities in your operating system. These utilities will allow you to switch between typing English and other languages in word processors and Web tools. This process will also make sure the correct fonts are installed and available on your operating system.
See instructions for Setting up Keyboards for details.
Web DevelopmentSinhala Encoding and Language Tags
These are the codes which allow browsers and screen readers to process data as the appropriate language. All letters in codes are lower case.
Using Encoding and Language Codes
Computers process text by assuming a certain encoding or a system of matching electronic data with visual text characters. Whenever you develop a Web site you need to make sure the proper encoding is specified in the header tags; otherwise the browser may default to U.S. settings and not display the text properly.
To declare an encoding, insert or inspect the following meta-tag at the top of your HTML file, then replace '???' with one of the encoding codes listed above. If you are not sure, use utf-8 as the encoding.
Generic Encoding Template
<head>
<meta http-equiv='Content-Type'> .. <head> Declare Unicode
<head>
<meta http-equiv='Content-Type'> .. <head> XHTML
The final close slash must be included after the final quote mark in the encoding header tag if you are using XHTML
Declare Unicode in XHTML
<head>
<meta http-equiv='Content-Type'U T F dash 8'>utf-8' /> .. <head> No Encoding Declared
If no encoding is declared, then the browser uses the default setting, which in the U.S. is typically Latin-1. Some display errors may occur.
Language Tags
Language tags are also suggested so that search engines and screen readers parse the language of a page. These are metadata tags which indicate the language of a page, not devices to trigger translation. Visit the Language Tag page to view information on where to insert it.
Unicode Chart with HTML Entity Codes
Unless a keyboard which supports Unicode is installed, you must use the Unicode chart for Sinhala and enter HTML entity codes.
PDF and Image Files
In some cases, your best options may be to use PDF files or image files. See the Web Development Tips section for more details.
LinksScript BasicsComputer Setup
Unicode Fonts
Read pages for instructions on whether it is Windows compliant or Linux compliant.
Note on OS X: These fonts can be installed on a Mac, but vowel marks may not display correctly.
Last Modified: Tuesday, 30-Jun-2015 15:54:30 EDT
This article provides help for people who need to use Unicode in Word X on the Macintosh. This article requires some technical skills. This is as good a time as any to get started learning some fancy, advanced techniques with Word X.
This proposed solution is far from ideal, so let's set some expectations up front:
This solution enables 'some' users to use 'some' characters to get by for now. If it doesn't suit you, it's time to upgrade to Word 2004.
The Ground Rules
This solution relies on several facts:
My solution consists of three macros. One enables you to enter any Unicode character you like into a Word document by typing its hexadecimal code into the text. Another enables you to select any character and return its Unicode value. The last one enables you to list all of the characters defined in each of your fonts so that you can see what those codes are.
Click here for a template containing the compiled macros.
Look here for instructions on installing a template.
Look here for instructions on installing macros.
If you use this solution, you will be left with a document containing characters you cannot see. Current Carbon applications will not display any character that is not in the Macintosh Character Set. Word displays the characters as an underscore.
Viewing Documents containing Unicode
To view the document, you will have to save it as a Web Page and open it in Internet Explorer. Since this shatters your document's layout, it is useful only for confirming that you have the correct character in the correct place.
Printing Documents containing Unicode
To print the document, you will have to Save As RTF then print it from TextEdit. As far as I know, you cannot get Unicode characters into PDF yet, because the PDF writer is a Carbon application. Of course, if you email the document to work, you can print it from your PC..
Entering Unicode Characters
The first problem is how to enter characters. The Unicode Hexadecimal keyboard required to type special characters is not available in Word (it will enable only in genuine Unicode applications).
Making Word Show You the Whole Font
This is nasty but it works:
Macro to Insert Unicode Characters
Here is a macro that will insert any Unicode character you like in a Word v.X document: To use it, you type the four-character number in the document and run the Macro.
Click here for a template containing the compiled macros.
Look here for instructions for installing a template.
Look here for instructions on installing macros.
Macro Code
Sub InsertUnicode()
' InsertUnicode Macro
' Macro written 26 Jul 2002 by John McGhie
' Converts typed text into Unicode
Dim CharNum As Long
Selection.Collapse
Selection.MoveStart Unit:=wdWord, Count:=-1
If Selection.Text <> ' Then
CharNum = Val('&H' & Selection.Text)
If CharNum < 0 Or CharNum > 65535 Then
MsgBox 'Sorry, there is no such character in Unicode. ' _
& 'The character code must be four digits in hexadecimal.'
Else
Selection.TypeText Text:=ChrW(CharNum)
End If
End If
End Sub
When we send Macros over the Internet, various things can happen to the lines and cause errors. To see if you got any, go to Debug and choose Compile Normal.
If a warning dialog pops up telling you about a 'Compile Error' this usually means that one of the lines has wrapped on its way to you. The line after the error will turn red. Usually all you have to do is use the Delete key to join that line onto the end of the one above.
When you have no errors, click Save, then click the blue W button to come back to the Word user interface. Assign this macro to a keystroke: Word 2002 for Windows has this command built-in; the default keystroke for it is Alt + x. Since the Mac won't let you use Option (it's reserved for the operating system) and Alt is a bit of a stretch, try Ctrl + x; that's available.
Java for os x 2017-00. Look here for How to Assign a Macro to a Keystroke
Hold down your Shift key and choose File>Save All. Save All does not appear unless you do hold down the shift key. You wouldn't want to lose all this work in a crash. Now would you?
How to Insert a Unicode Character
To use the macro, simply type the hexadecimal character code into the document where you want the character to appear, then hit the keystroke you assigned.
The macro will convert the character code to a Unicode character.
The reason this macro is provided in hexadecimal is because most of the font utilities around provide the character codes for characters in hex. If yours works in Decimal, go back to the Macro editor, open the code window and change the line that reads
CharNum = Val('&H' & Selection.text)
to read just
CharNum = Val(Selection.text)
That removes the conversion from Hexadecimal. To be elegant, you may want to remove the words 'in hexadecimal' from the end of the MsgBox line.
How to find the Unicode Value of a Character
Run the following Macro.
Click here for a template containing the compiled macros.
Look here for instructions for installing a template.
Look here for instructions on installing macros.
Macro Code
Sub ShowCharacterCode()
'
' Charcode Macro
' Macro recorded 8/06/00 by John McGhie
'
MsgBox AscW(Selection.Text)
End Sub
How to Find Unicode Characters in your Fonts
The following macro enables you to list all of the characters in a font. The reason you have to do this is because most Macintosh fonts contain characters that Word cannot display.
Apple and Microsoft fonts supplied with OS X and Office v.X are actually Unicode fonts. However, in common with most other Carbon applications, Word can display only the characters in the Macintosh Character Set. Most fonts contain many more characters you cannot see, but you can use them if you can get their character numbers.
Windows fonts typically contain five times more characters than Macintosh fonts.
Macintosh OS X can use Windows fonts of kind OTF (OpenType Font) and TTF (TrueType Font). PostScript (Type 1) fonts made for Windows will not work on the Mac. Simply drag compatible fonts to your Fonts folder. It doesn't matter which of your fonts folders you use; you may wish to use the Fonts folder you will find in your Microsoft Office X/Office Folder to avoid the possibility of interfering with other applications.
The following macro produces a listing of the font you choose. It places all 65,536 character codes possible in Unicode into a document, 16 to a line. When you display or print the result, the character will appear at each position for which the selected font has a character defined. You will get a question mark or a hollow box where there is no character in the font.
Notes:
List Unicode Font Macro Code
Click here for a template containing the compiled macros.
Look here for instructions for installing a template.
Look here for instructions on Installing a Macro.
Macro Code
Sub ListUnicodeFont()
' Macro written 28 July 2002 by John McGhie
' Prints entire character set of a unicode font
Dim theFont As String
Dim fontDoc As Document
Dim tabNumber As Integer
Dim charNumber As Long
charNumber = MsgBox('Choose just the font name from the following Dialog' _
& ' box, then wait..', vbOKCancel + vbInformation)
If charNumber <> 1 Then End
With Dialogs(wdDialogFormatFont)
.Display
theFont = .Font
End With
Set fontDoc = Application.Documents.Add
fontDoc.Activate
fontDoc.ActiveWindow.View.Type = wdNormalView
StatusBar = 'Please wait..'
Selection.TypeText 'Character listing for ' & theFont
Selection.Paragraphs(1).Format.Style = wdStyleHeading1
Selection.TypeParagraph
Selection.TypeParagraph
With Selection.Paragraphs(1).TabStops
For tabNumber = 3 To 17
.Add Position:=(tabNumber * 22), Alignment:=wdAlignTabRight
Next tabNumber
End With
Selection.Font.Name = 'Arial'
Selection.TypeText 'Number'
For tabNumber = 0 To 15
Selection.TypeText Text:=vbTab & Hex(tabNumber)
Next tabNumber
x = 32
While x < 65532
Selection.TypeParagraph
Selection.Font.Name = 'Arial'
Selection.TypeText Text:=Hex(x)
StatusBar = 'Character number ' & Hex(x)
For tabNumber = 1 To 16
Selection.Font.Name = theFont
Selection.TypeText Text:=vbTab & ChrW(x)
x = x + 1
Next tabNumber
Wend
' The PC substitutes the closest available font if
' the character is not available in the nominated font.
' The following routine marks characters Blue if they
' are from the requested font, and dark red if they
' have been substituted. This routine is not necessary
' on the Mac, which doesn't have the function
#If Win32 Then
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = '
.Font.Name = theFont
.Replacement.Text = '
.Replacement.Font.Color = wdColorBlue
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Font.Color = wdColorAutomatic
.Replacement.Font.Color = wdColorDarkRed
End With
Selection.Find.Execute Replace:=wdReplaceAll
#End If
fontDoc.SaveAs FileName:=theFont & '.doc'
fontDoc.WebOptions.Encoding = msoEncodingUTF8
Sinhala Tamil Unicode Free Download
' The Mac has different HTML Options in the Save As
#If Mac Then
fontDoc.SaveAs FileName:=theFont & '.htm', _
FileFormat:=wdFormatHTML, _
HTMLDisplayOnlyOutput:=True
#Else
fontDoc.SaveAs Encoding:=msoEncodingUTF8, FileFormat:= _
wdFormatFilteredHTM
#End If
ActiveWindow.View.Type = wdWebView
End Sub
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2020
Categories |