Glyphs.app Python Scripting API Documentation¶
This is the documentation for the Python Scripting API for Glyphs.app (glyphsapp.com)
About this Document¶
This document covers all methods that are implemented in the Python wrapper. There are many more functions and objects available via the PyObjC bridge. For more details, please have a look at the Core part of the documentation.
Changes in the API¶
These changes could possibly break your code, so you need to keep track of them. Please see GSApplication
.versionNumber for how to check for the app version in your code. Really, read it. There’s a catch.
Major Changes in 2.3¶
-
*.bezierPath
We’ve created a distinct .bezierPath
attribute for various objects (paths, components, etc.) to use to draw in plug-ins, over-writing the previous (and never documented) .bezierPath() method (from the Python-ObjC-bridge) by the same name that handed down an NSBezierPath object.
Old: .bezierPath()
New: .bezierPath
GSApplication
¶
The mothership. Everything starts here.
print Glyphs
<Glyphs.app>
-
class
GSApplication
¶
Properties
font |
|
fonts |
|
reporters |
|
activeReporters |
|
defaults |
|
scriptAbbrevations |
|
scriptSuffixes |
|
languageScripts |
|
languageData |
|
unicodeRanges |
|
editViewWidth |
|
handleSize |
|
versionString |
|
versionNumber |
|
buildNumber |
Functions
Properties¶
-
font
¶ Returns: The active GSFont
object or None.Return type: GSFont
# topmost open font font = Glyphs.font
-
fonts
¶ Returns: All open Fonts
.Return type: list of GSFont
objects# access all open fonts for font in Glyphs.fonts: print font.familyName # add a font font = GSFont() font.familyName = "My New Fonts" Glyphs.fonts.append(font)
-
reporters
¶ New in version 2.3.
List of available reporter plug-ins (same as bottom section in the ‘View’ menu). These are the actual objects. You can get hold of their names using object.__class__.__name__.
Also see
GSApplication
.activateReporter() andGSApplication
.deactivateReporter() methods below to activate/deactivate them.# List of all reporter plug-ins print Glyphs.reporters # Individual plug-in class names for reporter in Glyphs.reporters: print reporter.__class__.__name__ # Activate a plugin Glyphs.activateReporter(Glyphs.reporters[0]) # by object Glyphs.activateReporter('GlyphsMasterCompatibility') # by class name
-
activeReporters
¶ New in version 2.3.
List of activated reporter plug-ins.
-
defaults
¶ A dict like object for storing preferences. You can get and set key-value pairs.
Please be careful with your keys. Use a prefix that uses the reverse domain name. e.g. “com.MyName.foo.bar”.
# Check for whether or not a preference exists, because has_key() doesn't work in this PyObjC-brigde if Glyphs.defaults["com.MyName.foo.bar"] == None: # do stuff # Get and set values value = Glyphs.defaults["com.MyName.foo.bar"] Glyphs.defaults["com.MyName.foo.bar"] = newValue # Remove value # This will restore the default value del(Glyphs.defaults["com.MyName.foo.bar"])
-
scriptAbbrevations
¶ A dictionary with script name to abbreviation mapping, e.g., ‘arabic’: ‘arab’
Return type: dict`
-
scriptSuffixes
¶ A dictionary with glyphs name suffixes for scripts and their respective script names, e.g., ‘cy’: ‘cyrillic’
Return type: dict`
-
languageScripts
¶ A dictionary with language tag to script tag mapping, e.g., ‘ENG’: ‘latn’
Return type: dict`
-
languageData
¶ A list of dictionaries with more detailed language informations.
Return type: list`
-
unicodeRanges
¶ Names of unicode ranges.
Return type: list`
-
editViewWidth
¶ New in version 2.3.
Width of glyph Edit view. Corresponds to the “Width of editor” setting from the Preferences.
Type: int
-
handleSize
¶ New in version 2.3.
Size of Bezier handles in Glyph Edit view. Possible value are 0–2. Corresponds to the “Handle size” setting from the Preferences.
To use the handle size for drawing in reporter plugins, you need to convert the handle size to a point size, and divide by the view’s scale factor. See example below.
# Calculate handle size handSizeInPoints = 5 + Glyphs.handleSize * 2.5 # (= 5.0 or 7.5 or 10.0) scaleCorrectedHandleSize = handSizeInPoints / Glyphs.font.currentTab.scale # Draw point in size of handles point = NSPoint(100, 100) NSColor.redColor.set() rect = NSRect((point.x - scaleCorrectedHandleSize * 0.5, point.y - scaleCorrectedHandleSize * 0.5 ), (scaleCorrectedHandleSize, scaleCorrectedHandleSize)) bezierPath = NSBezierPath.bezierPathWithOvalInRect_(rect) bezierPath.fill()
Type: int
-
versionString
¶ New in version 2.3.
String containing Glyph.app’s version number. May contain letters also, like ‘2.3b’. To check for a specific version, use .versionNumber below.
Type: string
-
versionNumber
¶ New in version 2.3.
Glyph.app’s version number. Use this to check for version in your code.
Here’s the catch: Since we only added this versionNumber attribute in Glyphs v2.3, it is not possible to use this attribute to check for versions of Glyphs older than 2.3. We’re deeply sorry for this inconvenience.
So you must first check for the existence of the versionNumber attribute like so:
# Code valid for Glyphs.app v2.3 and above: if hasattr(Glyphs, 'versionNumber') and Glyphs.versionNumber >= 2.3: # do stuff # Code for older versions else: # do other stuff
Type: float
-
buildNumber
¶ New in version 2.3.
Glyph.app’s build number.
Especially if you’re using preview builds, this number may be more important to you than the version number. The build number increases with every released build and is the most significant evidence of new Glyphs versions, while the version number is set arbitrarily and stays the same until the next stable release.
Type: int
Functions¶
-
open
(Path)¶ Opens a document
Parameters: - Path (str) – The path where the document is located.
- showInterface (bool) – If a document window should be opened
Returns: The opened document object or None.
Return type:
-
showMacroWindow
()¶ Opens the macro window
-
clearLog
()¶ Deletes the content of the console in the macro window
-
showGlyphInfoPanelWithSearchString
(String)¶ Shows the Glyph Info window with a preset search string
Parameters: String – The search term
-
glyphInfoForName
(String)¶ Generates
GSGlyphInfo
object for a given glyph name.Parameters: - String – Glyph name
- font – if you add a font, and the font has a local glyph info, it will be used instead of the global info data.
Returns:
-
glyphInfoForUnicode
(Unicode)¶ Generates
GSGlyphInfo
object for a given hex unicode.Parameters: - String – Hex unicode
- font – if you add a font, and the font has a local glyph info, it will be used instead of the global info data.
Returns:
-
niceGlyphName
(Name)¶ Converts glyph name to nice, human-readable glyph name (e.g. afii10017 or uni0410 to A-cy)
Parameters: - string – glyph name
- font – if you add a font, and the font has a local glyph info, it will be used instead of the global info data.
Returns: string
-
productionGlyphName
(Name)¶ Converts glyph name to production glyph name (e.g. afii10017 or A-cy to uni0410)
Parameters: - string – glyph name
- font – if you add a font, and the font has a local glyph info, it will be used instead of the global info data.
Returns: string
-
ligatureComponents
(String)¶ If defined as a ligature in the glyph database, this function returns a list of glyph names that this ligature could be composed of.
Parameters: - string – glyph name
- font – if you add a font, and the font has a local glyph info, it will be used instead of the global info data.
Returns: list
print Glyphs.ligatureComponents('allah-ar') ( "alef-ar", "lam-ar.init", "lam-ar.medi", "heh-ar.fina" )
-
addCallback
(function, hook)¶ New in version 2.3.
Add a user-defined function to the glyph window’s drawing operations, in the foreground and background for the active glyph as well as in the inactive glyphs.
The function names are used to add/remove the functions to the hooks, so make sure to use unique function names.
Your function needs to accept two values: layer which will contain the respective
GSLayer
object of the layer we’re dealing with and info which is a dictionary and contains the value Scale (for the moment).For the hooks use the three defined constants DRAWFOREGROUND, DRAWBACKGROUND, and DRAWINACTIVE.
def drawGlyphIntoBackground(layer, info): # Due to internal Glyphs.app structure, we need to catch and print exceptions # of these callback functions with try/except like so: try: # Your drawing code here NSColor.redColor().set() layer.bezierPath.fill() # Error. Print exception. except: import traceback print traceback.format_exc() # add your function to the hook Glyphs.addCallback(drawGlyphIntoBackground, DRAWBACKGROUND)
-
removeCallback
(function)¶ New in version 2.3.
Remove the function you’ve previously added.
# remove your function to the hook Glyphs.removeCallback(drawGlyphIntoBackground)
-
redraw
()¶ Redraws all Edit views and Preview views.
-
showNotification
(title, message)¶ Shows the user a notification in Mac’s Notification Center.
Glyphs.showNotification('Export fonts', 'The export of the fonts was successful.')
-
localize
(localization)¶ New in version 2.3.
Return a string in the language of Glyphs.app’s UI locale, which must be supplied as a dictionary using language codes as keys.
The argument is a dictionary in the languageCode: translatedString format.
You don’t need to supply strings in all languages that the Glyphs.app UI supports. A subset will do. Just make sure that you add at least an English string to default to next to all your other translated strings. Also don’t forget to mark strings as unicode strings (u’öäüß’) when they contain non-ASCII content for proper encoding, and add a # encoding: utf-8 to the top of all your .py files.
Tip: You can find Glyphs’ localized languages here Glyphs.defaults[“AppleLanguages”].
# encoding: utf-8 print Glyphs.localize({ 'en': 'Hello World', 'de': u'Hallöle Welt', 'fr': 'Bonjour tout le monde', 'es': 'Hola Mundo', }) # Given that your Mac’s system language is set to German # and Glyphs.app UI is set to use localization (change in preferences), # it will print: # Hallöle Welt
-
activateReporter
(reporter)¶ New in version 2.3.
Activate a reporter plug-in by its object (see Glyphs.reporters) or class name.
Glyphs.activateReporter('GlyphsMasterCompatibility')
-
deactivateReporter
(reporter)¶ New in version 2.3.
Deactivate a reporter plug-in by its object (see Glyphs.reporters) or class name.
Glyphs.deactivateReporter('GlyphsMasterCompatibility')
GSFont
¶
Implementation of the font object. This object is host to the Masters
used for interpolation. Even when no interpolation is involved, for the sake of object model consistency there will still be one master and one instance representing a single font.
Also, the Glyphs
are attached to the Font object right here, not one level down to the masters. The different masters’ glyphs are available as Layers
attached to the Glyph
objects which are attached here.
-
class
GSFont
¶
Properties
Functions
save() |
|
close() |
|
disableUpdateInterface() |
|
enableUpdateInterface() |
|
kerningForPair() |
|
setKerningForPair() |
|
removeKerningForPair() |
|
newTab() |
Properties¶
-
parent
¶ Returns the internal NSDocument document. Read-only.
Type: NSDocument
-
masters
¶ Collection of
GSFontMaster
objects.Type: list
-
instances
¶ Collection of
GSInstance
objects.Type: list
-
glyphs
¶ Collection of
GSGlyph
objects. Returns a list, but you may also call glyphs using index or glyph name as key.# Access all glyphs for glyph in font.glyphs: print glyph <GSGlyph "A" with 4 layers> <GSGlyph "B" with 4 layers> <GSGlyph "C" with 4 layers> ... # Access one glyph print font.glyphs['A'] <GSGlyph "A" with 4 layers> # Add a glyph font.glyphs.append(GSGlyph('adieresis')) # Duplicate a glyph under a different name newGlyph = font.glyphs['A'].copy() newGlyph.name = 'A.alt' font.glyphs.append(newGlyph) # Delete a glyph del(font.glyphs['A.alt'])
Type: list, dict
-
classes
¶ Collection of
GSClass
objects, representing OpenType glyph classes.Type: list # add a class font.classes.append(GSClass('uppercaseLetters', 'A B C D E')) # access all classes for class in font.classes: print class.name # access one class print font.classes['uppercaseLetters'].code # delete a class del(font.classes['uppercaseLetters'])
-
features
¶ Collection of
GSFeature
objects, representing OpenType features.Type: list # add a feature font.features.append(GSFeature('liga', 'sub f i by fi;')) # access all features for feature in font.features: print feature.code # access one feature print font.features['liga'].code # delete a feature del(font.features['liga'])
-
featurePrefixes
¶ Collection of
GSFeaturePrefix
objects, containing stuff that needs to be outside of the OpenType features.Type: list # add a prefix font.featurePrefixes.append(GSFeaturePrefix('LanguageSystems', 'languagesystem DFLT dflt;')) # access all prefixes for prefix in font.featurePrefixes: print prefix.code # access one prefix print font.featurePrefixes['LanguageSystems'].code # delete del(font.featurePrefixes['LanguageSystems'])
-
copyright
¶ Type: unicode
-
designer
¶ Type: unicode
-
designerURL
¶ Type: unicode
-
manufacturer
¶ Type: unicode
-
manufacturerURL
¶ Type: unicode
-
versionMajor
¶ Type: int
-
versionMinor
¶ Type: int
-
date
¶ Type: NSDate print font.date 2015-06-08 09:39:05 +0000 # set date to now font.date = NSDate.date()
-
familyName
¶ Family name of the typeface.
Type: unicode
-
upm
¶ Units per Em
Type: int
-
note
¶ Type: unicode
-
kerning
¶ A multi-level dictionary. The first level’s key is the
GSFontMaster
.id (each master has its own kerning), the second level’s key is theGSGlyph
.id or class id (@MMK_L_XX) of the first glyph, the third level’s key is a glyph id or class id (@MMK_R_XX) for the second glyph. The values are the actual kerning values.To set a value, it is better to use the method
GSFont
.setKerningForPair(). This ensures a better data integrity (and is faster).Type: dict
-
userData
¶ A dictionary to store user data. Use a unique key and only use objects that can be stored in a property list (string, list, dict, numbers, NSData) otherwise the data will not be recoverable from the saved file.
Type: dict # set value font.userData['rememberToMakeCoffee'] = True
-
disablesNiceNames
¶ Corresponds to the “Don’t use nice names” setting from the Font Info dialog.
Type: bool
-
customParameters
¶ The custom parameters. List of
GSCustomParameter
objects. You can access them by name or by index.# access all parameters for parameter in font.customParameters: print parameter # set a parameter font.customParameters['trademark'] = 'ThisFont is a trademark by MyFoundry.com' # delete a parameter del(font.customParameters['trademark'])
Type: list, dict
-
grid
¶ New in version 2.3.
Corresponds to the “Grid spacing” setting from the Info dialog.
Type: int
-
gridSubDivisions
¶ New in version 2.3.
Corresponds to the “Grid sub divisions” setting from the Info dialog.
Type: int
-
gridLength
¶ Ready calculated size of grid for rounding purposes. Result of division of grid with gridSubDivisions.
Type: float
-
selection
¶ New in version 2.3.
Returns a list of all selected glyphs in the Font View.
Type: list
-
selectedLayers
¶ Returns a list of all selected layers in the active tab.
If a glyph is being edited, it will be the only glyph returned in this list. Otherwise the list will contain all glyphs selected with the Text tool.
Type: list
-
selectedFontMaster
¶ Returns the active master (selected in the toolbar).
Type: GSFontMaster
-
masterIndex
¶ Returns the index of the active master (selected in the toolbar).
Type: int
-
currentText
¶ The text of the current Edit view.
Unencoded and none ASCII glyphs will use a slash and the glyph name. (e.g: /a.sc). Setting unicode strings works.
Type: unicode
-
tabs
¶ List of open Edit view tabs in UI, as list of
GSEditViewController
objects.# open new tab with text font.newTab('hello') # access all tabs for tab in font.tabs: print tab # close last tab font.tabs[-1].close()
Type: list
-
currentTab
¶ Active Edit view tab.
Type: GSEditViewController
-
filepath
¶ On-disk location of GSFont object.
Type: unicode
-
tool
¶ New in version 2.3.
Name of tool selected in toolbar.
For available names including third-party plug-ins that come in the form of selectable tools, see GSFont.tools below.
font.tool = 'SelectTool' # Built-in tool font.tool = 'GlyphsAppSpeedPunkTool' # Third party plug-in
Type: string
-
tools
¶ New in version 2.3.
Prints a list of available tool names, including third-party plug-ins.
Type: list, string
Functions¶
-
save
([filePath])¶ Saves the font. if no path is given, it saves to the existing location.
Parameters: filePath (str) – Optional file path
-
close
([ignoreChanges = False])¶ Closes the font.
Parameters: ignoreChanges (bool) – Optional. Ignore changes to the font upon closing
-
disableUpdateInterface
()¶ Disables interface updates and thus speeds up glyph processing. Call this before you do big changes to the font, or to its glyphs. Make sure that you call Font.enableUpdateInterface() when you are done.
-
enableUpdateInterface
()¶ This re-enables the interface update. Only makes sense to call if you have disabled it earlier.
-
kerningForPair
(FontMasterId, LeftKey, RightKey)¶ This returns the kerning value for the two specified glyphs (LeftKey or RightKey is the glyphname) or a kerning group key (@MMK_X_XX).
Parameters: - FontMasterId (str) – The id of the FontMaster
- LeftKey (str) – either a glyph name or a class name
- RightKey (str) – either a glyph name or a class name
Returns: The kerning value
Return type: float
# print kerning between w and e for currently selected master font.kerningForPair(font.selectedFontMaster.id, 'w', 'e') -15.0 # print kerning between group T and group A for currently selected master # ('L' = left side of the pair and 'R' = left side of the pair) font.kerningForPair(font.selectedFontMaster.id, '@MMK_L_T', '@MMK_R_A') -75.0 # in the same font, kerning between T and A would be zero, because they use group kerning instead. font.kerningForPair(font.selectedFontMaster.id, 'T', 'A') 9.22337203685e+18 # (this is the maximum number for 64 bit. It is used as an empty value)
-
setKerningForPair
(FontMasterId, LeftKey, RightKey, Value)¶ This sets the kerning for the two specified glyphs (LeftKey or RightKey is the glyphname) or a kerning group key (@MMK_X_XX).
Parameters: - FontMasterId (str) – The id of the FontMaster
- LeftKey (str) – either a glyph name or a class name
- RightKey (str) – either a glyph name or a class name
- Value (float) – kerning value
# set kerning for group T and group A for currently selected master # ('L' = left side of the pair and 'R' = left side of the pair) font.setKerningForPair(font.selectedFontMaster.id, '@MMK_L_T', '@MMK_R_A', -75)
-
removeKerningForPair
(FontMasterId, LeftKey, RightKey)¶ Removes the kerning for the two specified glyphs (LeftKey or RightKey is the glyphname) or a kerning group key (@MMK_X_XX).
Parameters: - FontMasterId (str) – The id of the FontMaster
- LeftKey (str) – either a glyph name or a class name
- RightKey (str) – either a glyph name or a class name
# remove kerning for group T and group A for all masters # ('L' = left side of the pair and 'R' = left side of the pair) for master in font.masters: font.removeKerningForPair(master.id, '@MMK_L_T', '@MMK_R_A')
-
newTab
([tabText])¶ Opens a new tab in the current document window, optionally with text
Parameters: tabText – Text or glyph names escaped with ‘/’
GSFontMaster
¶
Implementation of the master object. This corresponds with the “Masters” pane in the Font Info. In Glyphs.app, the glyphs of each master are reachable not here, but as Layers
attached to the Glyphs
attached to the Font
object. See the infographic on top for better understanding.
-
class
GSFontMaster
¶
Properties
Properties¶
-
id
¶ Used to identify
Layers
in the Glyphsee
GSGlyph.layers
# ID of first master print font.masters[0].id 3B85FBE0-2D2B-4203-8F3D-7112D42D745E # use this master to access the glyph's corresponding layer print glyph.layers[font.masters[0].id] <GSLayer "Light" (A)>
Type: unicode
-
name
¶ Name of the master. This usually is a combination of GSFontMaster.weight and GSFontMaster.width and is a human-readable identification of each master, e.g., “Bold Condensed”.
Type: string
-
weight
¶ Human-readable weight name, chosen from list in Font Info. For the position in the interpolation design space, use GSFontMaster.weightValue.
Type: string
-
width
¶ Human-readable width name, chosen from list in Font Info. For the position in the interpolation design space, use GSFontMaster.widthValue.
Type: string
-
weightValue
¶ Value for interpolation in design space.
Type: float
-
widthValue
¶ Value for interpolation in design space.
Type: float
-
customName
¶ The name of the custom interpolation dimension.
Type: string
-
customValue
¶ Value for interpolation in design space.
Type: float
-
ascender
¶ Type: float
-
capHeight
¶ Type: float
-
xHeight
¶ Type: float
-
descender
¶ Type: float
-
italicAngle
¶ Type: float
-
verticalStems
¶ The vertical stems. This is a list of numbers. For the time being, this can be set only as an entire list at once.
Type: list # Set stems font.masters[0].verticalStems = [10, 11, 20]
-
horizontalStems
¶ The horizontal stems. This is a list of numbers. For the time being, this can be set only as an entire list at once.
Type: list # Set stems font.masters[0].horizontalStems = [10, 11, 20]
-
alignmentZones
¶ Collection of
GSAlignmentZone
objects.Type: list
-
blueValues
¶ PS hinting Blue Values calculated from the master’s alignment zones. Read-only.
Type: list
-
otherBlues
¶ PS hinting Other Blues calculated from the master’s alignment zones. Read-only.
Type: list
-
guides
¶ Collection of
GSGuideLine
objects. These are the font-wide (actually master-wide) red guidelines. For glyph-level guidelines (attached to the layers) seeGSLayer
.guidesType: list
-
userData
A dictionary to store user data. Use a unique key, and only use objects that can be stored in a property list (bool, string, list, dict, numbers, NSData), otherwise the data will not be recoverable from the saved file.
Type: dict # set value font.masters[0].userData['rememberToMakeTea'] = True
-
customParameters
The custom parameters. List of
GSCustomParameter
objects. You can access them by name or by index.# access all parameters for parameter in font.masters[0].customParameters: print parameter # set a parameter font.masters[0].customParameters['underlinePosition'] = -135 # delete a parameter del(font.masters[0].customParameters['underlinePosition'])
Type: list, dict
GSAlignmentZone
¶
Implementation of the alignmentZone object.
There is no distinction between Blue Zones and Other Zones. All negative zones (except the one with position 0) will be exported as Other Zones.
The zone for the baseline should have position 0 (zero) and a negative width.
-
class
GSAlignmentZone
([pos, size])¶ Parameters: - pos – The position of the zone
- size – The size of the zone
Properties
position |
|
size |
GSInstance
¶
Implementation of the instance object. This corresponds with the “Instances” pane in the Font Info.
-
class
GSInstance
¶
Properties
Functions
generate() |
Properties¶
-
active
¶ Type: bool
-
name
Name of instance. Corresponds to the “Style Name” field in the font info. This is used for naming the exported fonts.
Type: string
-
weight
Human-readable weight name, chosen from list in Font Info. For actual position in interpolation design space, use GSInstance.weightValue.
Type: string
-
width
Human-readable width name, chosen from list in Font Info. For actual position in interpolation design space, use GSInstance.widthValue.
Type: string
-
weightValue
Value for interpolation in design space.
Type: float
-
widthValue
Value for interpolation in design space.
Type: float
-
customValue
Value for interpolation in design space.
Type: float
-
isItalic
¶ Italic flag for style linking
Type: bool
-
isBold
¶ Bold flag for style linking
Type: bool
-
linkStyle
¶ Linked style
Type: string
-
familyName
familyName
Type: string
-
preferredFamily
¶ preferredFamily
Type: string
-
preferredSubfamilyName
¶ preferredSubfamilyName
Type: string
-
windowsFamily
¶ windowsFamily
Type: string
-
windowsStyle
¶ windowsStyle This is computed from “isBold” and “isItalic”. Read-only.
Type: string
-
windowsLinkedToStyle
¶ windowsLinkedToStyle. Read-only.
Type: string
-
fontName
¶ fontName (postscriptFontName)
Type: string
-
fullName
¶ fullName (postscriptFullName)
Type: string
-
customParameters
The custom parameters. List of
GSCustomParameter
objects. You can access them by name or by index.# access all parameters for parameter in font.instances[0].customParameters: print parameter # set a parameter font.instances[0].customParameters['hheaLineGap'] = 10 # delete a parameter del(font.instances[0].customParameters['hheaLineGap'])
Type: list, dict
-
instanceInterpolations
¶ A dict that contains the interpolation coefficients for each master. This is automatically updated if you change interpolationWeight, interpolationWidth, interpolationCustom. It contains FontMaster IDs as keys and coefficients for that master as values. Or, you can set it manually if you set manualInterpolation to True. There is no UI for this, so you need to do that with a script.
Type: dict
-
manualInterpolation
¶ Disables automatic calculation of instanceInterpolations This allowes manual setting of instanceInterpolations.
Type: bool
-
interpolatedFont
¶ New in version 2.3.
Returns a ready interpolated
GSFont
object representing this instance. Other than the source object, this interpolated font will contain only one master and one instance.Note: When accessing several properties of such an instance consecutively, it is advisable to create the instance once into a variable and then use that. Otherwise, the instance object will be completely interpolated upon each access. See sample below.
# create instance once interpolated = Glyphs.font.instances[0].interpolatedFont # then access it several times print interpolated.masters print interpolated.instances (<GSFontMaster "Light" width 100.0 weight 75.0>) (<GSInstance "Web" width 100.0 weight 75.0>)
Type: GSFont
Functions¶
-
generate
([Format, FontPath, AutoHint, RemoveOverlap, UseSubroutines, UseProductionNames])¶ Exports the instance. All parameters are optional.
Parameters: - Format (str) – ‘OTF’ or ‘TTF’. Default: ‘OTF’
- FontPath (str) – The destination path for the final fonts. If None, it uses the default location set in the export dialog
- AutoHint (bool) – If autohinting should be applied. Default: True
- RemoveOverlap (bool) – If overlaps should be removed. Default: True
- UseSubroutines (bool) – If to use subroutines for CFF. Default: True
- UseProductionNames (bool) – If to use production names. Default: True
Returns: On success, True, on failure error message.
Return type: bool/list
# export all instances as OpenType (.otf) to user's font folder exportFolder = '/Users/myself/Library/Fonts' for instance in Glyphs.font.instances: instance.generate(FontPath = exportFolder) Glyphs.showNotification('Export fonts', 'The export of %s was successful.' % (Glyphs.font.familyName))
GSCustomParameter
¶
Implementation of the Custom Parameter object. It stores a name/value pair.
You can append GSCustomParameter objects for example to GSFont.customParameters, but this way you may end up with duplicates. It is best to access the custom parameters through its dictionary interface like this:
# access all parameters
for parameter in font.customParameters:
print parameter
# set a parameter
font.customParameters['trademark'] = 'ThisFont is a trademark by MyFoundry.com'
# delete a parameter
del(font.customParameters['trademark'])
-
class
GSCustomParameter
([name, value])¶ Parameters: - name – The name
- size – The value
Properties
name |
|
value |
GSClass
¶
Implementation of the class object. It is used to store OpenType classes.
For details on how to access them, please look at GSFont
.classes
-
class
GSClass
([tag, code])¶ Parameters: - tag – The class name
- code – A list of glyph names, separated by space or newline
Properties
name |
|
code |
Utilities needed to emulate Python’s interactive interpreter. |
automatic |
GSFeaturePrefix
¶
Implementation of the featurePrefix object. It is used to store things that need to be outside of a feature like standalone lookups.
For details on how to access them, please look at GSFont
.featurePrefixes
-
class
GSFeaturePrefix
([tag, code])¶ Parameters: - tag – The Prefix name
- code – The feature code in Adobe FDK syntax
Properties
name |
|
code |
Utilities needed to emulate Python’s interactive interpreter. |
automatic |
Properties¶
-
name
The FeaturePrefix name
Type: unicode
-
code
A String containing feature code.
Type: unicode
-
automatic
Define whether this should be auto-generated when pressing the ‘Update’ button in the Font Ínfo.
Type: bool
GSFeature
¶
Implementation of the feature object. It is used to implement OpenType Features in the Font Info.
For details on how to access them, please look at GSFont
.features
-
class
GSFeature
([tag, code])¶ Parameters: - tag – The feature name
- code – The feature code in Adobe FDK syntax
Properties
name |
|
code |
Utilities needed to emulate Python’s interactive interpreter. |
automatic |
|
notes |
Functions
update() |
Properties¶
-
name
The feature name
Type: unicode
-
code
The Feature code in Adobe FDK syntax.
Type: unicode
-
automatic
Define whether this feature should be auto-generated when pressing the ‘Update’ button in the Font Ínfo.
Type: bool
-
notes
¶ Some extra text. Is shown in the bottom of the feature window. Contains the stylistic set name parameter
Type: unicode
Functions¶
-
update
()¶ Calls the automatic feature code generator for this feature. You can use this to update all OpenType features before export.
Returns: None
# first update all features
for feature in font.features:
if feature.automatic:
feature.update()
# then export fonts
for instance in font.instances:
if instance.active:
instance.generate()
GSGlyph
¶
Implementation of the glyph object.
For details on how to access these glyphs, please see GSFont
.glyphs
-
class
GSGlyph
([name])¶ Parameters: name – The glyph name
Properties
parent |
|
layers |
|
name |
|
unicode |
|
string |
A collection of string operations (most are no longer used). |
id |
|
category |
|
subCategory |
|
script |
|
glyphInfo |
|
leftKerningGroup |
|
rightKerningGroup |
|
leftMetricsKey |
|
rightMetricsKey |
|
widthMetricsKey |
|
export |
|
color |
|
colorObject |
|
note |
|
selected |
|
mastersCompatible |
|
userData |
|
smartComponentAxes |
|
lastChange |
Functions
beginUndo() |
|
endUndo() |
|
updateGlyphInfo() |
|
duplicate() |
Properties¶
-
layers
¶ The layers of the glyph, collection of
GSLayer
objects. You can access them either by index or by layer ID, which can be aGSFontMaster.id
. The layer IDs are usually a unique string chosen by Glyphs.app and not set manually. They may look like this: 3B85FBE0-2D2B-4203-8F3D-7112D42D745EType: list, dict # get active layer layer = font.selectedLayers[0] # get glyph of this layer glyph = layer.parent # access all layers of this glyph for layer in glyph.layers: print layer.name # access layer of currently selected master of active glyph ... # (also use this to access a specific layer of glyphs selected in the Font View) layer = glyph.layers[font.selectedFontMaster.id] # ... which is exactly the same as: layer = font.selectedLayers[0] # directly access 'Bold' layer of active glyph for master in font.masters: if master.name == 'Bold': id = master.id break layer = glyph.layers[id] # add a new layer newLayer = GSLayer() newLayer.name = '{125, 100}' # (example for glyph-level intermediate master) # you may set the master ID that this layer will be associated with, otherwise the first master will be used newLayer.associatedMasterId = font.masters[-1].id # attach to last master font.glyphs['a'].layers.append(newLayer) # duplicate a layer under a different name newLayer = font.glyphs['a'].layers[0].copy() newLayer.name = 'Copy of layer' # FYI, this will still be the old layer ID (in case of duplicating) at this point print newLayer.layerId font.glyphs['a'].layers.append(newLayer) # FYI, the layer will have been assigned a new layer ID by now, after having been appended print newLayer.layerId # replace the second master layer with another layer newLayer = GSLayer() newLayer.layerId = font.masters[1].id # Make sure to sync the master layer ID font.glyphs['a'].layers[font.masters[1].id] = newLayer # delete last layer of glyph # (Also works for master layers. They will be emptied) del(font.glyphs['a'].layers[-1]) # delete currently active layer del(font.glyphs['a'].layers[font.selectedLayers[0].layerId])
-
name
The name of the glyph. It will be converted to a “nice name” (afii10017 to A-cy) (you can disable this behavior in font info or the app preference)
Type: unicode
-
unicode
¶ String with the hex Unicode value of glyph, if encoded.
Type: unicode
-
string
¶ String representation of glyph, if encoded. This is similar to the string representation that you get when copying glyphs into the clipboard.
Type: unicode
-
id
An unique identifier for each glyph
Type: string
-
category
¶ The category of the glyph. e.g. ‘Letter’, ‘Symbol’ Setting only works if storeCategory is set (see below).
Type: unicode
-
storeCategory
¶ Set to True in order to manipulate the category of the glyph (see above). Makes it possible to ship custom glyph data inside a .glyphs file without a separate GlyphData file. Same as Cmd-Alt-i dialog in UI.
Type: bool
-
subCategory
¶ The subCategory of the glyph. e.g. ‘Uppercase’, ‘Math’ Setting only works if storeSubCategory is set (see below).
Type: unicode
-
storeSubCategory
¶ Set to True in order to manipulate the subCategory of the glyph (see above). Makes it possible to ship custom glyph data inside a .glyphs file without a separate GlyphData file. Same as Cmd-Alt-i dialog in UI.
Type: bool New in version 2.3.
-
script
¶ The script of the glyph, e.g., ‘latin’, ‘arabic’. Setting only works if storeScript is set (see below).
Type: unicode
-
storeScript
¶ Set to True in order to manipulate the script of the glyph (see above). Makes it possible to ship custom glyph data inside a .glyphs file without a separate GlyphData file. Same as Cmd-Alt-i dialog in UI.
Type: bool New in version 2.3.
-
productionName
¶ The productionName of the glyph. Setting only works if storeProductionName is set (see below).
Type: unicode New in version 2.3.
-
storeProductionName
¶ Set to True in order to manipulate the productionName of the glyph (see above). Makes it possible to ship custom glyph data inside a .glyphs file without a separate GlyphData file. Same as Cmd-Alt-i dialog in UI.
Type: bool New in version 2.3.
-
glyphInfo
¶ GSGlyphInfo
object for this glyph with detailed information.Type: GSGlyphInfo
-
leftKerningGroup
¶ The leftKerningGroup of the glyph. All glyphs with the same text in the kerning group end up in the same kerning class.
Type: unicode
-
rightKerningGroup
¶ The rightKerningGroup of the glyph. All glyphs with the same text in the kerning group end up in the same kerning class.
Type: unicode
-
leftMetricsKey
¶ The leftMetricsKey of the glyph. This is a reference to another glyph by name or formula. It is used to synchronize the metrics with the linked glyph.
Type: unicode
-
rightMetricsKey
¶ The rightMetricsKey of the glyph. This is a reference to another glyph by name or formula. It is used to synchronize the metrics with the linked glyph.
Type: unicode
-
widthMetricsKey
¶ The widthMetricsKey of the glyph. This is a reference to another glyph by name or formula. It is used to synchronize the metrics with the linked glyph.
Type: unicode
-
export
¶ Defines whether glyph will export upon font generation
Type: bool
-
color
¶ Color marking of glyph in UI
Type: int glyph.color = 0 # red glyph.color = 1 # orange glyph.color = 2 # brown glyph.color = 3 # yellow glyph.color = 4 # light green glyph.color = 5 # dark green glyph.color = 6 # light blue glyph.color = 7 # dark blue glyph.color = 8 # purple glyph.color = 9 # magenta glyph.color = 10 # light gray glyph.color = 11 # charcoal glyph.color =<PHONE_NUMBER>854775807 # not colored, white
-
colorObject
¶ New in version 2.3.
NSColor object of glyph color, useful for drawing in plugins.
Type: NSColor # Set Color glyph.colorObject.set() # Get RGB (and alpha) values (as float numbers 0..1, multiply with 256 if necessary) R, G, B, A = glyph.colorObject.colorUsingColorSpace_(NSColorSpace.genericRGBColorSpace()).getRed_green_blue_alpha_(None, None, None, None) print R, G, B 0.617805719376 0.958198726177 0.309286683798 print round(R * 256), int(G * 256), int(B * 256) 158 245 245 # Draw layer glyph.layers[0].bezierPath.fill()
-
note
Type: unicode
-
selected
¶ Return True if the Glyph is selected in the Font View. This is different to the property font.selectedLayers which returns the selection from the active tab.
Type: bool # access all selected glyphs in the Font View for glyph in font.glyphs: if glyph.selected: print glyph
-
mastersCompatible
¶ New in version 2.3.
Return True when all layers in this glyph are compatible (same components, anchors, paths etc.)
Type: bool
-
userData
New in version 2.3.
A dictionary to store user data. Use a unique key and only use objects that can be stored in a property list (string, list, dict, numbers, NSData) otherwise the data will not be recoverable from the saved file.
Type: dict # set value glyph.userData['rememberToMakeCoffee'] = True
-
smartComponentAxes
¶ New in version 2.3.
A list of
GSSmartComponentAxis
objects.These are the axis definitions for the interpolations that take place within the Smart Components. Corresponds to the ‘Properties’ tab of the glyph’s ‘Show Smart Glyph Settings’ dialog.
Also see https://glyphsapp.com/tutorials/smart-components for reference.
Type: list # Adding two interpolation axes to the glyph axis1 = GSSmartComponentAxis() axis1.name = 'crotchDepth' axis1.topValue = 0 axis1.bottomValue = -100 g.smartComponentAxes.append(axis1) axis2 = GSSmartComponentAxis() axis2.name = 'shoulderWidth' axis2.topValue = 100 axis2.bottomValue = 0 g.smartComponentAxes.append(axis2) # Deleting one axis del g.smartComponentAxes[1]
-
lastChange
¶ New in version 2.3.
Change date when glyph was last changed as UNIX timestamp.
Check Python’s time module for how to use the timestamp.
Functions¶
-
beginUndo
()¶ Call this before you do a longer running change to the glyph. Be extra careful to call Glyph.endUndo() when you are finished.
-
endUndo
()¶ This closes a undo group that was opened by a previous call of Glyph.beginUndo(). Make sure that you call this for each beginUndo() call.
-
updateGlyphInfo
(changeName = True)¶ Updates all information like name, unicode etc. for this glyph.
-
duplicate
([name])¶ Duplicate the glyph under a new name and return it.
If no name is given, .00n will be appended to it.
GSLayer
¶
Implementation of the layer object.
For details on how to access these layers, please see GSGlyph
.layers
-
class
GSLayer
¶
Properties
Functions
Properties¶
-
name
Name of layer
Type: unicode
-
associatedMasterId
¶ The ID of the
FontMaster
this layer belongs to, in case this isn’t a master layer. Every layer that isn’t a master layer needs to be attached to one master layer.Type: unicode # add a new layer newLayer = GSLayer() newLayer.name = '{125, 100}' # (example for glyph-level intermediate master) # you may set the master ID that this layer will be associated with, otherwise the first master will be used newLayer.associatedMasterId = font.masters[-1].id # attach to last master font.glyphs['a'].layers.append(newLayer)
-
layerId
¶ The unique layer ID is used to access the layer in the
glyphs
layer dictionary.For master layers this should be the id of the
FontMaster
. It could look like this: “FBCA074D-FCF3-427E-A700-7E318A949AE5”Type: unicode # see ID of active layer id = font.selectedLayers[0].layerId print id FBCA074D-FCF3-427E-A700-7E318A949AE5 # access a layer by this ID layer = font.glyphs['a'].layers[id] layer = font.glyphs['a'].layers['FBCA074D-FCF3-427E-A700-7E318A949AE5'] # for master layers, use ID of masters layer = font.glyphs['a'].layers[font.masters[0].id]
-
color
Color marking of glyph in UI
Type: int glyph.color = 0 # red glyph.color = 1 # orange glyph.color = 2 # brown glyph.color = 3 # yellow glyph.color = 4 # light green glyph.color = 5 # dark green glyph.color = 6 # light blue glyph.color = 7 # dark blue glyph.color = 8 # purple glyph.color = 9 # magenta glyph.color = 10 # light gray glyph.color = 11 # charcoal glyph.color =<PHONE_NUMBER>854775807 # not colored, white
-
colorObject
New in version 2.3.
NSColor object of layer color, useful for drawing in plugins.
Type: NSColor # Set Color layer.colorObject.set() # Get RGB (and alpha) values (as float numbers 0..1, multiply with 256 if necessary) R, G, B, A = layer.colorObject.colorUsingColorSpace_(NSColorSpace.genericRGBColorSpace()).getRed_green_blue_alpha_(None, None, None, None) print R, G, B 0.617805719376 0.958198726177 0.309286683798 print round(R * 256), int(G * 256), int(B * 256) 158 245 245 # Draw layer layer.bezierPath.fill()
-
components
¶ Collection of
GSComponent
objectsType: list layer = Glyphs.font.selectedLayers[0] # current layer # add component layer.components.append(GSComponent('dieresis')) # add component at specific position layer.components.append(GSComponent('dieresis', NSPoint(100, 100))) # delete specific component for i, component in enumerate(layer.components): if component.componentName == 'dieresis': del(layer.components[i]) break
-
guides
List of
GSGuideLine
objects.Type: list layer = Glyphs.font.selectedLayers[0] # current layer # access all guides for guide in layer.guides: print guide # add guideline newGuide = GSGuideLine() newGuide.position = NSPoint(100, 100) newGuide.angle = -10.0 layer.guides.append(newGuide) # delete guide del(layer.guides[0])
-
annotations
¶ List of
GSAnnotation
objects.Type: list layer = Glyphs.font.selectedLayers[0] # current layer # access all annotations for annotation in layer.annotations: print annotation # add new annotation newAnnotation = GSAnnotation() newAnnotation.type = TEXT newAnnotation.text = 'Fuck, this curve is ugly!' layer.annotations.append(newAnnotation) # delete annotation del(layer.annotations[0])
-
hints
¶ List of
GSHint
objects.Type: list layer = Glyphs.font.selectedLayers[0] # current layer # access all hints for hint in layer.hints: print hint # add a new hint newHint = GSHint() # change behaviour of hint here, like its attachment nodes layer.hints.append(newHint) # delete hint del(layer.hints[0])
-
anchors
¶ List of
GSAnchor
objects.Type: list, dict layer = Glyphs.font.selectedLayers[0] # current layer # access all anchors: for a in layer.anchors: print a # add a new anchor layer.anchors['top'] = GSAnchor() # delete anchor del(layer.anchors['top'])
-
paths
¶ List of
GSPath
objects.Type: list # access all paths for path in layer.paths: print path # delete path del(layer.paths[0])
-
selection
List of all selected objects in the glyph. Read-only.
This list contains all selected items, including nodes, anchors, guidelines etc. If you want to work specifically with nodes, for instance, you may want to cycle through the nodes (or anchors etc.) and check whether they are selected. See example below.
# access all selected nodes for path in layer.paths: for node in path.nodes: # (or path.anchors etc.) print node.selected # clear selection layer.clearSelection()
Type: list
-
LSB
¶ Left sidebearing
Type: float
-
RSB
¶ Right sidebearing
Type: float
-
TSB
¶ Top sidebearing
Type: float
-
BSB
¶ Bottom sidebearing
Type: float
-
width
Glyph width
Type: float
-
leftMetricsKey
The leftMetricsKey of the layer. This is a reference to another glyph by name or formula. It is used to synchronize the metrics with the linked glyph.
Type: unicode
-
rightMetricsKey
The rightMetricsKey of the layer. This is a reference to another glyph by name or formula. It is used to synchronize the metrics with the linked glyph.
Type: unicode
-
widthMetricsKey
The widthMetricsKey of the layer. This is a reference to another glyph by name or formula. It is used to synchronize the metrics with the linked glyph.
Type: unicode
-
bounds
¶ Bounding box of whole glyph as NSRect. Read-only.
Type: NSRect layer = Glyphs.font.selectedLayers[0] # current layer # origin print layer.bounds.origin.x, layer.bounds.origin.y # size print layer.bounds.size.width, layer.bounds.size.height
-
selectionBounds
¶ Bounding box of the layer’s selection (nodes, anchors, components etc). Read-only.
Type: NSRect
-
backgroundImage
¶ The background image. It will be scaled so that 1 em unit equals 1 of the image’s pixels.
Type: GSBackgroundImage
# set background image layer.backgroundImage = GSBackgroundImage('/path/to/file.jpg') # remove background image layer.backgroundImage = None
-
bezierPath
¶ New in version 2.3.
The layer as an NSBezierPath object. Useful for drawing glyphs in plugins.
# draw the path into the Edit view NSColor.redColor().set() layer.bezierPath.fill()
Type: NSBezierPath
-
openBezierPath
¶ New in version 2.3.
All open paths of the layer as an NSBezierPath object. Useful for drawing glyphs in plugins.
# draw the path into the Edit view NSColor.redColor().set() layer.openBezierPath.stroke()
Type: NSBezierPath
-
userData
New in version 2.3.
A dictionary to store user data. Use a unique key and only use objects that can be stored in a property list (string, list, dict, numbers, NSData) otherwise the data will not be recoverable from the saved file.
Type: dict # set value layer.userData['rememberToMakeCoffee'] = True
-
smartComponentPoleMapping
¶ New in version 2.3.
Maps this layer to the poles on the interpolation axes of the Smart Glyph. The dictionary keys are the names of the
GSSmartComponentAxis
objects. The values are 1 for bottom pole and 2 for top pole. Corresponds to the ‘Layers’ tab of the glyph’s ‘Show Smart Glyph Settings’ dialog.Also see https://glyphsapp.com/tutorials/smart-components for reference.
Type: dict, int # Map layers to top and bottom poles: for layer in glyph.layers: # Regular layer if layer.name == 'Regular': layer.smartComponentPoleMapping['crotchDepth'] = 2 layer.smartComponentPoleMapping['shoulderWidth'] = 2 # NarrowShoulder layer elif layer.name == 'NarrowShoulder': layer.smartComponentPoleMapping['crotchDepth'] = 2 layer.smartComponentPoleMapping['shoulderWidth'] = 1 # LowCrotch layer elif layer.name == 'LowCrotch': layer.smartComponentPoleMapping['crotchDepth'] = 1 layer.smartComponentPoleMapping['shoulderWidth'] = 2
Functions¶
-
decomposeComponents
()¶ Decomposes all components of the layer at once.
-
compareString
()¶ Returns a string representing the outline structure of the glyph, for compatibility comparison.
Returns: The comparison string Return type: string layer = Glyphs.font.selectedLayers[0] # current layer print layer.compareString() oocoocoocoocooc_oocoocoocloocoocoocoocoocoocoocoocooc_
-
connectAllOpenPaths
()¶ Closes all open paths when end points are further than 1 unit away from each other.
-
copyDecomposedLayer
()¶ Returns a copy of the layer with all components decomposed.
Returns: A new layer object Return type: GSLayer
-
syncMetrics
()¶ Take over LSB and RSB from linked glyph.
# sync metrics of all layers of this glyph for layer in glyph.layers: layer.syncMetrics()
-
correctPathDirection
()¶ Corrects the path direction.
-
removeOverlap
()¶ Joins all contours.
-
roundCoordinates
()¶ New in version 2.3.
Round the positions of all coordinates to the grid (size of which is set in the Font Info).
-
addNodesAtExtremes
()¶ New in version 2.3.
Add nodes at layer’s extrema, e.g., top, bottom etc.
-
applyTransform
()¶ Apply a transformation matrix to the layer.
layer = Glyphs.font.selectedLayers[0] # current layer layer.applyTransform([ 0.5, # x scale factor 0.0, # x skew factor 0.0, # y skew factor 0.5, # y scale factor 0.0, # x position 0.0 # y position ])
-
beginChanges
()¶ Call this before you do bigger changes to the Layer. This will increase performance and prevent undo problems. Always call layer.endChanges() if you are finished.
-
endChanges
()¶ Call this if you have called layer.beginChanges before. Make sure to group bot calls properly.
-
cutBetweenPoints
(Point1, Point2)¶ Cuts all paths that intersect the line from Point1 to Point2
Parameters: - Point1 – one point
- Point2 – the other point
layer = Glyphs.font.selectedLayers[0] # current layer # cut glyph in half horizontally at y=100 layer.cutBetweenPoints(NSPoint(0, 100), NSPoint(layer.width, 100))
-
intersectionsBetweenPoints
(Point1, Point2, components = False)¶ Return all intersection points between a measurement line and the paths in the layer. This is basically identical to the measurement tool in the UI.
Normally, the first returned point is the starting point, the last returned point is the end point. Thus, the second point is the first intersection, the second last point is the last intersection.
Parameters: - Point1 – one point
- Point2 – the other point
- components – if components should be measured. Default: False
layer = Glyphs.font.selectedLayers[0] # current layer # show all intersections with glyph at y=100 intersections = layer.intersectionsBetweenPoints((-1000, 100), (layer.width+1000, 100)) print intersections # left sidebearing at measurement line print intersections[1].x # right sidebearing at measurement line print layer.width - intersections[-2].x
-
addMissingAnchors
()¶ Adds missing anchors defined in the glyph database.
-
clearSelection
()¶ New in version 2.3.
Unselect all selected items in this layer.
-
clear
()¶ New in version 2.3.
Remove all elements from layer.
-
swapForegroundWithBackground
()¶ New in version 2.3.
Swap Foreground layer with Background layer.
-
reinterpolate
()¶ New in version 2.3.
Re-interpolate a layer according the other layers and its interpolation values.
Applies to both master layers as well as brace layers and is equivalent to the ‘Re-Interpolate’ command from the Layers palette.
GSAnchor
¶
Implementation of the anchor object.
For details on how to access them, please see GSLayer
.anchors
-
class
GSAnchor
([name, pt])¶ Parameters: - name – the name of the anchor
- pt – the position of the anchor
Properties
position |
|
name |
|
selected |
Properties¶
-
position
The position of the anchor
Type: NSPoint # read position print layer.anchors['top'].position.x, layer.anchors['top'].position.y # set position layer.anchors['top'].position = NSPoint(175, 575) # increase vertical position by 50 units layer.anchors['top'].position = NSPoint(layer.anchors['top'].position.x, layer.anchors['top'].position.y + 50)
-
name
The name of the anchor
Type: unicode
-
selected
Selection state of anchor in UI.
# select anchor layer.anchors[0].selected = True # print selection state print layer.anchors[0].selected
Type: bool
GSComponent
¶
Implementation of the component object.
For details on how to access them, please see GSLayer
.components
-
class
GSComponent
(glyph[, position])¶ Parameters: - glyph – a
GSGlyph
object or the glyph name - position – the position of the component as NSPoint
- glyph – a
Properties
position |
|
componentName |
|
component |
|
layer |
|
transform |
|
bounds |
|
automaticAlignment |
|
anchor |
|
selected |
|
smartComponentValues |
|
bezierPath |
Functions
decompose() |
|
applyTransform() |
Properties¶
-
position
The Position of the component.
Type: NSPoint
-
scale
¶ Scale factor of image.
A scale factor of 1.0 (100%) means that 1 em unit equals 1 of the image’s pixels.
This sets the scale factor for x and y scale simultaneously. For separate scale factors, please use the transformation matrix.
Type: float or tuple
-
rotation
¶ Rotation angle of component.
Type: float
-
componentName
¶ The glyph name the component is pointing to.
Type: unicode
-
component
¶ The
GSGlyph
the component is pointing to. This is read-only. In order to change the referenced base glyph, setGSComponent
.componentName to the new glyph name.Type: GSGlyph
-
layer
¶ New in version 2.3.
The
GSLayer
the component is pointing to. This is read-only. In order to change the referenced base glyph, setGSComponent
.componentName to the new glyph name.Type: GSLayer
-
transform
¶ Transformation matrix of the component.
component = layer.components[0] component.transform = (( 0.5, # x scale factor 0.0, # x skew factor 0.0, # y skew factor 0.5, # y scale factor 0.0, # x position 0.0 # y position ))
Type: NSAffineTransformStruct
-
bounds
Bounding box of the component, read-only
Type: NSRect component = layer.components[0] # first component # origin print component.bounds.origin.x, component.bounds.origin.y # size print component.bounds.size.width, component.bounds.size.height
-
automaticAlignment
¶ Defines whether the component is automatically aligned.
Type: bool
-
anchor
¶ If more than one anchor/_anchor pair would match, this property can be used to set the anchor to use for automatic alignment
This can be set from the anchor button in the component info box in the UI
Type: unicode
-
selected
Selection state of component in UI.
# select component layer.components[0].selected = True # print selection state print layer.components[0].selected
Type: bool
-
smartComponentValues
¶ New in version 2.3.
Dictionary of interpolations values of the Smart Component. Key are the names, values are between the top and the bottom value of the corresponding
GSSmartComponentAxis
objects. Corresponds to the values of the ‘Smart Component Settings’ dialog. Returns None if the component is not a Smart Component.Also see https://glyphsapp.com/tutorials/smart-components for reference.
Type: dict, int # Narrow shoulders of m glyph = font.glyphs['m'] glyph.layers[0].components[1].smartComponentValues['shoulderWidth'] = 30 # First shoulder. Index is 1, given that the stem is also a component with index 0 glyph.layers[0].components[2].smartComponentValues['shoulderWidth'] = 30 # Second shoulder. Index is 2, given that the stem is also a component with index 0 # Low crotch of h glyph = font.glyphs['h'] glyph.layers[0].components[1].smartComponentValues['crotchDepth'] = -77 # Shoulder. Index is 1, given that the stem is also a component with index 0 # Check whether a component is a smart component for component in layer.components: if component.smartComponentValues != None: # do stuff
-
bezierPath
New in version 2.3.
The component as an NSBezierPath object. Useful for drawing glyphs in plugins.
# draw the path into the Edit view NSColor.redColor().set() layer.components[0].bezierPath.fill()
Type: NSBezierPath
GSSmartComponentAxis
¶
Implementation of the Smart Component interpolation axis object.
For details on how to access them, please see GSGlyph
.smartComponentAxes
New in version 2.3.
-
class
GSSmartComponentAxis
¶
Properties
name |
|
topValue |
|
bottomValue |
Properties¶
-
name
Name of the axis. This name will be used to map the Smart Glyph’s layers to the poles of the interpolation. See
GSLayer
.smartComponentPoleMappingType: str
-
topValue
¶ Top end (pole) value on interpolation axis.
Type: int, float
-
bottomValue
¶ Bottom end (pole) value on interpolation axis.
Type: int, float
GSPath
¶
Implementation of the path object.
For details on how to access them, please see GSLayer
.paths
If you build a path in code, make sure that the structure is valid. A curve node has to be preceded by two off-curve nodes. And an open path has to start with a line node.
-
class
GSPath
¶
Properties
parent |
|
nodes |
|
segments |
|
closed |
|
direction |
|
bounds |
|
selected |
|
bezierPath |
Functions
reverse() |
|
addNodesAtExtremes() |
|
applyTransform() |
Properties¶
-
nodes
¶ A list of
GSNode
objectsType: list # access all nodes for path in layer.paths: for node in path.nodes: print node
-
segments
¶ A list of segments as NSPoint objects. Two objects represent a line, four represent a curve. Start point of the segment is included.
Type: list # access all segments for path in layer.paths: for segment in path.segments: print segment
-
closed
¶ Returns True if the the path is closed
Type: bool
-
direction
¶ Path direction. -1 for counter clockwise, 1 for clockwise.
Type: int
-
bounds
Bounding box of the path, read-only
Type: NSRect path = layer.paths[0] # first path # origin print path.bounds.origin.x, path.bounds.origin.y # size print path.bounds.size.width, path.bounds.size.height
-
selected
Selection state of path in UI.
# select path layer.paths[0].selected = True # print selection state print layer.paths[0].selected
Type: bool
-
bezierPath
New in version 2.3.
The same path as an NSBezierPath object. Useful for drawing glyphs in plugins.
# draw the path into the Edit view NSColor.redColor().set() layer.paths[0].bezierPath.fill()
Type: NSBezierPath
Functions¶
-
reverse
()¶ Reverses the path direction
draw the object with a fontTools pen
-
addNodesAtExtremes
() New in version 2.3.
Add nodes at path’s extrema, e.g., top, bottom etc.
-
applyTransform
() Apply a transformation matrix to the path.
path = layer.paths[0] path.applyTransform(( 0.5, # x scale factor 0.0, # x skew factor 0.0, # y skew factor 0.5, # y scale factor 0.0, # x position 0.0 # y position ))
GSNode
¶
Implementation of the node object.
For details on how to access them, please see GSPath
.nodes
-
class
GSNode
([pt, type = type])¶ Parameters: - pt – The position of the node.
- type – The type of the node, LINE, CURVE or OFFCURVE
Properties
position |
|
type |
|
connection |
|
selected |
|
index |
|
nextNode |
|
prevNode |
|
name |
Functions
makeNodeFirst() |
|
toggleConnection() |
Properties¶
-
position
The position of the node.
Type: NSPoint
-
type
¶ The type of the node, LINE, CURVE or OFFCURVE
always comare agains the constants, never agains the actual value.
Type: str
-
smooth
¶ If it is a smooth connection or not
Type: BOOL New in version 2.3.
-
connection
¶ The type of the connection, SHARP or SMOOTH
Type: string Deprecated since version 2.3: Use :attribute:`smooth` instead.
-
selected
Selection state of node in UI.
# select node layer.paths[0].nodes[0].selected = True # print selection state print layer.paths[0].nodes[0].selected
Type: bool
-
index
¶ New in version 2.3.
Returns the index of the node in the containing path or maxint if it is not in a path.
Type: int
-
nextNode
¶ New in version 2.3.
Returns the next node in the path.
Please note that this is regardless of the position of the node in the path and will jump across the path border to the beginning of the path if the current node is the last.
If you need to take into consideration the position of the node in the path, use the node’s index attribute and check it against the path length.
print layer.paths[0].nodes[0].nextNode # returns the second node in the path (index 0 + 1) print layer.paths[0].nodes[-1].nextNode # returns the first node in the path (last node >> jumps to beginning of path) # check if node is last node in path (with at least two nodes) print layer.paths[0].nodes[0].index == (len(layer.paths[0].nodes) - 1) # returns False for first node print layer.paths[0].nodes[-1].index == (len(layer.paths[0].nodes) - 1) # returns True for last node
Type: GSNode
-
prevNode
¶ New in version 2.3.
Returns the previous node in the path.
Please note that this is regardless of the position of the node in the path, and will jump across the path border to the end of the path if the current node is the first.
If you need to take into consideration the position of the node in the path, use the node’s index attribute and check it against the path length.
print layer.paths[0].nodes[0].prevNode # returns the last node in the path (first node >> jumps to end of path) print layer.paths[0].nodes[-1].prevNode # returns second last node in the path # check if node is first node in path (with at least two nodes) print layer.paths[0].nodes[0].index == 0 # returns True for first node print layer.paths[0].nodes[-1].index == 0 # returns False for last node
Type: GSNode
-
name
New in version 2.3.
Attaches a name to a node.
Type: unicode
GSGuideLine
¶
Implementation of the guide object.
For details on how to access them, please see GSLayer
.guides
-
class
GSGuideLine
¶
Properties¶
position |
|
angle |
|
name |
|
selected |
-
position
The position of the node.
Type: NSPoint
-
angle
¶ Angle
Type: float
-
name
a optional name
Type: unicode
-
selected
Selection state of guideline in UI.
# select guideline layer.guidelines[0].selected = True # print selection state print layer.guidelines[0].selected
Type: bool
GSAnnotation
¶
Implementation of the annotation object.
For details on how to access them, please see GSLayer
.annotations
-
class
GSAnnotation
¶
Properties
position |
|
type |
|
text |
|
angle |
|
width |
Properties¶
-
position
The position of the annotation.
Type: NSPoint
-
type
The type of the annotation.
Available constants are: TEXT ARROW CIRCLE PLUS MINUS
Type: int
-
text
¶ The content of the annotation. Only useful if type == TEXT
Type: unicode
-
angle
The angle of the annotation.
Type: float
-
width
The width of the annotation.
Type: float
GSHint
¶
Implementation of the hint object.
For details on how to access them, please see GSLayer
.hints
-
class
GSHint
¶
Properties
originNode |
|
targetNode |
|
otherNode1 |
|
otherNode2 |
|
type |
|
horizontal |
|
selected |
Properties¶
-
targetNode
¶ The the second node this hint is attached to. In the case of a ghost hint, this value will be empty.
Type: GSNode
-
otherNode1
¶ A third node this hint is attached to. Used for Interpolation or Diagonal hints.
Type: GSNode
-
type
See Constants section at the bottom of the page.
Type: int
-
options
¶ Stores extra options for the hint. For TT hints, that might be the rounding settings. See Constants section at the bottom of the page.
Type: int
-
horizontal
¶ True if hint is horizontal, False if vertical.
Type: bool
-
selected
Selection state of hint in UI.
# select hint layer.hints[0].selected = True # print selection state print layer.hints[0].selected
Type: bool
GSBackgroundImage
¶
Implementation of background image.
For details on how to access it, please see GSLayer
.backgroundImage
-
class
GSBackgroundImage
([path])¶ Parameters: path – Initialize with an image file (optional)
Properties
path |
|
image |
|
crop |
|
locked |
|
position |
|
scale |
|
transform |
|
alpha |
Functions
resetCrop |
|
scaleWidthToEmUnits |
|
scaleHeightToEmUnits |
Properties¶
-
path
¶ Path to image file.
Type: unicode
-
image
¶ NSImage
object of background image, read-only (as in: not settable)Type: NSImage
-
crop
¶ Crop rectangle. This is relative to the image size in pixels, not the font’s em units (just in case the image is scaled to something other than 100%).
Type: NSRect
# change cropping layer.backgroundImage.crop = NSRect(NSPoint(0, 0), NSPoint(1200, 1200))
-
locked
¶ Defines whether image is locked for access in UI.
Type: bool
-
alpha
¶ New in version 2.3.
Defines the transparence of the image in the Edit view. Default is 50%, possible values are 10–100.
To reset it to default, set it to anything other than the allowed values.
Type: int
-
position
Position of image in font units.
Type: NSPoint
# change position layer.backgroundImage.position = NSPoint(50, 50)
-
scale
Scale factor of image.
A scale factor of 1.0 (100%) means that 1 font unit is equal to 1 point.
This sets the scale factor for x and y scale simultaneously. For separate scale factors, please use a transformation matrix.
Type: float or tuple
-
rotation
Rotation angle of image.
Type: float
-
transform
Transformation matrix.
Type: NSAffineTransformStruct
# change transformation layer.backgroundImage.transform = (( 1.0, # x scale factor 0.0, # x skew factor 0.0, # y skew factor 1.0, # y scale factor 0.0, # x position 0.0 # y position ))
Functions¶
-
resetCrop
()¶ Resets the cropping to the image’s original dimensions.
-
scaleWidthToEmUnits
()¶ Scale the image’s cropped width to a certain em unit value, retaining its aspect ratio.
# fit image in layer's width layer.backgroundImage.scaleWidthToEmUnits(layer.width)
-
scaleHeightToEmUnits
()¶ Scale the image’s cropped height to a certain em unit value, retaining its aspect ratio.
# position image's origin at descender line layer.backgroundImage.position = NSPoint(0, font.masters[0].descender) # scale image to UPM value layer.backgroundImage.scaleHeightToEmUnits(font.upm)
GSEditViewController
¶
Implementation of the GSEditViewController object, which represents Edit tabs in the UI.
For details on how to access them, please look at GSFont
.tabs
-
class
GSEditViewController
¶
Properties
parent |
|
text |
|
layers |
|
scale |
|
viewPort |
|
bounds |
|
selectedLayerOrigin |
|
textCursor |
|
textRange |
|
direction |
|
features |
|
previewInstances |
|
previewHeight |
Functions
close() |
Properties¶
-
text
The text of the tab, either as text, or slash-escaped glyph names, or mixed.
Type: Unicode
-
layers
Alternatively, you can set (and read) a list of
GSLayer
objects. These can be any of the layers of a glyph.Type: list font.tabs[0].layers = [] # display all layers of one glyph next to each other for layer in font.glyphs['a'].layers: font.tabs[0].layers.append(layer)
-
scale
New in version 2.3.
Scale (zoom factor) of the Edit view. Useful for drawing activity in plugins.
The scale changes with every zoom step of the Edit view. So if you want to draw objects (e.g. text, stroke thickness etc.) into the Edit view at a constant size relative to the UI (e.g. constant text size on screen), you need to calculate the object’s size relative to the scale factor. See example below.
print font.currentTab.scale 0.414628537193 # Calculate text size desiredTextSizeOnScreen = 10 #pt scaleCorrectedTextSize = desiredTextSizeOnScreen / font.currentTab.scale print scaleCorrectedTextSize 24.1179733255
Type: float
-
viewPort
¶ New in version 2.3.
The visible area of the Edit view in screen pixel coordinates (view coordinates).
The NSRect’s origin value describes the top-left corner (top-right for RTL, both at ascender height) of the combined glyphs’ bounding box (see .bounds below), which also serves as the origin of the view plane.
The NSRect’s size value describes the width and height of the visible area.
When using drawing methods such as the view-coordinate-relative method in the Reporter Plugin, use these coordinates.
# The far corners of the Edit view: # Lower left corner of the screen x = font.currentTab.viewPort.origin.x y = font.currentTab.viewPort.origin.y # Top left corner of the screen x = font.currentTab.viewPort.origin.x y = font.currentTab.viewPort.origin.y + font.currentTab.viewPort.size.height # Top right corner of the screen x = font.currentTab.viewPort.origin.x + font.currentTab.viewPort.size.width y = font.currentTab.viewPort.origin.y + font.currentTab.viewPort.size.height # Bottom right corner of the screen x = font.currentTab.viewPort.origin.x + font.currentTab.viewPort.size.width y = font.currentTab.viewPort.origin.y
Type: NSRect
-
bounds
New in version 2.3.
Bounding box of all glyphs in the Edit view in view coordinate values.
Type: NSRect
-
selectedLayerOrigin
¶ New in version 2.3.
Position of the active layer’s origin (0,0) relative to the origin of the view plane (see .bounds above), in view coordinates.
Type: NSPoint
-
textCursor
¶ New in version 2.3.
Position of text cursor in text, starting with 0.
Type: integer
-
textRange
¶ New in version 2.3.
Amount of selected glyphs in text, starting at cursor position (see above).
Type: integer
-
direction
New in version 2.3.
Writing direction.
Defined constants are: LTR (left to right), RTL (right to left), LTRTTB (left to right, vertical, top to bottom e.g. Mongolian), and RTLTTB (right to left, vertical, top to bottom e.g. Chinese, Japanese, Korean)
Type: integer font.currentTab.direction = RTL
-
features
New in version 2.3.
List of OpenType features applied to text in Edit view.
Type: list font.currentTab.features = ['locl', 'ss01']
-
previewInstances
¶ New in version 2.3.
Instances to show in the Preview area.
Values are
'live'
for the preview of the current content of the Edit view,'all'
for interpolations of all instances of the current glyph, or individual GSInstance objects.Type: string/GSInstance # Live preview of Edit view font.currentTab.previewInstances = 'live' # Text of Edit view shown in particular Instance interpolation (last defined instance) font.currentTab.previewInstances = font.instances[-1] # All instances of interpolation font.currentTab.previewInstances = 'all'
-
previewHeight
¶ New in version 2.3.
Height of the preview panel in the Edit view in pixels.
Needs to be set to 31 or higher for the preview panel to be visible at all. Will return 1.0 for a closed preview panel or the current size when visible.
Type: float
Functions¶
-
close
() Close this tab.
GSGlyphInfo
¶
Implementation of the GSGlyphInfo object.
This contains valuable information from the glyph database. See GSGlyphsInfo
for how to create these objects.
-
class
GSGlyphInfo
¶
Properties
name |
|
productionName |
|
category |
|
subCategory |
|
components |
|
accents |
|
anchors |
|
unicode |
|
unicode2 |
|
script |
|
index |
|
sortName |
|
sortNameKeep |
|
desc |
|
altNames |
|
desc |
Properties¶
-
name
Human-readable name of glyph (“nice name”).
Type: unicode
-
productionName
Production name of glyph. Will return a value only if production name differs from nice name, otherwise None.
Type: unicode
-
category
This is mostly from the UnicodeData.txt file from unicode.org. Some corrections have been made (Accents, ...) e.g: “Letter”, “Number”, “Punctuation”, “Mark”, “Separator”, “Symbol”, “Other”
Type: unicode
-
subCategory
This is mostly from the UnicodeData.txt file from unicode.org. Some corrections and additions have been made (Smallcaps, ...). e.g: “Uppercase”, “Lowercase”, “Smallcaps”, “Ligature”, “Decimal Digit”, ...
Type: unicode
-
components
This glyph may be composed of the glyphs returned as a list of
GSGlyphInfo
objects.Type: list
-
accents
¶ This glyph may be combined with these accents, returned as a list of glyph names.
Type: list
-
anchors
Anchors defined for this glyph, as a list of anchor names.
Type: list
-
unicode
Unicode value of glyph.
Type: list
-
script
Script of glyph, e.g: “latin”, “cyrillic”, “greek”.
Type: unicode
-
index
Index of glyph in database. Used for sorting in UI.
Type: unicode
-
sortName
¶ Alternative name of glyph used for sorting in UI.
Type: unicode
-
sortNameKeep
¶ Alternative name of glyph used for sorting in UI, when using ‘Keep Alternates Next to Base Glyph’ from Font Info.
Type: unicode
-
desc
¶ Unicode description of glyph.
Type: unicode
-
altNames
¶ Alternative names for glyphs that are not used, but should be recognized (e.g., for conversion to nice names).
Type: unicode
Methods¶
divideCurve() |
|
distance() |
|
addPoints() |
|
subtractPoints() |
|
GetOpenFile() |
|
GetSaveFile() |
|
GetFolder() |
|
Message() |
|
LogToConsole() |
|
LogError() |
-
divideCurve
(P0, P1, P2, P3, t)¶ Divides the curve using the De Casteljau’s algorithm.
Parameters: - P0 – The Start point of the Curve (NSPoint)
- P1 – The first off curve point
- P2 – The second off curve point
- P3 – The End point of the Curve
- t – The time parameter
Returns: A list of points that represent two curves. (Q0, Q1, Q2, Q3, R1, R2, R3). Note that the “middle” point is only returned once.
Return type: list
-
distance
(P0, P1)¶ calculates the distance between two NSPoints
Parameters: - P0 – a NSPoint
- P1 – another NSPoint
Returns: The distance
Return type: float
-
addPoints
(P1, P2)¶ Add the points.
Parameters: - P0 – a NSPoint
- P1 – another NSPoint
Returns: The sum of both points
Return type: NSPoint
-
subtractPoints
(P1, P2)¶ Subtracts the points.
Parameters: - P0 – a NSPoint
- P1 – another NSPoint
Returns: The subtracted point
Return type: NSPoint
-
scalePoint
(P, scalar)¶ Scaled a point.
Parameters: - P – a NSPoint
- scalar – The Multiplier
Returns: The multiplied point
Return type: NSPoint
-
GetSaveFile
(message=None, ProposedFileName=None, filetypes=None)¶ Opens a file chooser dialog.
Parameters: - message –
- filetypes –
- ProposedFileName –
Returns: The selected file or None
Return type:
-
GetOpenFile
(message=None, allowsMultipleSelection=False, filetypes=None)¶ Opens a file chooser dialog.
Parameters: - message – A message string.
- allowsMultipleSelection – Boolean, True if user can select more than one file
- filetypes – list of strings indicating the filetypes, e.g., [“gif”, “pdf”]
Returns: The selected file or a list of file names or None
Return type: unicode or list
-
GetFolder
(message=None, allowsMultipleSelection = False)¶ Opens a folder chooser dialog.
Parameters: - message –
- allowsMultipleSelection –
Returns: The selected folder or None
Return type:
-
Message
(title, message, OKButton=None)¶ Shows an alert panel.
Parameters: - title –
- message –
- OKButton –
-
LogToConsole
(message)¶ Write a message to the Mac’s Console.app for debugging.
Parameters: message –
-
LogError
(message)¶ Log an error message and write it to the Macro window’s output (in red).
Parameters: message –
Constants¶
Node types
- LINE = “line”
- Line node.
- CURVE = “curve”
- Curve node. Make sure that each curve node is preceded by two off-curve nodes.
- OFFCURVE = “offcurve”
- Off-cuve node
Node connection
- GSSHARP = 0
- Sharp connection.
- GSSMOOTH = 100
- A smooth or tangent node
Deprecated since version 2.3: Use attribute smooth instead.
Hint types
- TOPGHOST = -1
- Top ghost for PS hints
- STEM = 0
- Stem for PS hints
- BOTTOMGHOST = 1
- Bottom ghost for PS hints
- TTANCHOR = 2
- Anchor for TT hints
- TTSTEM = 3
- Stem for TT hints
- TTALIGN = 4
- Aling for TT hints
- TTINTERPOLATE = 5
- Interpolation for TT hints
- TTDIAGONAL = 6
- Diagonal for TT hints
- CORNER = 16
- Corner Component
- CAP = 17
- Cap Component
Hint Option
This is only used for TrueType hints.
- TTROUND = 0
- Round to grid
- TTROUNDUP = 1
- Round up
- TTROUNDDOWN = 2
- Round down
- TTDONTROUND = 4
- Don’t round at all
- TRIPLE = 128
- Indicates a triple hint group. There need to be exactly three horizontal TTStem hints with this setting to take effect.


{include file="admin/helpers/head.html"} {include file="admin/helpers/logo.html"} {include file="admin/helpers/nav.html"} {$lang->line("converters.title")} {include file="admin/helpers/footer.html"}


Rate Limit
Rate Limit
The Rate Limit feature limits the request rate of HTTP/HTTPS (not web sockets) traffic to hosts or domains to prevent overloading the target or being blocked.
The limit is applied using a matcher against the request host to pick an individual host, an entire domain, or anything
between. In the case a host matches multiple rules, the rule with the most restrictive rate is used.
Limits for a domain or host may be quickly added via the context menu. Open the context menu on a message to add a
rule to limit by the host or domain.
Each rule is defined by the following fields:
Description
A description that allows you to identify the rule. Each rule must have a unique description.
Match String
The string that will be used to identify which hosts will be limited. If treated as a regular expression, the host must fully match.
If "Match Regex" is un-checked, the match string is handled based on DNS conventions. If the string has one or two components,
i.e. 'example.com' or 'localhost', either an exact match or additional components will match. 'host1.example.com', 'sub1.host1.example.com' will match 'example.com'. 'localhost.localhost' will match 'localhost'. A match string of 'host1.example.com' will only match 'host1.example.com'.
Match Regex
If set then the Match String will be treated as a regular expression.
Requests Per Second
The maximum number of requests per second.
Group By
How to group hosts when applying rate limiting. The default "rule" limits the rate to all hosts matching the rule as a single unit. The "host" value will apply the rate limit to each host individually.
Enable
If not set then the rule will not apply.
Status Panel
A status panel is provided to show how requests to hosts are being limited.
The following fields are shown:
Group
The host or rule name based on the "Group By" setting in the rule. If grouping by hosts, there will be a row for each host.
Rule
The name of the rule.
Requests
The number of requests processed by the rule for this host or group.
Effective Rate
The effective request rate based on the first request time, last request times, and request count. The value may be less than the request limit, but should never be more.
Last
The time of the last request processed by the rule.


STEP 1 of 4
If you have been given an evacuation order and have been asked to leave your home, use this step-by-step Evacuee Self-Registration form to register with Emergency Support Services.
All required fields are marked with an asterisk *
Emergency Management BC (EMBC) will collect your personal information for the purpose of providing you with emergency services in accordance with section 26(c) of the Freedom of Information and Protection of Privacy Act (FoIPPA). EMBC will also collect the information as per section 26(e) of FoIPPA in order to evaluate the ESS program. Should you have any questions about the collection, use, or disclosure of personal information, please contact the Emergency Support Services Call Centre Manager at PO Box 9201, STN PROV GOVT, Victoria, BC, V8W 9J1 or by phone toll free at 1-800-585-9559.
By submitting your email address, you authorize the Emergency Management BC to communicate with you by email about your registration and to invite you to provide feedback about your experience.
Concerned family and friends may inquire about you and your family because of the emergency. Do you consent to have your location and contact information shared with concerned family or friends who ask about your wellbeing?
During an emergency response many people join the response effort. We want to ensure that your information remains unseen except by people that are trained to handle sensitive information.
Please proceed to your designated Emergency Support Services reception centre to initiate your registration and receive supports.
Your nearest Reception Centre is listed at EmergencyInfoBC.

Is your primary residence within BC?
Are you being evacuated from your primary residence?
Is your mailing address the same as your primary residence?
Is your mailing address within BC?


FROM: Mr RAY KABE BANGKOK THAILAND DEAR SIR, You may be surprised to receive this letter from me since you do not know me personally, the purpose of my introduction is that, I am RAYMOUND kABE, the first son of DR KINGSLEY SMITH KABE who was recently murdered in the land dispute in Zimbabwe. I got your contact through network online hence decided to write you. Before the death of my father, he had taken me to Johannesburg to deposit the sum of US$10.5Million(Ten million five hundred thousand United StatesDollars), in one the private security company, as if he foresaw the looming danger in Zimbabwe.This money was deposited in a box as germ stones to avoid much demurrage from Security Company.This amount was meant for the purchase of new machines and chemicals for the farms and established of new farm in Swaziland. This land problem came when Zimbabwean President Mr. Robert Mugabe introduce a new Land Act reform which wholly affected the rich white farmers and some few blacks farmers.And this resulted to the killing and mob action by Zimbabwean war veterans and some lunatics in the society. In fact, a lot of people were killed because of this land reformed Act for which my father was one of the victim. It is against this background that, I and my family who are currently staying in bangkok thailand decided to transfer my father’s money to foreign account sine c the law of bangkok prohibit a refugee (asylum seeker) to open any bank account or to be involved in any financial transaction throughout the teritorial zone bangkok. As the eldest son of my father, I am saddle with the responsibility of seeking a genuine foreign account where this money could be transferred without the knowledge of my government who are Sent on taking everything we have got. I am faced with the dilemma of investing this amount of money in bangkok for fear of what is going on in the bangkok Foreign Exchange policy does not allow such investment for an asylum seeker. As a businessman, who I have to entrust my future and of my family in his hands, I must let you know that this transaction is risk free. If you accept to assist me and my family all I want you to do for me is to make arrangements and come to bangkok thailand, sothat you can open a non-resident account which will aid us in transferring the money into any account you will nominate overseas. This money I intend to use for investment. I have two options for you, firstly you can choose to have certain percentage of the money for nominating your account for this transaction.Or you can go into partnership with me for the proper profitable investment of the money in your country. Whichever the options you want, feel free to notify me I have also mapped out 10% of this money for all kinds of expenses incurred in the process of this transaction. If you do not prefer a partnership I am willing to give you 20% of the money while the remaining 70% will be for my investment in your country. Contact me with the above E-mail and please candly put ur numberin your reply. while I implore you to maintain the absolute secrecy required in this transaction. Yours Faithfully, RAY KABE (For the Family)


« Back to the index
WA.get, direct access to the content of the nodes, examples
Jail the object.
Move:
Object
Copy of object
Border/shadow of object
Move me
« Back to the index


Description
The aim for this project was to use open-source
software to create a product from spatial data. Qgis an open-source spatial
tool was used for all the analysis, and all data was obtained from open-source
sites. The analysis was focused on bike accidents within Melbourne CBD during
Morning peak-hour and Evening peak-hour.
As you can see from the below maps, there is a
clear difference between where the hotspots occur during the morning and
evening. The maps were created using CARTO which allowed for each level of risk
to be easily identifiable. They were then put into a website format and hosted
online, unfortunately the website is no longer up.


Crippling student loans contribute to Chile's protests
SANTIAGO: Spiralling student debt, with some loans the size of a mortgage, pricey tuition fees and a troubled education system have helped fan the flames of Chile's deadly protests.
"I don't know anymore how much I owe at this stage," said Paulina Gomez, 34, who graduated over a decade ago.
Two weeks on from the start of Chile's deadly social protests, Gomez and others gathered at one of the daily citizens' meetings taking place in Santiago to discuss crippling student debt that they say is crushing the hopes of many young people.
"With interest I owe more than the total cost of the course now. It's going up every day and I had to take out a loan to pay the interest on my first loan," said Gomez, a journalist.
STATE GUARANTEE
"At the end of the 90s, state resources proved insufficient to finance higher education," said Gonzalo Muñoz, an education specialist at Santiago's Diego Portales University.
A loan programme known as CAE emerged, with bank loans to students guaranteed by the state, a financial device that has fuelled student anger against Chile's "neo-liberalism".
Guillermo Jobia, a 24-year old law student who has just graduated, said he paid "the price of a house, and that was being on a scholarship."
"I still have to pay 20 million (pesos)," equivalent to around US$27,000.
"I think I'll never see the end of it, unless I get a job that pays, I don't know, a salary that would be impossible here."
Most young Chileans work during their studies in low-paid jobs which don't provide enough income to pay off their debts. Chile's minimum monthly wage amounts to US$420.
Gunther Birchmeier, 30, worked as "a waiter, or in a supermarket at night or at weekends" to earn his US$550 monthly tuition fees. But he couldn't keep it up. Eventually, "the university blocked me and I couldn't continue studying."
Birchmeier says he has been repaying student debt for the past five years, "and I still have 15 left".
"You have to take the whole issue of interest into account," said Birchmeier. "They lent me 10 million (pesos, around US$13,300) and I'm paying back about 20 million, 100 per cent more."
Birchmeier, who works in a cybersecurity company, has no savings. "I'm stuck. If I get fired, I have nothing."
"ANGUISH"
Gomez says she feels harassed by a constant stream of letters and phone calls from debt collectors, "even at work."
"I'm not paying currently. I don't have the cash." The interest alone "is now 5 million pesos" - around US$6,700.
"The politicians of this country must give us a definitive solution to end this anguish, because it is anguish to have to deprive yourself of other things in order to pay for this. It's never-ending."
The next generation is what worries Gomez now, particularly the challenges facing her 10-year-old son.
"Public education in Chile is horrible. There are 40 per class. Only one teacher. We'll have to tighten our belts to send him to a private school."
The sense of crisis around Chile's education system has emerged during every social conflict since the end of the Pinochet regime in 1990.
Chile's largest student demonstrations for decades, the "Penguin Revolution" - so called because of the students' dark blue and white uniforms - took place in 2006.
"The difficulties we see now mainly affect young people who have finished their studies in the last 15 years," said Munoz, the education expert.
"The youngsters of today will have different conditions" he said. "The Bachelet system has changed the situation."
In 2015, during her second term, then-president Michelle Bachelet allowed Chile's poorest to have free access to university with a landmark education reform, though the high postgraduate debt burden still remains for many Chileans.


Want to help me fund similar projects, or chip in for hosting? You can do so by shipping me some BTC, much appreciated!


Join My Calendars now!
Register
Username
Password
Sign Up
Already have an account?
Login to your account.
You sucessfully created an account!
Go back to Login
There are missing input fields. Please try again.
Close


So they began solemnly dancing round and round Alice, every now and then treading on her toes when they passed too close, and waving their forepaws to mark the time, while the Mock Turtle sang this, very slowly and sadly:— '"Will you walk a little faster?" said a whiting to a snail.  said a whiting to a snail. "There's a porpoise close behind us, and he's
So they began solemnly dancing round and round Alice, every now and then treading on her toes when they passed too close, and waving their forepaws to mark the time, while the Mock Turtle sang this, very slowly and sadly:—


How to Keep up Learning Momentum While Virtual Working
Uncertainty, isolation, and more besides detracts from your learning experience. So keeping your learning momentum going through these turbulent times is a real challenge.
The working world has changed forever. For many, the crucial distinction between home and work has been lost. Household chores, hobbies, and family time now run seamlessly alongside emails and virtual meetings over Zoom or Microsoft Teams.
When lockdown hit, no one expected perfection. The sudden shift in the way we all do business meant that the expectations of employers, employees and clients alike weren’t always met. However, everyone came together to do their best. We tried lots of things, some worked, some didn’t, and we’ve all still got so much to learn.
Social distancing and working from home radically transformed the way we do learning and development, too. And with this transformation came a unique set of challenges. One of them being, how do we maintain learning momentum in a remote working environment? With so much new information to take in, learning and development has come into its own.
Check out our range of available Virtual Workshops here.
Here are a few ideas to help you maintain learning momentum whilst working remotely.
Find a virtual platform that works for you
Hardware and software can be a bit of a headache, can’t they? Especially if you’re new to remote working. Tech issues like poor wifi and broken microphones were always going to be a problem. But there are other, less obvious issues to overcome too; the little things like positioning your webcam so you’re not drowned in a sea of light. Or, remembering to hit the mute button when you’re not speaking so your team aren’t treated to the sound of your heavy breathing are just as troublesome.
To mitigate this, finding the right platform that allows you and your colleagues to operate remotely with confidence is critical. It’s your prime communication tool, so give it as much thought as you would any other significant business decision.
Find routines
The first few days working from home were the best; no more stuffy work clothes, commute, or arguments over whether the air conditioning needed to be on or off. The novelty faded quickly though and with it, motivation.
When you lose your usual routine, just getting out of bed can prove a challenge. And that’s not a healthy mindset to get into. Therefore you must build a new schedule to feel and perform at your best. Whether that’s throwing on your old work clothes or going for an early morning run, start the day with something productive that lifts your mood and primes you for the day ahead.
In this video, Catherine discusses why we think that remote working is here to stay
Encourage curiosity
Helping colleagues to embrace lifelong, self-directed learning is key in L&D. This has always been the case. However, the self-directed bit is paramount now that we’re working remotely.
With that in mind, if your colleagues express interest in learning a new skill, meet that interest immediately with enthusiasm and facilitation, rather than dither and delay. Enabling colleagues to learn new skills can only ever benefit a business. Better yet, the range of virtual workshops accessible to facilitate this is vast and ever-expanding.
Improve communication
Times are tough, and it’s down to you to do everything you can to create a positive work culture. The benefits of this to your business are clear. It’s also the right thing to do by your people. Learning plays a role here, and by encouraging continued learning creates organic collaboration between colleagues and teams. That interaction will build a sense of camaraderie that’s hard to beat.
Not only that but, by providing regular learning opportunities, you’ll give your people something to aim for. The sense of achievement and feeling of growth successfully completing a course garners will mean more to them than any number of ‘encouraging’ emails.
Times are changing. Are you ready?
The sudden move to a predominantly virtual world took everyone by surprise. However, remote working shouldn’t harm your learning momentum. If anything, our new virtual world presents us with an unrivalled opportunity for learning, collaboration, and development. Albeit the tools we use to do it now look a little different.
If you’re concerned about the challenges the remote working environment is placing on the learning momentum in your team, we’re here to help.


No parking, but updated Leslieville house goes over-asking
by Sydnia Yu36 Walpole Ave., Toronto
Asking price: $898,000
Selling price: $1,006,000
Previous selling prices: $403,166 (2016); $430,000 (2009); $225,000 (2005); $122,000 (1996)
Taxes: $3,347 (2019)
Days on the market: Five
Listing agent: Luisa Piccirilli, Re/Max West Realty Inc.
The action
Despite competition from other homes for sale near Monarch Park, just south of Greenwood subway station, the excellent condition and location of this semi-detached house on an 18-foot-by-90-foot lot made it stand out, and it quickly fetched several offers.
“In August, things started to pick up again because the fall market was right around the corner,” agent Luisa Piccirilli said.
“Most of the [other] homes did sell in multiples, and this one didn’t even have a parking spot.”
What they got
This three-bedroom house was renovated less than 10 years ago, with new mechanics and hardwood flooring, as well as two updated bathrooms. The updated kitchen was given soapstone counters, stainless steel appliances and pot lights.
There are open living and dining areas off the foyer and the rear family room has sliding doors to a patio, gazebo and fenced-in backyard with shed. The basement has been outfitted with an office and guest room round.
The Agent’s take
“Overall, it has very nice curb appeal, but inside had the wow factor,” Ms. Piccirilli said.
“[The sellers] spent a lot of money on the kitchen, which has a gas burner stove, nice island and beautiful cabinetry.”
However, the proximity to amenities was an undisputed highlight. “Leslieville has become very popular,” Ms. Piccirilli said.
“It has good schools, lots of trees and parks.”
 We have a weekly Real Estate newsletter to help you stay on top of news on the housing market, mortgages, the latest closings and more. Sign up today.
Done Deals
Price drop helps sale of Lawrence Park house Asking: $2,800,000 Selling: $2,775,000
Big fees hinder sale of Yorkville condo Asking: $1,495,000 Selling: $1,445,000


The W3C defines the DOM as:
A platform and language-neutral interface thatwill allow programs and scripts to dynamically access and update the content,structrue and style of documents.
It is an API that can be used to navigate HTML and XML documents.
| When | Where |
|---|---|
| June 9th | Portland, OR |
| June 10th | Seattle, WA |
| June 12th | Sacramento, CA |


Predicting Mortality caused by Heart Failure
Data taken from : https://www.kaggle.com/andrewmvd/heart-failure-clinical-data


Two arrested in Oman for car fraud
by Times News ServiceMuscat: The Royal Oman Police (ROP) has arrested two persons for various vehicle related offences.
In a statement, the police said, "North Al Batinah Police Command has arrested two persons for drifting in their vehicles and stealing plates of other vehicles and installing them in one of the seized vehicles to mislead the police as to the identity of the driver.”
“The necessary procedures have been taken and legal proceedings are being completed against them," the ROP added


{% if mpoll.owner == request.user %}
Comment: {{response.comment}}
{% endif %} {% endfor %}Comment: {{response.comment}}
{% endif %}No one has voted on this poll yet.
{% endif %} {% else %} {% if mostRecentResponse %}Comment: {{response.comment}}
{% endif %}Comment: {{response.comment}}
{% endif %}You haven't voted on this poll yet.
{% endif %} {% if question.display_pref == 1 %}{{latest_responses|length}} / {{question.question_voters.count}} have voted.
The owner allows everyone to see all votes cast.
{% for response in latest_responses %} {% if response.user %} {% if response.user != request.user %}Comment: {{response.comment}}
{% endif %}Comment: {{response.comment}}
{% endif %}{{latest_responses|length}} / {{question.question_voters.count}} have voted.
The following voters have voted on this poll:
{{latest_responses|length}} / {{question.question_voters.count}} have voted.
{% endif %} {%endif%}


gView
View markdown files of special gist
Usage
- Create a public gist on Github with one or more Markdown-syntax files.
- Note the gist ID number. It’s usually a longish number like 9403314
- View your writing presented nicely at
http://g.zhiye.li/9403314


{% extends "dashboard/base.html" %} {% load staticfiles %} {% block content %}
[Node One]: Server started [Node One]: Process PName was started successfully [Node Two]: Server started


var number = 1;
number = 1;
number 1;
var 3six;
var six3;
var *3six;
var $3six;
var _3six;
$
_
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
var six3 = 63;
break |
default |
function |
return |
var |
case |
delete |
if |
switch |
void |
catch |
do |
in |
this |
while |
const |
else |
instanceof |
throw |
with |
continue |
finally |
let |
try |
|
debugger |
for |
new |
typeof |
function nameOfFunction
function add3(arg)
function add3(num){
return num + 3;
}
Write a function that takes in a number and prints out the number multiplied by 5
JS Bin on jsbin.comWrite a function that takes in a string and prints out string with with "Hello, " in front of it. JS Bin on jsbin.com
Write a function that takes in 2 numbers where the first number is the base and the second number is the exponent. Print out the value of raising the base by the exponent.
JS Bin on jsbin.comWrite a function that take in 2 numbers, divides the first number by the second number and prints out the answer rounded to the nearest integer.
JS Bin on jsbin.comWrite a function that calculates the days left until Christmas.


WITNESS LIST Civil Practices Committee April 18, 2006-10:00A Interim Charge #1 On: Cokinos, Gregory (AGC - Texas Building Branch; Texas Construction Association) Deats, Craig (Texas State Association of Fire Fighters) Hansen, David (Self) Interim Charge #3 On: Kincaid, Mark L. (Texas Trial Lawyers Association) Nicolas, Sandra R. (Texas Department of Insurance) Interim Charge #5 On: Carr, Jennifer (Catholic Charities of the Archdiocese of Galveston-Houston) Dalfrey, Donna (The Children's Shelter of San Antonio) Green, Ronald (Children's Shelter of San Antonio) Harvey, Jay (Self and Texas Trial Lawyers Association) Holman, Nancy (Texas Alliance of Child and Family Services) Noll, Dennis E. (Children's Shelter of San Antonio) Pugh, Peggy (DePelchin Children's Center)


LoremGen
Words
Paragraphs
Length
Paragraphs count
Copy to clipboard when generated
Copy to clipboard


Unknown Battleground and me.
Coded with love and coffee.
Coded with love and cofee.
who makes it all worth


---
layout: layouts/post.njk
title: "Finessing < feColorMatrix >"
permalink: /fecolormatrix/
date: '2016-02-11'
comments: true
tags:
- css
- image effects
- library
- cssgram
- instagram
- filters
- fecolormatrix
- svg
description: "CSS Filters are awesome, but you can't do individual channel manipulation with them. Enter: feColorMatrix, SVG filter effect method that allows for really in-depth pixel value manipulation for even better image filters."
link-out: http://una.im/CSSgram
---
If you are not redirected, please visit this think!


This is a place for me to learn about how to use WebGL as part of my University labs/free time. The labs shall be added to the Github Pages as we go along.


Chandigarh University Application form
course
BE-CSE
B.Ed
B.tech
M.tech
M.ba
B.sc
M.SC
B.pharma
D.pharma
Other
DATE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
OF
JANUARY
FEBRUARY
MARCH
APRIL
MAY
JUNE
JULY
AUGUST
SEPTEMBER
OCTOBER
NOVEMBER
DECEMBER
BIRTH
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
Apply Now
Made with
by Shadow


{% load static %}
Ncit - Nepal College of Information Technology
Nepal College of Information Technology
Login to your account to view updates about exams, results and much more
{% csrf_token %}
Login to your account
Login