saving documents written in Thai

Recently, I've been trying to learn Thai and have set up an alternate Thai keyboard layout. All works pretty well until I try to save a document written in Thai. It seems to save OK, but when I open it later, all the Thai text is represented by small rectangles... i.e. garbage.

What is the secret to saving documents in Thai? I think it has something to do with unicode, but I have no idea how to deal with it.

Any help would be appreciated.

I forgot to mention I am using LO 4.1.3.2 on Win 7.

Do you have Thai fonts in your font directory? I don't know where you get them, but that's what you need.

--doug

Are you opening it on the same system that you are typing it up on?

Dale Erwin wrote:

but when I open it later, all the Thai text is represented by small rectangles... i.e.garbage.

That would be a font issue. More specifically, either the fonts in the template used for the document do not contain Thai characters.

Either create a Thai-specific template, and use that everytime you write in Thai, or use a Pan-Unicode font as the default font in your default template.

jonathon

Seems to me that without Thai fonts I could not type text into the document at all. I can type text into the document using Lucinda console font which comes with Win7. The only problem is that after saving the document I can't retrieve it with the text intact.

I found a page through google on setting up a Thai keyboard and it said that win7 comes with several Thai fonts. Another one mentioned is Malaga and the characters appear just fine in the document. I can even print them, I just can't recover them after saving.

I have the same problem in Notepad, but in Notepad I get a warning that says: This file contains characters in Unicode format which will be lost if you save this file as an ANSI encoded text file. To keep the Unicode information, click Cancel below and then select one of the Unicode options from the Encoding drop down list, Continue? Problem is I can't find any Encoding drop down list.

In LO, however, there is no such warning. It appears to have been successfully saved until I open it later and find garbage.

OK, I just found the Encoding drop down list in the save dialog, so I can now save documents in Notepad using the same Lucinda console font.

No, it is not a font problem. There are several Thai-capable fonts that come with Win 7. One of them is Lucinda console. The problem is that the Thai characters are Unicode while the latin characters are ANSI. I have the same problem saving documents written in Thai on Notepad if I save them with ANSI encoding. However, if I choose one of the Unicode options from the encoding drop box, the document is saved perfectly well, using the same font that I use for Thai in LO, Lucinda console. Unfortunately, LO gives no such option. This is definitely a defect in LO.

"Dale Erwin":

There are several Thai-capable fonts that come with Win 7. One of them is Lucinda console.

Lucida Console does not contain Thai characters. Do not use a toolbar dropdown to set font; open Format/Character menu (or use styles) and set Latin and Thai fonts separately in 2 corresponding boxes there.

Dale:

To type and save documents in both Thai and English, which I do quite
successfully with LibreOffice and several other products, you need to
understand a few things that aren't at all obvious from the documentation.
At the end, I'll suggest an easy way to handle multi-lingual documents.

Since your difficulty is with LibreOffice Writer, let's start there. and
look at a couple things:

Open a new blank document. First, go to Format | Character and take a look
at the Font tab. In the top section, titled "Western text font" you will see
the font that is currently active.

The next two sections ("Asian text font" and "CTL font") are key to
understand what's going on.

If your base font (the one listed in the top section) is NOT a Unicode font,
or if it is a Unicode font that doesn't contain Thai characters, you will
see the font that LibreOffice - in a not always successful attempt to be
helpful - uses as substitutes when you type in a particular character.

What happens, therefore, is that Libre Writer gives you the impression that
all is wonderful even though it is doing substitutions behind your back. In
itself a good thing, but sometimes leads to confusion.

It also isn't very clear that "Asian text font" is NOT what you use for your
Thai substitutions. Aside from the fact that Thai is actually an
Indo-European language, the "Asian text font" section seems to be only
applicable to languages that use ideographs (i.e. little pictures) even if
they have alphabetic characters. It also relates to languages that are
written vertically, although I'm not too sure about that as I don't speak
Chinese, Korean, Japanese and similar languages.

Now look at the "CTL font" section. What you want to do is to pick a font
that you know supports Thai, and choose it in the "CTL font" section as a
substitute. The font is listed first, then the size stuff, and then under
Language, you would choose Thai to indicate which group of characters within
the font are to be used.

A CTL font is what's used for substitutions when you are using an "Input
Method" to type on the keyboard. Since there are several of these in use
it's hard to tell you anything specific, but you've probably already solved
that, since I presume you do some typing in English, hit some switch
command, type a little Thai, then use the switch command to get back to
English.

By the way, the default you will often see under CTL font is one of the
Hindi fonts (I presume because of Thai's ancient relation to Indian
languages) - in Ubuntu, for instance, it is almost always "Lohit Hindi" - a
font that is part of the Ubuntu installation.

I used Format | Character as an example to make the explanation more clear;
obviously there are similar settings in various Paragraph and Style settings
as well, and they all work the same.

BUT - if you want to make things really simple, you could simply use a font
that has both English and Thai characters present, so no substitutions need
to take place. Unfortunately there isn't a great variety of really good
looking fonts (I'll list some below), but the advantage is that there are no
substitutions, and the font sizes are matched more closely than would be the
case with two different fonts. This is a matter of taste of course,
particularly with balancing Thai and English, since Thai nees room above and
below the characters for the various superscript and subscript vowels, tone
marks, and such things. (these same issues are not unique to Thai of course
- you'll run into them in both Hebrew and Arabic for instance).

So, here are my (so far) favorite combination fonts for easily mixing Thai
and English in the same document:

Free Serif (Serif)
Gentium Basic (Serif)
Gentium Book (Serif)
Norasi (Serif)
Kinnari (Serif)
Linux Libertine (developed for Linux, but works in Win)
Linux Biolinium (ditto)
Sawasdee (go figure...) (light Sans Serif)
Droid Sans Thai (Sans Serif)
Garuda (Sans Serif)
Loma (Sans Serif)
Umpush (Sans Serif)
Waree (Sans Serif)
Purisa (informal handwriting style)
Tlwg Typist (mono typewriter)

Obviously if there are others who use both Thai and English, I'd be
interested in any of your favorite fonts.

As for moving your document to other machines, Libre Office now has the
ability in some versions to embed the fonts in the document file itself, but
I'm not sure if all versions and all platforms can utilize the embedded
fonts yet. (can anyone help here???)

I hope this helps you in your search.

-- Frank

Many thanks for your reply. At last someone who knows what he's talking about. I don't have all those fonts available, but I do have some and I can now save documents and reopen them intact. I certainly do appreciate this information.

Dale:

Search for the fonts on the internet. Just enter the name in google and you
should be able to locate them. They're all under GPL - in other words
they're free....

Glad I could help.

Frank

Thanks for the list of fonts.

As for embedding of fonts, it all depends on if you want to have others edit the document or just view them. I tend to not send out editable documents, unless I am required to. Otherwise I send PDF files. Ubuntu's CUPS-PDF printing works great when LO 4.0.6 does not embed the fonts. 4.1.x, so I have been told, embeds many of the user fonts properly. I have not determined how well it actually does it, but I still print to CUPS-PDF if I want to embed non-standard fonts in the final readable document.

We really need a set of font lists like you show above, for the major non-Latin languages. This would be very helpful to our users. Those font lists, plus your description on what to do may really help our users. It should go into some wiki page[s] for easy of use as a helper to those like the original poster with these pesky font problems.

Part of this Font FAQ was discussed in another thread.

It would be a very good idea to have the "language settings" information, and the associated fonts, listed in a wiki page [for now] so our users who use both Latin and non-Latin based languages would have an easier time setting up their package for those languages.

There was a discussion of adding more fonts to the install of LO. It was suggested that there could be a section/page[s] somewhere showing a list of good free fonts that has the needed languages and how to use them [i.e. set up to use them] with LO to write documents in those languages.

There are many fonts out there that work well for Thai and other non-Latin based writings, but sometimes it may be difficult for our users to find the "proper" fonts and set up LO to use them for their documents. Having a list of free fonts and the languages they support [graph or table] could be very helpful to some of our users.

Also, having an explanation on how to set up the language options in LO would be a very good idea at the top of such a list of fonts. This thread seems to indicate that more work in needed to make the setup of different non-Latin based languages within an LO install is needed. How do I get my document to work with the language and be about to edit and print the document correctly using that language.

Having the list of fonts that include the Thai language scripts/glyphs hopefully was helpful to the user. If we could expand the list into some type of table where the rows are the free fonts [maybe paid one that came with the OS] and the columns are the languages supported within the fonts, it may help guide our user to which fonts work well for which languages.

If you are a English and French speaking person that is learning a non-Latin based language, having a list of fonts that support that language is a needed item.

To be honest, I do not use any other language but my native English. But if we get LO in schools/colleges, the students will need to use LO to write in other Latin and non-Latin based languages, while using English for the menus. Having both simple and detailed information on how to set up LO to support all of these languages would be very helpful. Having a documentation, like the solution in this thread, showing the user how to set up a non-Latin based language to be used by the user can be very important to the user. It seems that the current documentation may not be where it is needed, if this thread is any indication. But we can always make it better within the wiki page environment.

Hi :slight_smile:
Would that 1st post by CVAlkan be good for the wiki? Where? In the Faq?
https://wiki.documentfoundation.org/Faq

Should we forwards that post to the Documentation Team?
Regards from
Tom :slight_smile: