2

Using ms macro, is there some way to support more Vietnamese accented characters in Groff? I looked through the page but there doesn't seem to have enough accented characters.

https://www.gnu.org/software/groff/manual/html_node/ms-Strings-and-Special-Characters.html#ms-Strings-and-Special-Characters

Sample Vietnamese words: chữ nghĩa, chỉ bảo, học tập, cơ sở làm việc, kinh tế phát triển, cá rô bơi lội, thế sự.

Thank you a lot.

1
  • Did you try the .AM macro from the page you linked? Are some of the diacritics/accents you need missing from what .AM supports? Commented May 17, 2021 at 17:45

2 Answers 2

2

Here are some clues. In principle, you can directly type any character in the groff ms input file, and then tell groff what encoding you used; the character will then be converted into a unicode sequence \[u....].

Typically, most editors allow for a utf-8 encoding, so if you entered characters using it you can just run groff -Kutf-8 (or -Kutf8) to have them converted. Eg typing the euro symbol € on a keyboard might become \[u20AC]. See man groff_char.

The bigger problem is getting the unicode character converted into, presumably, PDF or PostScript. This needs an appropriate font to be installed, and groff to be told to use it. This is where my experience ends. I've seen people suggest you can target the LaTex dvi output (-Tdvi) and use its tools to convert:

groff -Kutf8 -Tdvi -mec -ms test.ms >test.dvi
dvipdfm -cz 9 test.dvi    # produces test.pdf

The -mec option replaces the standard fonts by the EC fonts. See man grodvi.

I did write an answer on how I managed to use an alternative method to convert a font that included a particular unicode character, but the original poster did not have any success with it.

Note there is a second man page at man 7 groff with some details.

0
2

I had the same problem with rendering .pdf from .ms and .md for a couple of days - very frustrating.

Default fonts in groff doesn't seem to render unicode characters.

I found a work around by install-font with a font that actually has unicode characters.

Gavin Freeborn has a tutorial video on this.

Now, groff seems to work fine on my machine.

Goodluck :D

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.