1

When writing Myanmar Text as a main font, English output is bad. I'd like to get English output as default font.

Ingmar
  • 6,690
  • 5
  • 26
  • 47

1 Answers1

4

Babel allows you to set up separate English and Myanmar fonts. Here is a sample that compiles in LuaLaTeX (from 2020 or later), and might also work in XeLaTeX with minor changes. The text should be copied from the UN Declaration of Human Rights, and I apologize for any errors.

\documentclass{article}
\tracinglostchars=2
% Both English and Myanmar are LTR languages, and do not really need bidi.
\usepackage[bidi=basic, layout=sectioning, english]{babel}
\usepackage{unicode-math}
\usepackage{microtype}

\babelprovide[import=my, main]{myanmar}

\defaultfontfeatures{ Scale=MatchUppercase, Ligatures=TeX, Renderer=HarfBuzz }

% Padauk available from: https://software.sil.org/padauk/ \babelfont{rm} [Scale=1.0, Ligatures=Common]{NewComputerModernBook} \babelfont[myanmar]{rm} {Padauk} \setmathfont{NewCMMath-Book.otf}

\newenvironment{english}% {\begin{otherlanguage}{english}\fussy}% {\end{otherlanguage}}

\newcommand\textenglish[1]{\begin{english}#1\end{english}}

\setlength\emergencystretch{\hsize}\hbadness=10000 % To mitigate the poor hyphenation.

\begin{document} \section*{အပြည်ပြည်ဆိုင်ရာ လူ့အခွင့်အရေး ကြေညာစာတမ်း}

\begin{english} Whereas recognition of the inherent dignity and of the equal and inalienable rights of all members of the human family is the foundation of freedom, justice and peace in the world, \end{english}

၁၉၄၈ ခုနှစ်၊ ဒီဇင်ဘာလ ၁၀ ရက်နေ့တွင် ကမ္ဘာ့ကုလသမဂ္ဂအဖွဲ့ ညီလာခံအစည်းအဝေးကြီးက လူ့အခွင့်အရေးကြေညာစာတမ်းကြီးကို အတည်ပြု၍ ကြေညာလိုက်ရာ ထိုကြေညာစာတမ်းကြီး၏ စာသားသည်နောက်စာမျက်နှာ များတွင် အပြည့်အစုံပါရှိသည်။ ဤကဲ့သို့ ရာဇဝင်တင်မည့် ကြေညာချက်ကို ပြုလုပ်ပြီးနောက် ဤညီလာခံအစည်းအဝေးကြီးက ကမ္ဘာ့ကုလသမဂ္ဂအဖွဲ့ဝင် နိုင်ငံ အားလုံးအား ထိုကြေညာစာတမ်းကြီး၏ စာသားကိုအများပြည်သူတို့ ကြားသိစေရန် ကြေညာပါမည့် အကြောင်းကိုလည်းကောင်း၊ ထို့ပြင်နိုင်ငံများ၊ သို့တည်းမဟုတ် နယ်မြေများ၏ နိုင်ငံရေး အဆင့်အတန်းကို လိုက်၍ ခွဲခြားခြင်း မပြုဘဲအဓိကအားဖြင့် စာသင်ကျောင်းများနှင့် အခြားပညာရေး အဖွဲ့အစည်းများတွင် ထိုကြေညာစာတမ်းကြီးကို ဖြန့်ချိ ဝေငှ စေရန်၊ မြင်သာအောင် ပြသထားစေရန်၊ ဖတ်ကြားစေရန်နှင့် အဓိပ္ပာယ်ရှင်းလင်း ဖော်ပြစေရန် ဆောင်ရွက်ပါမည့် အကြောင်းဖြင့် လည်းကောင်း ဆင့်ဆို လိုက်သည်။

\end{document}

Padauk / New Computer Modern Book sample

If English should be the main language, you could replace the \babelprovide command with \babelprovide[import=my, onchar=ids fonts]{myanmar}, and Babel will automatically detect what script you are typing in, and set the font and hyphenation accordingly. Babel also allows you to call the language Myanmar or Burmese, whichever you prefer.

Either way, Babel’s hyphenation patterns for your language evidently leave much to be desired. You can mitigate this by increasing the \emergencystretch allowed between words (which is better than \sloppy) and enabling microtype font expansion, which gives you excessive word spacing instead of ragged right margins. If you do, turn the default settings back on for English with \fussy. I redefine \begin{english} and \textenglish to do this automatically. You could instead choose \raggedright. Although I don’t speak it and cannot give advice, my very limited understanding is that you might be able to insert more spaces to make the layout more attractive, or discretionary hyphenation points (\-) or zero-width spaces (^^^^200b or \hspace{0pt}) to indicate where to break a long word if there is no better option.

A note on fonts: From what I can tell, the most-used Myanmar font is Zawgyi One, but this does not properly support Unicode. Here, I use SIL’s Padauk. Another good choice might be Noto Serif Myanmar and Noto Sans Myanmar, because these come in a wide variety of families (Light condensed, Semibold ExtraWide, etc.) that make it more likely that you can select a combination to match your English font. Microsoft’s Myanmar Text font also works.

You added the polyglossia tag, but as of 2020, Polyglossia does not support your language. In the future, it might. The document body should remain compatible if you switch.

Davislor
  • 44,045