Xojo Conferences
MBSOct2019CologneDE

Platforms to show: All Mac Windows Linux Cross-Platform

CTFontMBS.AdvancesForGlyphs(orientation as Integer, glyphs() as Integer) as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Calculates the advances for an array of glyphs and returns the summed advance.
Notes:
font: The font reference.
orientation
The intended drawing orientation of the glyphs. Used to determined which glyph metrics to return.
glyphs: An array of count number of glyphs.
advances: An array of count number of CGSizeMBS objects to receive the computed glyph advances. Optional.

Returns the summed glyph advance of an array of glyphs.

Individual glyph advances are passed back via the advances parameter. These are the ideal metrics for each glyph scaled and transformed in font space.

See also:

Feedback, Comments & Corrections

CTFontMBS.AdvancesForGlyphs(orientation as Integer, glyphs() as Integer, boundingRects() as CGSizeMBS) as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Calculates the advances for an array of glyphs and returns the summed advance.
Notes:
font: The font reference.
orientation
The intended drawing orientation of the glyphs. Used to determined which glyph metrics to return.
glyphs: An array of count number of glyphs.
advances: An array of count number of CGSizeMBS objects to receive the computed glyph advances. Optional.

Returns the summed glyph advance of an array of glyphs.

Individual glyph advances are passed back via the advances parameter. These are the ideal metrics for each glyph scaled and transformed in font space.

See also:

Feedback, Comments & Corrections

CTFontMBS.AttributeValue(key as string) as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns the value associated with an arbitrary attribute of the given font.
Notes:
key: The requested attribute.

Returns attribute value or nil if the requested attribute is not present.
Available in OS X v10.5 and later.

Feedback, Comments & Corrections

CTFontMBS.AvailableTables(options as Integer) as String()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns an array of font table tags.
Notes:
options: The font table options.

Returns an array of Font Table Tag Constants values for the given font and the supplied options.
Available in OS X v10.5 and later.

Feedback, Comments & Corrections

CTFontMBS.BoundingRectsForGlyphs(orientation as Integer, glyphs() as Integer) as CGRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Calculates the bounding rects for an array of glyphs and returns the overall bounding rectangle for the glyph run.
Notes:
font: The font reference.
orientation: The intended drawing orientation of the glyphs. Used to determined which glyph metrics to return.
glyphs: An array of count number of glyphs.
boundingRects: Optional. On output, the computed glyph rectangles in an array of count number of CGRect objects.

Returns the overall bounding rectangle for an array or run of glyphs. Returns CGRectNull on error.

The bounding rectangles of the individual glyphs are returned through the boundingRects parameter. These are the design metrics from the font transformed in font space.

See also:

Feedback, Comments & Corrections

CTFontMBS.BoundingRectsForGlyphs(orientation as Integer, glyphs() as Integer, boundingRects() as CGRectMBS) as CGRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Calculates the bounding rects for an array of glyphs and returns the overall bounding rectangle for the glyph run.
Notes:
font: The font reference.
orientation: The intended drawing orientation of the glyphs. Used to determined which glyph metrics to return.
glyphs: An array of count number of glyphs.
boundingRects: Optional. On output, the computed glyph rectangles in an array of count number of CGRect objects.

Returns the overall bounding rectangle for an array or run of glyphs. Returns CGRectNull on error.

The bounding rectangles of the individual glyphs are returned through the boundingRects parameter. These are the design metrics from the font transformed in font space.

See also:

Feedback, Comments & Corrections

CTFontMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: The private constructor.

Feedback, Comments & Corrections

CTFontMBS.CreateCopyWithAttributes(size as Double, Matrix as CGAffineTransformMBS, fontAttributes as CTFontDescriptorMBS) as CTFontMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns a new font with additional attributes based on the original font.
Example:
// find PostScript names for a font
const nameOfAFont = "Arial"

dim FontName as string
dim FontFamilyName as string
dim FontPostscriptName as string
dim FontPostscriptNameBold as string
dim FontPostscriptNameItalic as string

dim f as CTFontMBS = CTFontMBS.CreateWithName(nameOfAFont, 13)

if f <> nil then
FontName = f.FullName
FontFamilyName = f.FamilyName
FontPostscriptName = f.PostScriptName

dim d as CTFontDescriptorMBS = f.FontDescriptor

dim db as CTFontDescriptorMBS = CTFontDescriptorMBS.CreateCopyWithSymbolicTraits(d, CoreTextMBS.kCTFontTraitBold, CoreTextMBS.kCTFontTraitBold)
dim di as CTFontDescriptorMBS = CTFontDescriptorMBS.CreateCopyWithSymbolicTraits(d, CoreTextMBS.kCTFontTraitItalic, CoreTextMBS.kCTFontTraitItalic)

dim fb as CTFontMBS = f.CreateCopyWithAttributes(f.Size, nil, db)
dim fi as CTFontMBS = f.CreateCopyWithAttributes(f.Size, nil, di)

FontPostscriptNameBold = fb.PostScriptName
FontPostscriptNameItalic = fi.PostScriptName

end if

Break // read names in debugger
Notes:
size: The point size for the font reference. If 0.0 is specified, the original font’s size is preserved.
matrix: The transformation matrix for the font. In most cases, set this parameter to be nil. If nil is specified, the original font's matrix is preserved.
fontAttributes: A font descriptor containing additional attributes that the new font should contain.

Returns a new font reference converted from the original with the specified attributes.

This function provides a mechanism to change attributes quickly on a given font reference in response to user actions. For instance, the size can be changed in response to a user manipulating a size slider.
Available in OS X v10.5 and later.

Feedback, Comments & Corrections

CTFontMBS.CreateForString(text as string, location as Integer, length as Integer) as CTFontMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns a new font reference that can best map the given string range based on the current font.
Notes:
string: A unicode string containing characters that cannot be encoded by the current font.
location and length: The range of the string that needs to be mapped.

Returns the best substitute font from the cascade list of the current font that can encode the specified string range. If the current font is capable of encoding the string range, then it is retained and returned.

Feedback, Comments & Corrections

CTFontMBS.CreatePathForGlyph(glyph as Integer, transform as CGAffineTransformMBS) as CGPathMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Creates a path for the specified glyph.
Notes:
glyph: The glyph.
transform: An affine transform applied to the path. Can be nil. If nil, CGAffineTransformIdentity is used.

Returns a CGPath object containing the glyph outlines, nil on error. Must be released by caller.

Creates a path from the outlines of the glyph for the specified font. The path reflects the font point size, matrix, and transform parameter, applied in that order. The transform parameter is most commonly be used to provide a translation to the desired glyph origin.

Feedback, Comments & Corrections

CTFontMBS.CreateWithFamily(size as Double, Matrix as CGAffineTransformMBS, family as string) as CTFontMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns a new font in the specified family based on the traits of the original font.
Notes:
size: The point size for the font reference. If 0.0 is specified, the original font’s size is preserved.
matrix: The transformation matrix for the font. In most cases, set this parameter to be nil. If nil is specified, the original font's matrix is preserved.
family: The name of the desired family.

Returns a new font reference with the original traits in the given family, or nil if none is found in the system.
Available in OS X v10.5 and later.

Feedback, Comments & Corrections

CTFontMBS.CreateWithSymbolicTraits(size as Double, Matrix as CGAffineTransformMBS, symTraitValue as Integer, symTraitMask as Integer) as CTFontMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns a new font in the same font family as the original with the specified symbolic traits.
Example:
dim helveticaBold as CTFontMBS = CTFontMBS.CreateWithName("Helvetica-Bold", 12)
MsgBox helveticaBold.FullName

// now create similar fonts with

dim Trait as Integer = CoreTextMBS.kCTFontTraitItalic
dim TraitMask as Integer = CoreTextMBS.kCTFontTraitItalic+CoreTextMBS.kCTFontTraitBold

dim helveticaItalic as CTFontMBS = helveticaBold.CreateWithSymbolicTraits(12, nil, Trait, TraitMask)
MsgBox helveticaItalic.FullName
Notes:
size: The point size for the font reference. If 0.0 is specified, the original font’s size is preserved.
matrix: The transformation matrix for the font. In most cases, set this parameter to be nil. If nil is specified, the original font's matrix is preserved.
symTraitValue: The value of the symbolic traits.
symTraitMask: The mask bits of the symbolic traits.

Returns a new font reference in the same family with the given symbolic traits. or nil if none is found in the system.

Available in OS X v10.5 and later.

Feedback, Comments & Corrections

CTFontMBS.DefaultCascadeListForLanguages(languagePrefList() as string) as String()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Return an ordered list of CTFontDescriptorMBS's for font fallback derived from the system default fallback region according to the given language preferences.
Notes:
The style of the given is also matched as well as the weight and width of the font is not one of the system UI font, otherwise the UI font fallback is applied.

languagePrefList: The language preference list - ordered array of CFStringRef's of ISO language codes.

The ordered list of fallback fonts - ordered array of CTFontDescriptors.

Feedback, Comments & Corrections

CTFontMBS.Draw(glyphs() as Integer, positions() as CGPointMBS, context as CGContextMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Renders the given glyphs of a font at the specified positions in the supplied graphics context.
Notes:
font: The font with glyphs to render. If the font has a size or matrix attribute, context is set with these values.
glyphs: The glyphs to be rendered. The glyphs should be the result of proper Unicode text layout operations (such as with CTLine). Functions such as CTFontMBS.GetGlyphsForCharacters do not perform any Unicode text layout.
positions: The positions (origins) for each glyph in glyphs. The positions are in user space. The number of positions passed in must match the number of glyphs (in glyphs).
context: The graphics context used to render the glyphs.

This function modifies graphics state including font, text size, and text matrix if these attributes are specified in font. These attributes are not restored.

Available in OS X v10.7 and later.

Feedback, Comments & Corrections

CTFontMBS.Features as Dictionary()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns an array of font features.
Notes: Returns an array of font feature dictionaries for the font reference.

Feedback, Comments & Corrections

CTFontMBS.FeatureSettings as Dictionary()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns an array of font feature-setting tuples.
Notes:
Returns a normalized array of font feature-setting dictionaries. The array contains only the non-default settings that should be applied to the font, or nil if the default settings should be used.

A feature-setting dictionary is a tuple of a kCTFontFeatureTypeIdentifierKey key-value pair and a kCTFontFeatureSelectorIdentifierKey key-value pair. Each setting dictionary indicates which setting is enabled. It is the caller's responsibility to handle exclusive and nonexclusive settings as necessary.

The feature settings are verified against those that the font supports and any that do not apply are removed. Further, feature settings that represent a default setting for the font are also removed.

Feedback, Comments & Corrections

CTFontMBS.GlyphsForCharacters(characters() as Integer) as Integer()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Provides basic Unicode encoding for the given font, returning by reference an array of CGGlyph values corresponding to a given array of Unicode characters for the given font.
Notes: If a glyph could not be encoded, a value of 0 is passed back at the corresponding index in the glyphs array and the function returns False. It is the responsibility of the caller to handle the Unicode properties of the input characters.

Feedback, Comments & Corrections

CTFontMBS.GlyphWithName(name as string) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns the CGGlyph value for the specified glyph name in the given font.
Notes:
Name: The glyph name as a CFString object.

Returns the glyph value for the named glyph as a CGGlyph object, or if the glyph name is not recognized, the .notdef glyph index value.
The returned CGGlyph object can be used with any of the subsequent glyph data accessors or directly with Core Graphics.

Feedback, Comments & Corrections

CTFontMBS.GraphicsFont(byref fontAttributes as CTFontDescriptorMBS) as CGFontMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns a Core Graphics font reference and attributes.
Notes:
attributes: On output, points to a font descriptor containing additional attributes from the font.

Returns a CGFontMBS object for the given font reference.

Feedback, Comments & Corrections

CTFontMBS.LigatureCaretPositions(glyph as Integer) as Double()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns caret positions within a glyph.
Notes:
glyph: A reference to the glyph.

This function is used to obtain caret positions for a specific glyph. The return value is the maximum number of positions possible, and the function will populate the caller's positions buffer with available positions if possible. This function might not be able to produce positions if the font does not have the appropriate data, in which case it will return 0.

Feedback, Comments & Corrections

CTFontMBS.Name(nameKey as string) as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns a reference to the requested name of the given font.
Example:
dim c as CTFontMBS = CTFontMBS.CreateWithName("Times", 12)
MsgBox c.name(CTFontMBS.kCTFontFullNameKey)
Notes:
nameKey: The name specifier. See Name Specifier Constants for possible values.

Returns The requested name for the font, or "" if the font does not have an entry for the requested name. The Unicode version of the name is preferred, otherwise the first available version is returned.

See also:

Feedback, Comments & Corrections

CTFontMBS.Name(nameKey as string, byref language as string) as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns a reference to a localized name for the given font.
Example:
dim c as CTFontMBS = CTFontMBS.CreateWithName("Times", 12)
dim lang as string
MsgBox c.name(CTFontMBS.kCTFontFullNameKey, lang)+EndOfLine+lang
// shows name and "en" as language.
Notes:
nameKey: The name specifier. See Name Specifier Constants for possible values.
language: On output, points to the language string of the returned name string. The format of the language identifier conforms to the RFC 3066bis standard.

Returns a specific localized name from the font reference or "" if the font does not have an entry for the requested name key.

The name is localized based on the user's global language preference precedence. That is, the user’s language preference is a list of languages in order of precedence. So, for example, if the list had Japanese and English, in that order, then a font that did not have Japanese name strings but had English strings would return the English strings.

Available in OS X v10.5 and later.

See also:

Feedback, Comments & Corrections

CTFontMBS.OpticalBoundsForGlyphs(glyphs() as Integer, boundingRects() as CGRectMBS, options as Integer = 0) as CGRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Calculates the optical bounding rects for an array of glyphs and returns the overall optical bounding rect for the run.
Notes:
Fonts may specify the optical edges of glyphs that can be used to make the edges of lines of text line up in a more visually pleasing way. This function returns bounding rects corresponding to this information if present in a font, otherwise it returns typographic bounding rects (composed of the font's ascent and descent and a glyph's advance width).

font: The font reference.
glyphs: An array of count number of glyphs.
boundingRects: An array of count number of CGRects to receive the computed glyph rects. Can be nil, in which case only the overall bounding rect is calculated.
options: Reserved, set to zero.

This function returns the overall bounding rectangle for an array or run of glyphs. The bounding rects of the individual glyphs are returned through the boundingRects parameter. These are the design metrics from the font transformed in font space.

See also:

Feedback, Comments & Corrections

CTFontMBS.OpticalBoundsForGlyphs(glyphs() as Integer, options as Integer = 0) as CGRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Calculates the optical bounding rects for an array of glyphs and returns the overall optical bounding rect for the run.
Notes:
Fonts may specify the optical edges of glyphs that can be used to make the edges of lines of text line up in a more visually pleasing way. This function returns bounding rects corresponding to this information if present in a font, otherwise it returns typographic bounding rects (composed of the font's ascent and descent and a glyph's advance width).

font: The font reference.
glyphs: An array of count number of glyphs.
boundingRects: An array of count number of CGRects to receive the computed glyph rects. Can be nil, in which case only the overall bounding rect is calculated.
options: Reserved, set to zero.

This function returns the overall bounding rectangle for an array or run of glyphs. The bounding rects of the individual glyphs are returned through the boundingRects parameter. These are the design metrics from the font transformed in font space.

See also:

Feedback, Comments & Corrections

CTFontMBS.PlatformFont(byref fontAttributes as CTFontDescriptorMBS) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns an ATS font reference and attributes.

Feedback, Comments & Corrections

CTFontMBS.SupportedLanguages as String()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns an array of languages supported by the font.
Example:
dim c as CTFontMBS = CTFontMBS.CreateWithName("Times", 12)
MsgBox Join(c.SupportedLanguages,EndOfLine)

Feedback, Comments & Corrections

CTFontMBS.Table(table as string, options as Integer) as Memoryblock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns a reference to the font table data.
Notes:
table: The font table identifier as a Font Table Tag Constants constant. See Font Table Tag Constants for possible values.
options: The font table options.

Returns a retained reference to the font table data as a Memoryblock.

Feedback, Comments & Corrections

CTFontMBS.VariationAxes as Dictionary()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns an array of variation axes.
Notes: An array of variation axes dictionaries. Each variation axis dictionary contains the five variation axis keys listed in Font Variation Axis Dictionary Keys.

Feedback, Comments & Corrections

CTFontMBS.VerticalTranslationsForGlyphs(glyphs() as Integer) as CGSizeMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreText MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Calculates the offset from the default (horizontal) origin to the vertical origin for an array of glyphs.
Notes:
glyphs: An array of count number of glyphs.
Returns the computed origin offsets in an array of count number of CGSizeMBS objects.

Feedback, Comments & Corrections

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

The biggest plugin in space...




Links
MBS FileMaker Plugins