[Fontconfig] How to make Arial support Vietnamese?

Pat Suwalski pat at suwalski.net
Thu Sep 24 07:18:11 PDT 2009


Nguyen Thai Ngoc Duy wrote:
> I would like to make arial the prefered Sans font in my system. It
> works great if I use locale C. If I use locale vi_VN.UTF-8 then it
> fails to recognize Vietnamese is supported by Arial and pass on. Is
> there anyway to make it work? I'm using fontconfig 2.7.2.

This is one of the more annoying aspects of fontconfig when dealing with 
Asian locales. I made a similar rule to prefer the Latin characters in 
the DejaVu fonts over the ones in a Chinese font, when in a Chinese 
locale. Naturally, the Chinese font supported Chinese character sets, so 
it was chosen.

	<match target="pattern">
		<test qual="any" name="family">
			<string>sans-serif</string>
		</test>
		<edit name="family" mode="append" binding="same">
			<string>DejaVu Sans</string>
		</edit>
	</match>

	<match target="pattern">
		<test qual="any" name="family">
			<string>serif</string>
		</test>
		<edit name="family" mode="append" binding="same">
			<string>DejaVu Serif</string>
		</edit>
	</match>

	<match target="pattern">
		<test qual="any" name="family">
			<string>monospace</string>
		</test>
		<edit name="family" mode="append" binding="same">
			<string>DejaVu Sans Mono</string>
		</edit>
	</match>

Basically, it forces the three DejaVu fonts to the top of the 
substitution list.

Initially, I was using "strong" bindings, but that broke Flash 9 at the 
time. I don't know if it would still break Flash 10.

--Pat


More information about the Fontconfig mailing list