电脑如何写字母? [英] How does the computer draw a letter?
问题描述
我对创建一个能够识别图像中的数字,字母,符号的程序感兴趣.但是首先,我继续思考:您的系统如何显示字母?
I'm interested in creating a program capable of recognition of numbers, letters, symbols from an image. But first off, I went ahead and started to think about: How your system displays a letter?
有太多的字体,字体大小和其他特征.我想有一个方程用于生成具有给定参数的字母,是真的吗?还是系统还有其他方式生成字母?
There are so many fonts, font-sizes and other characteristics. I suppose there is an equation used to generate a letter with given parameters, is that true? Or are there other ways in which your system generates letters?
我发现这样一个基本的东西非常有趣,而且我在网络上找不到任何信息. 有什么想法吗?
I found such a basic thing so interesting, and I can’t find any information on the web. Any ideas?
推荐答案
每个字符都被通用分配一个代码.
Each character is universally assigned a code.
字体实际上是从代码(字符)到字形(有关如何绘制字符的说明)的映射.
A font really is a mapping from a code (character) to glyph (instructions on how to draw the character).
字形是路径的集合.
路径是一个字符串,实际上是关于在何处/如何绘制各种点,线和曲线的编码说明.字形具有多个路径,因为某些字符具有孔(例如R)和/或不相交的部分(例如j). (因此,这不是描述如何绘制字符的方程式.)
A path is a string that really is coded instructions on where/how to draw the various points, lines, and curves. A glyph has more than one path because some characters have holes (like R) and/or disjoint parts (like j). (So it's not an equation that describes how to draw characters.)
操作系统和/或某些程序知道如何解释字形数据并将其转换为屏幕上的像素.
The OS and/or some programs know how to interpret the glyph data and translate that to pixels on the screen.
这篇关于电脑如何写字母?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!