Hello Erik and others,
In the MSJ article on Unicode in Windows 9x etc I listed W (Unicode)
functions that are implemented on Windows 95 and Windows 98 that I got from
a source in the dev group. I haven't tested all of them myself. I found out
after the aticle went to press that some of those functions had bugs in
Windows 95 that were fixed in Windows 98.
Workaround for GetTextExtent32W: As I said, I'm not an expert in this
function, so what I came up with are just some obvious hacks. After all is
said and done, converting to ANSI and using the A routine is probably the
easiest thing to do. Anyway, here are some things I thougth of:
If it only fails on 00b7 when passed as a single character, it seems you
could hack a solution using a string with 00b7 plus one other character
whose height is known to be less than that of 00b7, and then subtract off
the width of that other character. This assumes the font you're using
doesn't kern, and there's no other typographical interaction between the
other character and 00b7. By the way, have you tried GetCharWidthsW? It
might work OK, assuming you only need widths.
The other workaround is a pain, but it should work: Use GetFontData to query
the glyph widths directly from a table in the true type font file; in this
case the smallGlyphMetrics table should do. You have to know a lot about the
TTF file format to get this to work -- see
http://www.microsoft.com/typography/tt/tt.htm for details.
BTW, note that in the first article mentioned below, we say that Uniscribe
works on Windows 95 *except Far East versios*. That's because some of the
functions we needed to implement Uniscribe were not available on CJK Windows
95. This may be related to the bugs you're seeing on Japanese Windows 95.
Sorry I'm not more help than this.
F. Avery Bishop
From: email@example.com [mailto:firstname.lastname@example.org]
Sent: Friday, April 16, 1999 5:14 PM
To: Unicode List
Cc: Unicode List
Subject: Re: We are not the only ones ...
> It appears that many issues concerning the binary incompatibility of a
> Unicode program between Microsoft Windows 9x and Microsoft Windows NT are
> still to be discussed.
Yes, I am currently wrestling with this issue too. I did find a couple
of interesting articles on the Microsoft Web site:
Be careful, though, since I did find some inaccurate info in there. For
example, one of the articles says that GetTextExtentPoint32W works on
Win95 and Win98, but I have found that it crashes on Japanese Win95 if
you call it on a string with the single character U+00B7 or on some
multi-char strings containing U+017D or U+017E. (To be fair, I should
add that the author does urge the reader to test apps on various
versions of the OS.)
If anybody knows how to get around this Win95-J problem, preferably
without resorting to the "A" functions (e.g. GetTextExtentPoint32A),
could you let me know?
Erik van der Poel
This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:20:45 EDT