Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is SetLayout(LAYOUT_RTL) fatally flawed?

12 views
Skip to first unread message

Chris Shearer Cooper

unread,
Apr 4, 2007, 1:08:47 PM4/4/07
to
We have a program that works with both English and Hebrew, and when we print
in Hebrew from an English version of Windows, we manually call
SetLayout(LAYOUT_RTL) on the printer DC to get the proper layout of items.

"Mirroring is in fact nothing else than a coordinate transformation" -
http://www.microsoft.com/globaldev/getwr/steps/WRG_mirror.mspx

However, there are several major problems that we encounter when printing.

1) The Hebrew text is all screwy on the printouts. Letters overlap each
other, spacing is all wrong, words get re-ordered. We got around for each
call to DrawText() by switching out of LAYOUT_RTL, re-calculating the
position of the text, drawing the text, and then putting LAYOUT_RTL back.
We tried setting various flags to DrawText() like DT_RTLREADING, without any
obvious effect.

2) The coordinate transformation is wrong. The origin of the mirrored
coordinate space is at a random location, approximately 2" in from the
top-left corner of the page. The exact position is dependent on screen
resolution (!), among other things, I suspect.

3) The documentation is wrong. CDC::SetLayout() says the mapping mode will
return MM_ISOTROPIC; it actually returns MM_ANISOTROPIC. Minor issue.

4) The mapping mode is screwy. If I do set the mapping mode to
MM_ISOTROPIC, now it tells me my viewport extents are 6282x-4800 (slightly
reasonable for 8.5"x11" page with margins, but upside-down for no apparent
reason) and my window extents are 2650x2030. From which section of thin air
did it pull the window extent numbers?

Is anyone actually using SetLayout(LAYOUT_RTL) and having their printouts
work correctly?

Thanks,
CHris


0 new messages