What happens when you involve an unenabled Uniscribe with vertical text, given that Uniscribe doesn't handle vertical text?

by Michael S. Kaplan, published on 2008/05/12 10:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2008/05/12/8490406.aspx

So I got email from a developer colleague the other day.

It was that same developer who had previously impressed me -- as described in Expertise isn't always everything (aka When the one who is learning teaches us something important) -- and kept me from embarrassing myself by unknowingly repeating the same topic again -- as described in Font size scaling -- GDI vs. GDI+.

Due to the positive nature of these two interactions (and several later ones by other members of her team), I like to pay attention when one of those mails hits my inbox. You know, just in case....

And this mail turned to be no exception. :-)

The mail read:

Hello Michael,

We are running into a problem with vertical text and I am hoping you might be able to shed some light on it.  Please take a look at the attached files – the pdf file is what we expect to see in terms of content, the TIF file is what we get.

The TIF file was generated on a Window 2003 server with Office 12 installed. The problem is caused by
@ in front of font family. The font used  in this case is Tahoma but the problem repro’s with other fonts too.

The interesting part is that we  don’t have this problem on other computers. I tried on Vista, XP and even on another Windows 2003 server too. It works just fine. I compared the versions of GDI and Uniscribe dll’s on the two Windows 2003 servers and they are the same.

The ScriptShape and ScriptPlace methods succeed and the glyphs and their widths look good. It suspect this is more of a drawing problem.

Any clue what might go wrong here? Any system settings that I should compare between the two computers?

Thank you,

The  PDF file looked something like this (shown here as a somewhat reduced image of what it looked like):

And the image file looked really different:



I was at a loss for a moment -- it isn't like I had ever seen that kind of a problem before.

But then I thought about the lesson learned from Expertise isn't always everything and the fact that they were pushing past the traditional boundaries of vertical text where people had previously been comfortable.

My response was understated. I reasoned that it worked on one machine and not another, yet file versions all looked the same, and so:

Hey, long time no mail! :-)

The biggest thing I'd check would be whether Complex Script support was turned on or not -- when it is not, the binaries for Uniscribe are still around but the hooks so GDI call back into them don't happen.

I admit that at the time I was stalling a bit, as I wanted to look into this with some people also but I didn't want to suggest nothing at alln the meantime.

To be honest, I did not suspect that this would actually help, but I knew it was vaguely possible that it might (for the reason given -- the world of calling Uniscribe directly and sometimes indirectly has strange behavior when complex script support is turned off and most indirect hooks from GDI to Uniscribe are not doing anything).

Turns out that it fixed the problem!

Now for the follow-up we talked about a bunch of other issues like whether thy should always make sure the support is enabled, what that checkbox actually does in the way of settings, and so on. She realized it would make sense to understand more about the interaction between GDI and Uniscribe.

I will follow-up on this topic in the future -- lots of other people would also like to understand this area better, beyond this one team that is finding issues no one ever even imagined that must nevertheless be figured out and in many cases documented and in some cases fixed when bugs are found (these are Destry bugs of the highest order!).

Especially in this weird case -- where vertical text does not traditionally go through Uniscribe, and the only Uniscribe connection here is that they were technically calling through the low-level Uniscribe APIs to get the work done.

Explaining how it ended up solving the problem?

That one managed to stump everyone I asked.

Though no one was truly surprised that it worked.

Which I guess just goes to show you how complicated the interaction in the text stack is.

Especially when running non-complex vertical (and thus GDI-handled) text through Uniscribe when complex script support (and thus GDI to Uniscribe connection via LPK) is turned off.

Yet another reason to be thankful that this support is always turned on now, starting in Vista? :-)

This blog brought to you by(U+17a3, aka KHMER INDEPENDENT VOWEL QAQ)

no comments

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

referenced by

2011/08/31 And then, the unrelated KB article fixes the problem...

2010/09/22 Looking at life a bit more vertically, for a moment...

2008/12/02 IsCrAndLfComplex or what?

go to newer or older post, or back to index or month or day