htmlcssfontscharacter-encodinglang

How to use Thai web font on a website?


I am working on a website which will have an option for Thai language. How do I add Thai langauge to a website? I tested this by translating some random words via Google Translate from English into Thai language and then just copy pasted Thai text into my html document. It worked and showed Thai text correctly but is this a right way to do it???

Should I change lang="en" into lang="th" or should I leave it like it is:

<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8">
    <head>

    <body>
    </body>

</html>

And what about charset? Is there another charset for Thai language???

Also, I see Google Fonts offer 2 versions of Thai fonts but they are not very readable according to me. Are there other Thai fonts that I can use and add them to my website???

Sorry for basic question but I never encountered such a problem so far... Thanks all!


Solution

  • Should I change lang="en" into lang="th" or should I leave it like it is

    The lang attribute describes the language the document is written in. If you are writing in Thai, you should not claim you are writing in English.

    How do I add Thai langauge to a website?

    Just type it.

    And what about charset? Is there another charset for Thai language?

    There are plenty of character encodings out there. Different ones support different sets of characters. UTF-8 supports all the characters you need for just about every language out there and is a good default choice.

    You might get better performance out of TIS-620 but note that you'll need to actually save the file as TIS-620. Just telling the browser you are using it will not work.

    How to use Thai web font on a website?

    The same way you use any other web font.