How does the computer draw a letter?

我与影子孤独终老i 提交于 2020-01-25 00:43:09

问题


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?


回答1:


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).

A glyph is a collection of paths.

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.



来源:https://stackoverflow.com/questions/13832387/how-does-the-computer-draw-a-letter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!