![并发编程后记](https://i-blog.csdnimg.cn/blog_migrate/6d0ee7d0804b335908c879af4d643358.png)
并发编程后记
![5816394047_aa920d5992_b 5816394047_aa920d5992_b](https://i-blog.csdnimg.cn/blog_migrate/3f2ec57e44c0e6531a82428ecb547c27.png)
When printing, you might have come across the word “Postscript.” Ever wondered what the heck this means, and relevance it has to your printer? Take a minute, learn some computer history, and a little bit more about desktop printers work.
在打印时,您可能会遇到“ Postscript”一词。 有没有想过这意味着什么以及它与您的打印机的相关性? 花一分钟时间,学习一些计算机历史记录,然后更多地了解台式打印机的工作原理。
Unless you’re a computer scientist, it can be confusing to look up “Postscript” and learn that it’s a “concatenative programming language” only to find you have even more confusing words to look up. Today, we’ll make it easy, and put Postscript into context, explain what it is, why and how it does what it does, and how it pretty much turned the whole graphics world on its collective ear! Keep reading, there’s some good geeky fun stuff ahead.
除非您是计算机科学家,否则查找“ Postscript”并了解它是一种“ 连接编程语言 ”可能会令人困惑,只是发现您还有更多令人困惑的单词要查找。 今天,我们将使其变得容易,将Postscript置于上下文中,解释它的含义,原因以及如何完成其工作,以及它如何几乎使整个图形世界都为之震撼! 继续阅读,前面还有一些令人讨厌的有趣东西。
ASCII,点矩阵,绘图仪和更改打印的图形 (ASCII, Dot Matrix, Plotters, and Changing Printed Graphics)
![2214997551_0933790dcb_o 2214997551_0933790dcb_o](https://i-blog.csdnimg.cn/blog_migrate/b8afaf08db303804838f9be890756929.png)
Before we understand Postscript and more modern printing devices, we have to consider the humble roots of PC to print technology. Early computer printers were crude devices made only to reproduce text and ASCII characters—there was little to no application of graphics, and little to no use for them. These so called “dumb” printers could be programmed to produce text, although many would have had hardware limitations that would stop them from printing anything but the characters in the hardware—think “typewriter.”
在我们了解Postscript和更现代的打印设备之前,我们必须考虑PC到打印技术的卑微根源。 早期的计算机打印机是仅用于复制文本和ASCII字符的原始设备,几乎没有图形应用,也没有使用图形。 可以对这些所谓的“哑”打印机进行编程,以产生文本,尽管许多打印机本来会受到硬件的限制,从而使它们无法打印除硬件中的字符以外的任何内容,例如“打字机”。
Some of us at How-To Geek might date ourselves and say we remember an important next step in printer evolution—dot matrix printers. These were capable of printing some crude grayscale graphics with rows of pixels, as well as blocky, low pixel depth typography. Although they did have the advantage of creating digital images (although ASCII art sort of counts), the crude typography was a setback for early dot matrix printers. All dot matrix printers took directions on printing images and text in roughly the same way; break it into pixels, printing them in rows as the print head passes along the paper, feed the next bit of paper, and repeat.
《 How-To Geek》中的一些人可能会跟我们约会,并说我们记得打印机发展中的一个重要的下一步- 点矩阵打印机。 这些打印机能够打印一些带有像素行的粗灰度图形,以及块状,低像素深度的版式。 尽管它们确实具有创建数字图像的优势(尽管采用ASCII计数技术),但粗略的印刷术是早期点阵打印机的挫折。 所有的点阵打印机都以大致相同的方式指导打印图像和文本。 将其分解为像素,在打印头穿过纸张时,将它们成行打印,送入下一张纸,然后重复。
Unlike dot matrix printers, plotters are still fairly common, particularly in manufacturing. Plotters move papers, vinyl, or various other materials around on algebraic coordinates to draw, print, or cut smooth, mathematically pure vector shapes with a stylus or knife blade. As we’ve learned, because of the nature of typographic glyphs, vector shapes are vastly superior to pixels for defining abstract, mathematically pure shapes found in type. Because plotters are engineered to move around based on precise math, the instructions on how to create typography and other shapes are fairly easy for a PC to communicate to the device.
与点矩阵打印机不同, 绘图仪仍然相当普遍,特别是在制造业中。 绘图仪可在代数坐标上移动纸张,乙烯基或其他各种材料,以使用触笔或刀片在数学上纯净的矢量形状上绘制,打印或剪切。 如我们所知,由于印刷字形的性质,矢量形状在定义类型中发现的抽象的,数学上纯净的形状方面远远优于像素。 由于绘图仪经过精心设计,可以根据精确的数学运算来回移动,因此,有关如何创建字体和其他形状的说明对于PC而言,与PC进行通信非常容易。
The challenge was this: no existing model of PC to print technology could create vector-based, clean typography AND graphics at the same time. What were all the clever geeks supposed to do?
面临的挑战是:现有的PC打印技术无法同时创建基于矢量的,干净的字体和图形。 聪明的怪胎应该做什么?
Xerox PARC和第一台激光打印机的开发 (Xerox PARC, and Development Of The First Laser Printer)
![1266920715_6 1266920715_6](https://i-blog.csdnimg.cn/blog_migrate/8c34a36151683fefec9d08774e22672f.png)
Xerography, AKA photocopying, was the development printers were looking for. Although Xerography had been invented in the thirties and made commercially available as copy machines in the late fifties and sixties, it wasn’t used in PC printing until Xerox PARC engineer Gary Starkweather designed the first laser printer.
Xerography,又名影印,是打印机正在寻找的开发项目。 尽管Xerography于30年代发明,并在50年代后期和60年代作为复印机商用,但直到Xerox PARC工程师Gary Starkweather设计了第一台激光打印机后,它才被用于PC打印。
![](https://i-blog.csdnimg.cn/blog_migrate/999e525750863e3ab71917066650087a.png)
Here’s a graphic and a rough descriptions of how Xerography works: light hits electrically charged areas of the printing drum, the electrons react and those negatively charged areas lose that charge. Toner adheres to the static electricity, and is pressed onto the paper, creating artwork without the use of dot matrix style pixels. And because this printing process was fundamentally different from any of the comparatively crude methods listed above, Xerography was a logical way to print clean type and graphics at the same time. There was one simple engineering problem that had to be solved—how do you create instructions for a printer that can easily do both at once?
这是静电复印技术工作原理的图形和粗略描述:光线撞击到感光鼓的带电区域,电子发生React,带负电的区域失去电荷。 碳粉会附着在静电上,然后压在纸张上,从而在不使用点矩阵样式像素的情况下创建艺术品。 并且由于此打印过程与上面列出的任何相对较原始的方法根本不同,因此Xerography是同时打印纯净字体和图形的逻辑方法。 必须解决一个简单的工程问题-如何为可以同时轻松完成这两项任务的打印机创建说明?
两全其美:后记是印刷低语 (The Best of Both Worlds: Postscript is the Print Whisperer)
![17837312_de4a8b1767_z 17837312_de4a8b1767_z](https://i-blog.csdnimg.cn/blog_migrate/7df436f9b0d0863191ae50055a69b6f3.png)
Enter Adobe engineers and co-founders John Warnock and Charles Geschke. The pair had worked together at Xerox and had created page description language (or PDL) called Interpress. Interpress solved this engineering problem—it was a system of translating images and complicated shapes into data the printer can use to turn out high quality printed artwork. Interpress was not necessarily the first PDL, and it wasn’t Warnock and Geschke’s last collaboration. Leaving Xerox PARC, the pair developed a flagship product in Postscript, which has remained, even to this day, a graphics industry standard.
输入Adobe工程师和联合创始人John Warnock和Charles Geschke。 他们俩在Xerox一起工作,并创建了称为Interpress的页面描述语言(或PDL)。 Interpress解决了这个工程问题,它是一个将图像和复杂形状转换成打印机可以用来生成高质量打印艺术品的数据的系统。 Interpress不一定是第一个PDL,也不是Warnock和Geschke的最后一次合作。 两人离开Xerox PARC之后,在Postscript中开发了一款旗舰产品,直到今天,它仍然是图形行业的标准。
Postscript, as the name sort of suggests, is actually a Turing-complete programming language. Directions are written out in a human-readable way, and communicated to the printer, which creates the high quality art from the instructions. Here’s a sample “Hello World” program from Inkguides.com.
顾名思义,后记实际上是一种图灵完备的编程语言。 指示以人类可读的方式写出,并传达给打印机,从而根据指示创建高质量的艺术品。 这是Inkguides.com提供的示例“ Hello World”程序 。
%!PS /inch {72 mul} def /Times-Roman findfont 50 scalefont setfont 2.5 inch 5 inch moveto (Hello, World!) show showpage
PS!/ inch {72 mul} def / Times-Roman findfont 50 scalefont setfont 2.5 inch 5 inch moveto(Hello,World!)显示页面
We start to see pretty quickly what kind of instructions Postscript is giving the printer, and just how simple the directions are. Fonts referenced in this program exist in vector form and are called up from separate files—and were a big part of Adobe’s contribution to the digital graphics industry. Here’s a second example, from Mikkel Meinike Nielsen’s page on Postscript:
我们很快就开始看到Postscript给打印机的指示是什么,以及指示的简单程度。 该程序中引用的字体以矢量形式存在,可以从单独的文件中调用,这是Adobe对数字图形行业的重要贡献。 这是第二个例子,来自Mikkel Meinike Nielsen在Postscript上的页面 :
%! /Times-Roman findfont 16 scalefont setfont gsave %save before using translate 105 210 translate %This cordinates places the images on %the page %————-The actual image begin——————— 76.8 86.4 scale 40 45 1 [ 40 0 0 -45 0 45 ] { < fffff5ffffffffdeffffffffeaffffffffdeffffffffffffffffffeeffff fffffefffffffffbffffffffffffffffffccffffffff77bffffffeffdfff fffdfff7fffffbfff7fffff77ffbffff5ebfbdfffafdbf7ebffbf3ff6fdf e9ef7ff7f3d6bfff7d55afff7efffafffffffffcffff7efffffffef7ffff fffdf77fffffffeffffffffdf7bffffffbd7bfffffffbffffffff7fbbfff ffef7bffffffeefbdfffffdef7bfffffffffbfffffbdefffffff7dff7fff ff7bdffffffff7ff7ffff977e57ffffa5ffbffffff7feebffffdbff4bfff ff7fffffffffffffffffffffffffff> } image %————-The actual image end ——————— grestore %restore the settings from before the translat 0 245 moveto (Text and image, ) show 0 229 moveto (side by side. ) show showpage
%! / Times-Roman findfont 16 scalefont setfont gsave使用翻译之前保存105210翻译%此坐标将图像放置在%页面上%——————实际图像开始———————— 76.8 86.4比例尺40 45 1 [40 0 0 -45 0 45] {<fffff5ffffffffdeffffffffeaffffffffdeffffffffffffffffffeeffff fffffefffffffffbffffffffffffffffffccffffffff77bffffffeffdfff fffdfff7fffffbfff7fffff77ffbffff5ebfbdfffafdbf7ebffbf3ff6fdf e9ef7ff7f3d6bfff7d55afff7efffafffffffffcffff7efffffffef7ffff fffdf77fffffffeffffffffdf7bffffffbd7bfffffffbffffffff7fbbfff ffef7bffffffeefbdfffffdef7bfffffffffbfffffbdefffffff7dff7fff ff7bdffffffff7ff7ffff977e57ffffa5ffbffffff7feebffffdbff4bfff ff7fffffffffffffffffffffffffff>}图像%-----实际影像端------- grestore%从translat之前恢复设置0 245 moveto(文本和图像,)显示0 229 moveto(并排。)显示页面
This large middle section of gobbledygook is actually hexadecimal code that defines an image. Most Postscript isn’t written by hand like this, but rather by programs. To get an idea of what this Postscript code actually looks like, take a look at this screencap from Mikkel’s page below of the image this code generated. Entire photographic mages can also be re-written as postscript this way—the filetype is called Encapsulated Post Script, or EPS.
gobbledygook的这个较大的中间部分实际上是定义图像的十六进制代码。 大多数Postscript并不是这样手写的,而是由程序编写的。 要了解此Postscript代码的实际外观,请查看此代码生成的图像下方Mikkel页面的屏幕截图。 整个照相法师也可以用这种方式重写为后记-文件类型称为“封装后记脚本”(EPS)。
![sshot-5 sshot-5](https://i-blog.csdnimg.cn/blog_migrate/113a9aa5f437cf2c0bd277f6643b349c.png)
现代印刷页和较新的印刷Craft.io (Modern Printed Pages and Newer Printing Processes)
![124250578_d4b7f029cf_o 124250578_d4b7f029cf_o](https://i-blog.csdnimg.cn/blog_migrate/bfa748b9528f763a527f9698d260ccf2.png)
Nowadays, not all printers use Postscript, but all of them have to have some kind of translation layer to turn text and image data into printed material. We usually call these programs printer drivers—and nowadays they come from the manufacturer, and are a proprietary software. In some form or fashion, this Is an crucial piece of what all printers need to communicate with PCs—even though the printers we use in our homes are solving very different problems than the first laser printers. Regardless, Postscript was Adobe’s first big success, and is part of what effectively the start of a worldwide popular explosion of graphics and design.
如今,并不是所有的打印机都使用Postscript,但是所有的打印机都必须具有某种翻译层才能将文本和图像数据转换为打印的材料。 我们通常将这些程序称为打印机驱动程序 -如今,它们来自制造商,并且是专有软件。 以某种形式或方式,这是所有打印机与PC进行通信所必需的关键部分-即使我们在家中使用的打印机解决的问题与首批激光打印机相比也大不相同。 无论如何,Postscript是Adobe的第一个重大成功,并且是有效启动全球流行的图形和设计爆炸的一部分 。
Image Credits: Brother Printer MFC-8370 by Jung-nam Nam, available under Creative Commons. Ancient Dot Matrix Printer by Andy Broomfield, available under Creative Commons. IBM 3800, photographer unknown, assumed fair use. Xerographic Photocopy process by Yzmo, available under GNU license. Adobe software by Seven Block, available under Creative Commons. The new printer by Erin Sparling, available under Creative Commons.
图片来源:Jung-nam Nam的Brother打印机MFC-8370,可在创用CC下获得。 安迪·布鲁姆菲尔德(Andy Broomfield)的古代点矩阵打印机,可在创用CC下获得。 IBM 3800,摄影师不详,被认为是合理使用。 Yzmo的Xerographic复印过程,可在GNU许可下获得。 Seven Block提供的Adobe软件,可在Creative Commons下获得。 Erin Sparling的新打印机,位于“知识共享”下。
翻译自: https://www.howtogeek.com/100016/printing-what-is-postscript/
并发编程后记