﻿<?xml version="1.0" encoding="UTF-8"?>

<?xml-stylesheet type="text/xsl" href="../style/class_view.xsl"?>
<Glyph>
===============================================
  Glyph - class to represent glyph
===============================================
<CONSTRUCTOR>
  Glyph()             - generic constructor, creates an empty glyph
  Glyph(Glyph)        - copy constructor
  Glyph(masterscount) - creates a glyph with 'masterscount' number of masters
  Glyph(masterscount, [<cl>Node</cl>, ...])
                      - creates a glyph with 'masterscount' number of masters
                        and assigns a list of nodes
</CONSTRUCTOR>
	<ATTRIBUTES>
  parent (read-only)      - Glyph's parent object, <cl>Font</cl>
  nodes [<cl>Node</cl>]            - list of Nodes
  customdata (string)     - custom data defined for this glyph
  note (string)           - note defined for this glyph
  mark (integer)          - True if glyph is marked
  anchors [<cl>Anchor</cl>]        - list of anchors
  hhints [<cl>Hint</cl>]           - list of horizontal hints
  vhints [<cl>Hint</cl>]           - list of vertical hints
  hlinks [<cl>Link</cl>]           - list of horizontal links
  vlinks [<cl>Link</cl>]           - list of vertical links
  hguides [<cl>Guide</cl>]         - list of horizontal guides
                            <rm>not reported by docstring</rm>
  vguides [<cl>Guide</cl>]         - list of vertical guides
                            <rm>not reported by docstring</rm>
  components [<cl>Component</cl>]  - list of componets
  replace_table [<cl>Replace</cl>] - hint replacing program, list of Replace objects
  kerning [<cl>KerningPair</cl>]   - list of kerning pairs
  layers_number (integer) - number of masters
  flags (integer)         - flags set for this glyph
  nodes_number (integer)  - number of nodes, same as 'len(Glyph)'
  width (integer)         - advance width for the first master
  height (integer)        - advance height for the first master
  unicode (integer)       - first Unicode index in integer form
  unicodes [integer]      - list of Unicode indexes
  name (string)           - glyph name
  image [<cl>Image</cl>]           - background image <rm>new in v4.53 Win</rm>
  index (integer)         - (read-only) glyph index, -1 if orphan glyph <rm>not reported by docstring</rm>
<TRUETYPE-DATA>
  advance_width (integer)
  advance_height (integer)
  left_side_bearing (integer)
  top_side_bearing (integer)
  y_pels (integer)
  bounding_box (<cl>Rect</cl>)
  number_of_contours (integer)
  end_points [integer]
  points [<cl>TTPoint</cl>]
  instructions [Byte]
  hdmx[Byte]
</TRUETYPE-DATA>
</ATTRIBUTES>
<OPERATIONS>
  len() - returns number of nodes in the glyph
  [] - can be used to access individial nodes
  slice - can be used to access portion of the glyph's nodes array
  + or concatination - can be used to append Glyph, <cl>Node</cl> or sequence of Nodes
  multiply - second operand must be <cl>Matrix</cl>, applies matrix transformation to a glyph
</OPERATIONS>
<METHODS>
  Assign (Glyph)                 - copies all information from the assigned glyph
  Transform(<cl>Matrix</cl> m)            - applies Matrix transformation to the Glyph (see Matrix().__doc__)
  SetLayersNumber(mastersnumber) - changes the number of masters, is applicable only 
                                   to glyphs that have no parent
  Clear()                        - removes all nodes
  Add                            - refer to '+' operator

  Insert (<cl>Node</cl> | Glyph | [<cl>Node</cl>]) | (<cl>Node</cl> | Glyph | 
          [<cl>Node</cl>], nodeindex)
                                 - inserts <cl>Node</cl>, Glyph or sequence of Nodes
                                   at the begining of glyph's nodes or at specified node index

  Present (style)                - returns True if a layer or a combination of layers
                                   are present in the glyph

  Delete (index) | (index0, index1) - removes node or range of nodes
  ExpandLayer (masterindex)      - expands selected master to all other masters
  Shift (<cl>Point</cl>) | (<cl>Point</cl>, masterindex)
                                 - shifts positions of all nodes at first or specified master
  Scale (<cl>Point</cl>(float) scale) | (<cl>Point</cl>(float) scale, <cl>Point</cl> center) | 
        (<cl>Point</cl>(float) scale, <cl>Point</cl> center, masterindex) - scales the glyph
  Layer (masterindex)            - returns list of <cl>Point</cl>s for all nodes for the selected master
  Section (masterindex, pointindex, nodetype) - returns list of <cl>Point</cl>s that conform to selected options
  MoveNode(...)                  - moves the node copying Edit tool behavior (see User manual for details)
  DeleteNode(nodeindex)          - removes the <cl>Node</cl>
  InsertNode(nodeindex) | (nodeindex, float time) | (nodeindex, float time, masterindex) - insers new node on a contour
<SELECTION-METHODS>
  Selection()                    - returns list of selected <cl>Node</cl>s
  SelectAll()                    - selects all <cl>Node</cl>s
  UnselectAll()                  - deselects all <cl>Node</cl>s
  InvertSelection()              - selects unselected <cl>Node</cl>s and deselects selected <cl>Node</cl>s
  isAnySelected()                - returns True if at least one <cl>Node</cl> is selected
  SelectedCount()                - returns number of selected <cl>Node</cl>s
  SelectRect(<cl>Rect</cl> r) | (<cl>Rect</cl> r, masterindex) 
                                 - selects all <cl>Node</cl>s that are inside the rectangle
  UnselectRect(<cl>Rect</cl> r) | (<cl>Rect</cl> r, masterindex) 
                                 - deselects all <cl>Node</cl>s that are inside the rectangle
  DeleteSelected() - deletes all selected <cl>Node</cl>s
</SELECTION-METHODS>
<METRICS-METHODS>
  GetBoundingRect() | (masterindex) - returns <cl>Rect</cl> - bounding box of the glyph
  GetMetrics() | (masterindex)      - returns glyph advance width and advance height
                                      in a form of <cl>Point</cl>
  SetMetrics(<cl>Point</cl> p) | (<cl>Point</cl> p, masterindex)
                                    - assigns new values to the width and height of the glyph
  GetVSB() | (masterindex)          - returns glyph bottom sidebearing position
  SetVSB(value) | (value, masterindex) - assigns new values to the bottom sidebearing of the glyph
</METRICS-METHODS>
<OVERLAP-METHODS>
  RemoveOverlap() | (masterindex)  - removes overlap
  Badd(Glyph g) | ([<cl>Node</cl>]) | (Glyph g, masterindex) | ([<cl>Node</cl>], masterindex)
                                   - performs bollean Add operation with the glyph or list of nodes
  Bsubtract(Glyph g) | ([<cl>Node</cl>]) | (Glyph g, masterindex) | ([<cl>Node</cl>], masterindex)
                                   - performs bollean Subtract operation with the glyph or list of nodes
  Bintersect(Glyph g) | ([<cl>Node</cl>]) | (Glyph g, masterindex) | ([<cl>Node</cl>], masterindex)
                                   - performs bollean Insersect operation with the glyph or list of nodes
</OVERLAP-METHODS>
<CONTOUR-METHODS>
  GetContoursNumber()              - returns number of contours in the glyph
  GetContourBegin(contourindex)    - returns index of the first node for a contour
  GetContourLength(contourindex)   - returns number of nodes in a contour
  SelectContour(contourindex)      - selects all nodes in the contour
  DeleteContour(contourindex)      - removes contour
  ReverseContour(contourindex)     - reverses contour's direction
  ReorderContour(contourindex, newindex) - reorders contours in the glyph
  isContourClockwise(contourindex) - returns True if direction of contour is clockwise
  SetStartNode(nodeindex)          - makes the node a starting node of the contour
  FindContour(nodeindex)           - returns number of contour containing the 'nodeindex'
</CONTOUR-METHODS>
<HINTS-METHODS>
  RemoveHints(integer mode)        - removes hints and links
  Autohint() | (masterindex)       - automatically generates Type 1 hints
</HINTS-METHODS>
<ANCHOR-METHODS>
  FindAnchor(string name)          - finds <cl>Anchor</cl> by name
</ANCHOR-METHODS>
<TRANSFORMATION-METHODS>
  Decompose()                      - pastes all components to the glyph outline
  MakeExtremeNodes() | (masterindex) - automatically detects and adds extreme nodes
  Audit() | (masterindex)          - performs test of the glyph and returns list of <cl>AuditRecord</cl> objects
  Iterate(Iterator)                - iterates glyph trough iterator class which must include following methods:
                                     Start(); ClosePath(); StartPath(<cl>Node</cl>); LineTo(<cl>Node</cl>); 
                                     CurveTo(<cl>Node</cl>); SplineTo(<cl>Node</cl>); Finish()
  Rotate3D
  Extrude3D(outlinewidth, shift_x, shift_y)
  Shadow(outlinewidth, shift_x, shift_y)
  College(outlinewidth, distance)
  Gradient(outlinewidth, direction, stripes_number, start_y, finish_y)
  Distance(width_x, width_y, cornermode) | (width_x, width_y, cornermode, Glyph dest)
  Interpolate([(nodeindex, <cl>Point</cl> newposition])
  Warp([<cl>Point</cl>], float force)
  Rasterize(<cl>Image</cl>) | 
  (<cl>Image</cl>, layer {, Height}) | (<cl>Image</cl>, WeightVector {, Height})
                                  - rasterizes the current glyph into <cl>Image</cl> object; 
                                    Height parameter is the rasterized pixel size of the em square, if absent, 
                                    source height of the image will be used. Rasterize returns image_rect - 
                                    rectangle used to fit image into the glyph space. <rm>extended parameters 
                                    are new in v4.61</rm>
  Blend(Glyph source, integer layer1, integer layer2, <cl>Point</cl> amount)
                                  - returns blend of the glyph and source
  JoinAll()                       - tries to join all open contours
                                    <rm>new in v4.5.4</rm>
  SaveEPS(string filename) | (string filename, layer) 
                                  - writes layer into the EPS file named filename
                                    <rm>new in v4.5.4</rm>
  LoadEPS(string filename)        - reads EPS from filename and returns Glyph object. 
                                    Use Assign method to replace current glyph with the loaded outline
                                    <rm>new in v4.5.4</rm>
  R([<cl>Point</cl>], float force)         - <rm>?? comes from the __doc__-string but raises an AttributeError</rm>

</TRANSFORMATION-METHODS>
</METHODS>
</Glyph>
