user-0 提问: c++如何控制在MM_HIMETRIC模式下，中文的显示？

回复:
user: user-1
content: Mapping Modes and Translations The mapping modes are described in the following table.   Mapping Mode Description  MM_ANISOTROPIC Each unit in page space is mapped to an application-specified unit in device space. The axis may or may not be equally scaled (for example, a circle drawn in world space may appear to be an ellipse when depicted on a given device). The orientation of the axis is also specified by the application.  MM_HIENGLISH Each unit in page space is mapped to 0.001 inch in device space. The value of x increases from left to right. The value of y increases from top to bottom.  MM_HIMETRIC Each unit in page space is mapped to 0.01 millimeter in device space. The value of x increases from left to right. The value of y increases from top to bottom.  MM_ISOTROPIC Each unit in page space is mapped to an application-defined unit in device space. The axes are always equally scaled. The orientation of the axes may be specified by the application.  MM_LOENGLISH Each unit in page space is mapped to 0.01 inch in device space. The value of x increases from left to right. The value of y increases from top to bottom.  MM_LOMETRIC Each unit in page space is mapped to 0.1 millimeter in device space. The value of x increases from left to right. The value of y increases from top to bottom.  MM_TEXT Each unit in page space is mapped to one pixel; that is, no scaling is performed at all. When no translation is in effect (this is the default), page space in the MM_TEXT mapping mode is equivalent to physical device space. The value of x increases from left to right. The value of y increases from top to bottom.  MM_TWIPS Each unit in page space is mapped to one twentieth of a printer's point (1/1440 inch). The value of x increases from left to right. The value of y increases from top to bottom.    To set a mapping mode, call the SetMapMode function. Retrieve the current mapping mode for a DC by calling the GetMapMode function.   The page-space to device-space transformations consist of values calculated from the points given by the window and viewport. The window and viewport each consist of a pair of points, with one point specifying an origin and the other a width and height (called the extents). The window points are in logical coordinates; the viewport in device coordinates (pixels). The system combines the origins and extents from both the window and viewport to create the transformation. This means that the window and viewport each specify half of the factors needed to define the transformation used to map points in page space to device space. The effect of a transformation calculated in this way is that The system maps the window origin to the viewport origin and the window extents to the viewport extents, as shown in the following illustration.    The window and viewport extents establish a ratio or scaling factor used in the page-space to device-space transformations. For the six predefined mapping modes (MM_HIENGLISH, MM_LOENGLISH, MM_HIMETRIC, MM_LOMETRIC, MM_TEXT, and MM_TWIPS), the extents are set by the system when SetMapMode is called. They cannot be changed. The other two mapping modes (MM_ISOTROPIC and MM_ANISOTROPIC) require that the extents are specified. This is done by calling SetMapMode to set the appropriate mode and then calling the SetWindowExtEx and SetViewportExtEx functions to specify the extents. In the MM_ISOTROPIC mapping mode, it is important to call SetWindowExtEx before calling SetViewportExtEx.  The window and viewport origins establish the translation used in the page-space to device-space transformations. Set the window and viewport origins by using the SetWindowOrgEx and SetViewportOrgEx functions. The origins are independent of the extents, and an application can set them regardless of the current mapping mode. Changing a mapping mode does not affect the currently set origins (although it can affect the extents). Origins are specified in absolute units that the current mapping mode does not affect. To alter the origins, use the OffsetWindowOrgEx and OffsetViewportOrgEx functions.  The following formula shows the math involved in converting a point from page space to device space.  Dx = ((Lx - WOx) * VEx / WEx) + VOx    The following variables are involved.  Dx     x value in device units  Lx     x value in logical units (also known as page space units)  WOx     window x origin  VOx     viewport x origin  WEx     window x-extent  VEx     viewport x-extent    The same equation with y replacing x transforms the y component of a point.  The formula first offsets the point from its coordinate origin. This value, no longer biased by the origin, is then scaled into the destination coordinate system by the ratio of the extents. Finally, the scaled value is offset by the destination origin to its final mapping.  The LPtoDP and DPtoLP functions may be used to convert from logical points to device points and from device points to logical points, respectively.

user: user-0
content: 对于打印预览和打印只要更改HDC就可以。

user: user-0
content: 问题解决了。源代码如下： SetMapMode(print_or_window_hdc,MM_HIMETRIC);       //设置映射模式0.01mm为单位 LOGFONT		logfont;       //定义字体对象 memset(&logfont, 0, sizeof(LOGFONT));       //初始化 logfont.lfWidth   =50*i;       //这里的长度单位是和映射模式密切相关的也就是单位是映射模式的单位，这里是0.01mm，所以一个字寛是50*0.01mm=0.5mm。i是放大倍数 logfont.lfHeight =75*i; //logfont.lfWeight =10;       //设置上面，这个磅数就没有作用了 strcpy(logfont.lfFaceName, "宋体");       //字体集 HFONT	hfont=CreateFontIndirect(&logfont);       //创建字体 SelectObject(print_or_window_hdc,hfont);       //应用字体到指定HDC TextOut(print_or_window_hdc,1035*i,-90*i,"天津城建大学计划外购置申请表",28);       //绘制字体 DeleteObject(&logfont);       //不用字体，一定记住要删除，释放资源

user: user-0
content: 用creatfont创建字体没有效果啊

user: user-1
content: 去VC/MFC论坛问问？

user: user-1
content: Coordinate Functions  DPtoHIMETRIC Converts device units into HIMETRIC units.  DPtoLP Converts device units into logical units.  HIMETRICtoDP Converts HIMETRIC units into device units.  HIMETRICtoLP Converts HIMETRIC units into logical units.  LPtoDP Converts logical units into device units.  LPtoHIMETRIC Converts logical units into HIMETRIC units.

user: user-1
content: Text Functions  TextOut Writes a character string at a specified location using the currently selected font.  ExtTextOut Writes a character string within a rectangular region using the currently selected font.  TabbedTextOut Writes a character string at a specified location, expanding tabs to the values specified in an array of tab-stop positions.  DrawText Draws formatted text in the specified rectangle.  GetTextExtent Computes the width and height of a line of text on the attribute device context using the current font to determine the dimensions.  GetOutputTextExtent Computes the width and height of a line of text on the output device context using the current font to determine the dimensions.  GetTabbedTextExtent Computes the width and height of a character string on the attribute device context.  GetOutputTabbedTextExtent Computes the width and height of a character string on the output device context.  GrayString Draws dimmed (grayed) text at the given location.  GetTextAlign Retrieves the text-alignment flags.  SetTextAlign Sets the text-alignment flags.  GetTextFace Copies the typeface name of the current font into a buffer as a null-terminated string.  GetTextMetrics Retrieves the metrics for the current font from the attribute device context.  GetOutputTextMetrics Retrieves the metrics for the current font from the output device context.  SetTextJustification Adds space to the break characters in a string.  GetTextCharacterExtra Retrieves the current setting for the amount of intercharacter spacing.  SetTextCharacterExtra Sets the amount of intercharacter spacing.    Font Functions  GetFontData Retrieves font metric information from a scalable font file. The information to retrieve is identified by specifying an offset into the font file and the length of the information to return.  GetKerningPairs Retrieves the character kerning pairs for the font that is currently selected in the specified device context.  GetOutlineTextMetrics Retrieves font metric information for TrueType fonts.  GetGlyphOutline Retrieves the outline curve or bitmap for an outline character in the current font.  GetCharABCWidths Retrieves the widths, in logical units, of consecutive characters in a given range from the current font.  GetCharWidth Retrieves the fractional widths of consecutive characters in a given range from the current font.  GetOutputCharWidth Retrieves the widths of individual characters in a consecutive group of characters from the current font using the output device context.  SetMapperFlags Alters the algorithm that the font mapper uses when it maps logical fonts to physical fonts.  GetAspectRatioFilter Retrieves the setting for the current aspect-ratio filter.

user: user-2
content: 1）放大字体 字体的宽度和高度放大100 2）显示后缩放图像 StretchBlt 图像放大100倍。

user: user-3
content: 坚决消灭领会副。

user: user-0
content: 怎么没人会吗？

user: user-0
content: 英文啊。。。。。。翻译先 再看