打印文本相关问题。 [英] Printing Text Related Issue.

查看:104
本文介绍了打印文本相关问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解或更多地了解它是如何工作的。



这是我想要实现的一个例子:



高度为5mm的打印区域宽度20毫米。

现在我的目标是打印一个足以拉伸5毫米和20毫米区域的文本。



我需要创建一个函数或一组函数,可以帮助我确定字体的正确高度和宽度。



有什么建议吗?

I am trying to understand or more over figure it out how it works.

Here is an example what I am trying to achieve:

A printing area with height 5mm and width 20mm.
Now my target is to print a text that will stretched enough to fill 5mm and 20mm area.

I need to create a function or set of functions that will help me to determine the proper height and width of a font.

Any suggestion?

推荐答案

我的第一个想法是根据高度选择合适的字体您的框,并将文本呈现到内存位图。它可能没有所需的宽度,因为您无法影响字体的宽高比。然后在第二步中计算所需的水平拉伸/压缩系数,并将内存位图拉伸到显示区域。
My first idea would be to select an appropriate font according to the height of your box and render the text into a memory bitmap. It probably has not the desired width, as you can't influence the aspect ratio of the font. Then in a second step compute the required horizontal stretching/compression factor and stretchblt the memory bitmap into your display area.


这篇关于打印文本相关问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆