How to display content for websites in Myanmar/Burmese font
Asked Answered
B

3

7

I have a website which serves the Burmese people in burmese language. Problem is in Myanmar country Unicode format is not used instead they use Zawgyi format of encoding. The content on my website appears broken. How do I fix this issue.

enter image description here

This error is occuring in Iphones only

Bk answered 7/7, 2018 at 12:38 Comment(9)
Serve the Zawgyi font via WOFF.Detraction
Yes, be sure if it is an encoding or font question...... if you really need a specific font, such as that Zawgyi font, you need to see about delivering the font to users of the website, as @Detraction said. This is different from encoding, which is the "language" of how the text is stored and transported.Cupronickel
You might store text of many different languages in the computer encoding of Unicode. But then to display each language correctly, the user might use a different font.Cupronickel
If you're really interested in understanding encodings, there's lots of good reading such as: kunststube.net/encodingCupronickel
A bit more detail is needed: are you putting text in Zawgyi format in a page that uses <meta charset="utf-8">? Because if so the trick is to first convert your myanmar text to proper unicode through a text conversion step, so that you can serve your documents in a uniform charset. What does a small example page look like in your setup, and which part of that page are use which charsets?Indemnify
@Mike'Pomax'Kamermans It appears the text is Unicode (or at least not Zawgyi) Since U+1031 is rendering after U+1091 which is the character ordering for Unicode, but Zawgyi would render it backwards as displayed.Muttonhead
@Muttonhead text encoding is not a thing to guess about, there are way too many things that can be the case, so unless there's an answer by SONGSTER that actually explains the situation better (right now, the question still hasn't been edited to actually provide real details), guessing is a bad idea. The document can only be in a single charset, so if the sources are from different charsets, we need to know which, and we need to know how they're combined.Indemnify
All I am saying is that the text is characteristic of a Unicode text body (meaning it was originally typed in Unicode) being erroneously rendered as Zawgyi-One or a similar non-Unicode font. That can be determined by looking at ေ and ျ which are displayed as after the consonant, which is the correct Unicode typing order, but the incorrect display order, as summarized here: thanlwinsoft.github.io/www.thanlwinsoft.org/ThanLwinSoft/…Muttonhead
I wonder if it's possible to prevent a font from being used with CSS – for example, "font-family: NOT Zawgyi-One;" – to cause the page to fall back to a different default?Glasswort
P
1

You can use font link and embed with font-family.All fonts correctly appear in any device or browser no need to put or install specific fonts in it's device.If you want to check another Myanmar fonts link.You can go there https://mmwebfonts.comquas.com/#how-to-use

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href='https://mmwebfonts.comquas.com/fonts/?font=myanmar3' />
	<link rel="stylesheet" href='https://mmwebfonts.comquas.com/fonts/?font=zawgyi' />	
	<style type="text/css">
		.zawgyi{
			font-family:Zawgyi-One;
		}
		.unicode{
			font-family:Myanmar3,Yunghkio,'Masterpiece Uni Sans';
		}
	</style>
</head>
<body>
	<h3>This is for ZawGyI font</h3>
	<p class="zawgyi">
		သည္စာသည္ ေဇာ္ဂ်ီ ျဖင့္ေရးေသာစာျဖစ္သည္
	</p>
	<h3>This is for unicode (myanmar3) font</h3>
	<p class="unicode">
		သည်စာသည် unicode ဖြင့်ရေးသောစာဖြစ်သည်
	</p>
</body>
</html>
Pampas answered 11/7, 2018 at 4:8 Comment(0)
P
1

knayi is a good library to convert or detect (Unicode & Zawgyi) fonts.

You can load the script via CDN or NPM and use kanayi.fontConvert();


// Expected paramaters
kanayi.fontConvert(content, targetFontType , orignalFontType)


Example

knayi.fontConvert('မဂၤလာပါ', 'unicode', 'zawgyi') // မင်္ဂလာပါ
knayi.fontConvert('မဂၤလာပါ', 'unicode') // မင်္ဂလာပါ

Btw, I made a wordpress widget with kanayi.
https://github.com/ronaldaug/auto-font

Percentile answered 4/3, 2019 at 4:51 Comment(0)
C
-2

Please add 2 or three extra fonts for font fall back

.zawgyi{
    font-family:Zawgyi-One,second font,third font;
}

Like this if font is not supported the second one will work if not then third on different platform.

Chiaroscuro answered 15/7, 2018 at 10:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.