2

In my native country of Myanmar, we have been using a non-Unicode compliant font (called Zawgyi) for about 10 years on all private, commercial and government websites and electronic communications, but it has caused numerous problems when it comes to reading the text on multiple devices, as every device needs to have this Zawgyi font installed.

Now, the government has decided that enough is enough and that we all must now stop using Zawgyi and switch to using Unicode complaint Myanmar font and people have been switching to it when generating new text.

However, this means that all the previously written text until now remain in Zawgyi and all new text are in Unicode. So the problem now is when you want to go back and read all previous text (in websites and social media, like Facebook, Twitter, etc.) the text appears gibberish.

I've searched this website and someone posted a similar question about 9 years ago and was told that it was not possible. I'm just wondering if that's still the case or can it be done now?

So, what I'm after is some simple way, i.e. a small toggle button that can be placed on the toolbar/address bar of the web browser, and when you click on it, it changes the browser language to Zawgyi, allowing me to read old text written in that font, and then click on the button again to switch back to the default, i.e. Unicode.

In effeect, that the script is going to do is what I would do manually, i.e. go to Settings, choose Customise font and then select either Zawgyi (which would be already installed on the machine) or the default Times Roman.

Any help or tips would be greatly appreciated. If such a script exists and only works on one specific browser and not all then that's fine too.

Thanks

Nanda Won

6
  • 2
    javascript is responsible for manipulating the contents of a page, not the browser settings. This request is outside the scope of javascript, as far as changing the browser is concerned. Commented Sep 19, 2019 at 21:58
  • There should be an extension that does that automatically for you. A quick googling for "chrome extension zawgyi" brought some links, check them out. Commented Sep 19, 2019 at 22:02
  • If there is a downloadable font available for Zawgyi you may be able to use @font-face so the devices don't need the font installed. This assumes you have control of the web site serving the content. Commented Sep 19, 2019 at 22:14
  • 1
    I think it will help your confusion if you properly distinguish between a language (like in the "preferred language" setting of a browser), a text encoding (how characters are mapped to bytes), and a font (how to display a character). The browser language has nothing to do with your problem. To render texts correctly, you a) need to know the encoding and b) have a compatible font installed. You may want to have a look at unicode.org/faq/myanmar.html Commented Sep 19, 2019 at 22:18
  • Thanks for the link @bergi. Yes, the issue here is quite confusing, as it stated in the link you provided, both Zawgyi and Unicode Myanmar both used the same code point range (0x1000-0x109f) so there is no single font that can display both text simultaneously, i.e. when one text reads OK in one encoding, it looks gibberish in the other, and yet both are showing Myanmar characters. Since Zawgyi is using bastardised Unicode encoding, in order to read the text written in Zawgyi, one has to install Zawgyi font that has the 'correct' encoding of characters. Hope this make a bit more sense. Commented Sep 19, 2019 at 22:34

1 Answer 1

1

For the benefit of others who might be looking for a solution, I've managed to find the solution myself and just wanted to post here.

Basically, what the I did was create 2 Bookmarks on the browser (e.g. Chrome, Firefox, Opera or any Chromium-based browser) and added the following Javascript code to each.

Zawgyi:

javascript:(function(){document.getElementsByTagName('body')[0].style.setProperty('font-family', 'zawgyi-one', 'important');})();

Unicode:

javascript:(function(){document.getElementsByTagName('body')[0].style.setProperty('font-family', 'Helvetica, Arial, sans-serif', 'important');})();

Hope it helps someone.

Sign up to request clarification or add additional context in comments.

1 Comment

A tool like the oneclick-fontchanger might help and indeed seems to have been built explicitly for this situation (at least that's what the screenshot shows).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.