美文网首页
13. Drawing Strings

13. Drawing Strings

作者: ngugg | 来源:发表于2018-10-29 16:26 被阅读0次

You can draw string objects directly in a focused NSView using methods such as drawAtPoint:withAttributes: (to draw a string with multiple attributes, such as multiple text fonts, you must use an NSAttributedString object). These methods are described briefly in Text in Cocoa Drawing Guide.

  • 您可以使用诸如drawAtPoint:withAttributes之类的方法直接在聚焦的NSView中绘制字符串对象(要绘制具有多个属性的字符串,例如多个文本字体,您必须使用NSAttributedString对象)。 这些方法在“可可图绘制指南”中简要描述。

The simple methods, however, are designed for drawing small amounts of text or text that is only drawn rarely—they create and dispose of various supporting objects every time you call them. To draw strings repeatedly, it is more efficient to use NSLayoutManager, as described in Drawing Stringsin Text Layout Programming Guide. For an overview of the Cocoa text system, of which NSLayoutManager is a part, see Cocoa Text Architecture Guide.

  • 然而,简单的方法是为了绘制少量只是很少绘制的文本或文本而设计的 - 每次调用它们时它们都会创建和处理各种支持对象。 要重复绘制字符串,使用NSLayoutManager会更有效,如“绘制字符串文本布局编程指南”中所述。 有关Cocoa文本系统的概述,其中NSLayoutManager是其中的一部分,请参阅Cocoa Text Architecture Guide。

相关文章

  • 13. Drawing Strings

    You can draw string objects directly in a focused NSView ...

  • 06. Drawing Attributed Strings

    The Application Kit’s NSStringDrawing extensions let you ...

  • UIView相关

    Drawing Cycle The UIView class uses an on-demand drawing ...

  • canvas绘图

    1.基本用法 A drawing of something var drawing = document.getE...

  • Drawing

    好久没有画了,今天是我的阳历生日,20岁加油!!!

  • Drawing

    I spent more than 3 hours on drawing Why did not I do som...

  • Drawing

    DAY.4 这个是临摹简书上的,觉得很可爱,把它剪下来贴到黑色纸的本子上超级喜欢啊,回头再多画些,这些简单的图案让...

  • Drawing

    DAY.6 第一次用针管笔描边,果然蛮爽哒 棒棒糖有点吃藕哈哈 周六,你说,如果什么事情都没有,就听着歌然后画两笔...

  • Drawing

  • Drawing

    Just yesterday, I finally received the marker my mother g...

网友评论

      本文标题:13. Drawing Strings

      本文链接:https://www.haomeiwen.com/subject/bmobtqtx.html