如何计算两种字体之间的间距 [英] How to calculate space between two fonts

查看:104
本文介绍了如何计算两种字体之间的间距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据ia:ABCDEF

GHIJKL

此处ABCDEF放置在下面的第一行中,确切地,GHIJKL放置在映射A-> G,B-> H,C-> I ........
如何在c#中编码A字符和G字符之间的距离?

My data ia : ABCDEF

GHIJKL

Here ABCDEF is placed in first row below Exactly GHIJKL is placed Mapping A->G,B->H,C->I........
How to code the distance between A character and G character in c#?

推荐答案

没有" A字体"和" B字体".可能,您当然是在说别的东西.请使用Google翻译或字典来帮助您翻译英语的意思.

您是指字符"和代码点之间的距离吗?然后,该死的琐碎的.

您是指使用某种字体渲染的字符串部分之间的几何差异吗?然后,这极其困难;我认识的大多数人都不知道该怎么做,因为执行此操作的简单" .NET方法提供的精度很差,这与字形渲染的狡猾算法有关.我碰巧在论坛上找到了使用权解决方案,但是要再次找出它需要花费大量时间.

我宁愿等到您弄清自己想要得到的东西.不要忘记解释原因.
—SA
There is no such thing as "A font" and "B font". Probably, you certainly mean something else. Please use Google Translate or a dictionary which help you to translate what do you mean in English.

Do you mean "character" and distance between code points? Then it is damn trivial.

Do you mean geometrical difference between parts of the string rendered using some font? Then this is extremely difficult; and most people I knew did not know how to do it because the "simple" .NET method of doing it provides very poor accurately, which is related to a cunning algorithm of glyph rendering. I happen use right solution I found in forums, but it would take be considerable time to find out it again.

I''ll prefer to wait until you clarify what you''re trying to get. Don''t forget to explain why.

—SA


字体的高度特定于显示文本的设备.因此,如果作为打印机的姿势在屏幕上显示,则"Ariel" 12的实际高度是不同的.若要获取特定字体的高度,需要在特定设备上使用Font类的Font.GetHeight()重载之一. 此处 [
The height of a Font is specific to the device displaying the text. Thus the actual height of "Ariel" 12 is different if displayed on a screen as a pose to a printer. To get the height of your particular font, on your particular device you need to use one of the Font.GetHeight() Overloads of the Font class. Here[^] is the MSDN documentation for the method.

Hope this helps


这篇关于如何计算两种字体之间的间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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