NSGraphicsMBS constants

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSGraphicsMBS class.

Drawing Option Constants

NSGraphicsMBS.NSStringDrawingDisableScreenFontSubstitution = 4

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 11.3
One of the drawing option constants.

Disable screen font substitution (equivalent to NSLayoutManager.setUsesScreenFonts(false)).

NSGraphicsMBS.NSStringDrawingOneShot = 16

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 11.3
One of the drawing option constants.

Suppresses caching layout information.

NSGraphicsMBS.NSStringDrawingTruncatesLastVisibleLine = 32

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 11.3
One of the drawing option constants.

Truncates and adds the ellipsis character to the last visible line if the text doesn't fit into the bounds specified.
This option is ignored if NSStringDrawingUsesLineFragmentOrigin is not also set. In addition, the line break mode must be either NSLineBreakByWordWrapping or NSLineBreakByCharWrapping for this option to take effect. The line break mode can be specified in a paragraph style passed in the attributes dictionary argument of the drawing methods.
Available in Mac OS X v10.5 and later.

NSGraphicsMBS.NSStringDrawingUsesDeviceMetrics = 8

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 11.3
One of the drawing option constants.

Uses image glyph bounds instead of typographic bounds.

NSGraphicsMBS.NSStringDrawingUsesFontLeading = 2

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 11.3
One of the drawing option constants.

Uses the font leading for calculating line heights.

NSGraphicsMBS.NSStringDrawingUsesLineFragmentOrigin = 1

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 11.3
One of the drawing option constants.
Example
// create Hello World in red
dim a as NSAttributedStringMBS = NSAttributedStringMBS.attributedStringWithString("Hello World")
dim m as NSMutableAttributedStringMBS = a.mutableCopy

m.addAttribute(a.NSForegroundColorAttributeName, NSColorMBS.redColor, new NSRangeMBS(0, m.length))

// put it in a textarea
TextArea1.NSTextViewMBS.textStorage.setAttributedString m

// draw in Canvas
dim g as new NSGraphicsMBS(Canvas1.NSViewMBS)

g.drawWithRect m, new NSRectMBS(20,20, 100, 100), g.NSStringDrawingUsesLineFragmentOrigin

The specified origin is the line fragment origin, not the baseline origin.

The items on this page are in the following plugins: MBS MacCocoa Plugin.


💬 Ask a question or report a problem