Re: fonts problem

From: Dmitry Karasik <>
Date: 23 Aug 2005 15:53:19 +0200

        Hi Richard!

On 23 Aug 05 at 07:06, "Richard" (Richard Morgan) wrote:

 Richard> Hi All, I am trying to get Prima to output traditional Chinese
 Richard> (Big 5) characters on my Japanese PC.

 Richard> In trying to do this I was looking at the examples/fontdlg perl
 Richard> script. In there there are some Big 5 fonts (well on my machine)
 Richard> such as MingLiU. If I use the fontdlg program it lists three
 Richard> encodings (any) Western Chinese Big 5

 Richard> If I select Chinese Big 5 I get the following errors on the
 Richard> command line

 Richard> WIN_87 (Parameter is Wrong. ) at line 1612 in win32/gp.cWIN_87
 Richard> (Parameter is wrong ) at line 1612 in win32/gp.cWIN_87 (Parameter
 Richard> is wrong ) at line 892 in win32/gp.c

It seems that Win32 API doesn't expect to be asked to display Latin-1 8-bit
strings with 16-bit Chinese fonts. It's not true on my machine, I managed
to display all glyphs o.k. with some random Chinese fonts I downloaded and

This hypothesis can be tested if I you click on the [i] button, you should
see all the available letters in the character window without any problem.
If it is indeed the case, then it's most probably a minor bug with either
the font or Win32 API itself, and there are two ways to solve that.

The first is, you can recompile Prima with debugging mode off, and you'll never
see the error again. If the font indeed does not contain Latin1 glyphs,
that might be the best option. To do so, remove lines 135,136,144,145
from include/win32/win32guts.h and recompile.

The second is to use utf8 strings in Prima, either globally
or locally. For the global trick "use encoding 'utf8'" should be
sufficient, but there might be some surprises, such as examples/
itself containing a 0xC1 character in the source code, that results in a
warning. Local conversions from 'bytes' to 'utf8' are done with Encode

 Richard> Does anyone know what is wrong with this font, or where to look
 Richard> to correct it?

I can't find anything related at MSDN, but it looks like a Win32 API bug,
and I think there's a chance that it might be silently gone after one of
service packs is applied.

	Dmitry Karasik
Received on Tue 23 Aug 2005 - 15:53:22 CEST

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:06 CET