Top Level Namespace

Defined Under Namespace

Modules: Skrift Classes: Font, GMetrics, Image, Kerning, LMetrics, Outline, Raster, SFT

Instance Method Summary collapse

Instance Method Details

#midpoint(a, b) ⇒ Object



1
# File 'lib/skrift/outline.rb', line 1

def midpoint(a, b) = (a+b)*0.5

#transform_points(trf, pts) ⇒ Object

Applies an affine linear transformation matrix to a set of points



4
5
6
7
8
9
# File 'lib/skrift/outline.rb', line 4

def transform_points(trf, pts)
  pts.each do |pt|
    pt[0] = trf[0][0] * pt[0] + trf[0][1] * pt[1] + trf[0][2]
    pt[1] = trf[1][0] * pt[0] + trf[1][1] * pt[1] + trf[1][2]
  end
end