Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changed .gitignore settings for plugins folder to fix colorsys import…

… error
  • Loading branch information...
commit e0119d775f345edeb6a0886bfa4172991d5cc167 1 parent 0427e23
gferreira authored
Showing with 295 additions and 396 deletions.
  1. +1 −1  Lib/hTools2/plugins/.gitignore
  2. +1 −0  Lib/hTools2/plugins/__init__.py
  3. +125 −0 Lib/hTools2/plugins/colorsys.py
  4. +100 −0 Lib/hTools2/plugins/nudge.py
  5. +0 −13 Scripts/FontLab/selected-glyphs/get-glyphs-test.py
  6. +0 −164 Scripts/FontLab/selected-glyphs/round-to-grid-dialog.py
  7. +0 −151 Scripts/RoboFont/selected-glyphs/_layers/slide-layer.py
  8. 0  Scripts/{RoboFont → }/_dev/.gitignore
  9. +43 −26 Scripts/{RoboFont → }/_hTools/hFont/generate.py
  10. +1 −1  Scripts/{RoboFont → }/_hTools/hFont/groups.py
  11. +1 −1  Scripts/{RoboFont → }/_hTools/hFont/guides.py
  12. 0  Scripts/{RoboFont → }/_hTools/hFont/libs.py
  13. +5 −10 Scripts/{RoboFont → }/_hTools/hFont/spacing.py
  14. 0  Scripts/{RoboFont → }/_hTools/hGlyph/build.py
  15. 0  Scripts/{RoboFont → }/_hTools/hGlyph/import.py
  16. +2 −1  Scripts/{RoboFont → }/_hTools/hProject/batch-hProject.py
  17. 0  Scripts/{RoboFont → }/_hTools/hWorld/check-folders.py
  18. 0  Scripts/{RoboFont → }/_hTools/hWorld/edit-hSettings.py
  19. 0  Scripts/{RoboFont → }/_hTools/hWorld/make-folders.py
  20. 0  Scripts/{RoboFont → }/all-fonts/actions.py
  21. 0  Scripts/{RoboFont → }/all-fonts/close.py
  22. 0  Scripts/{RoboFont → }/all-fonts/generate-otfs.py
  23. 0  Scripts/{RoboFont → }/batch-folder/batch-actions.py
  24. 0  Scripts/{RoboFont → }/batch-folder/batch-generate-otfs-dialog.py
  25. 0  Scripts/{RoboFont → }/batch-folder/batch-import-otfs-dialog.py
  26. 0  Scripts/{RoboFont → }/current-font/_accent/mark-composed.py
  27. 0  Scripts/{RoboFont → }/current-font/_color/clear-colors.py
  28. 0  Scripts/{RoboFont → }/current-font/_color/delete-unmarked.py
  29. 0  Scripts/{RoboFont → }/current-font/_color/paint-groups.py
  30. 0  Scripts/{RoboFont → }/current-font/_glyphs/create-spaces.py
  31. 0  Scripts/{RoboFont → }/current-font/_glyphs/rename-glyphs.py
  32. 0  Scripts/{RoboFont → }/current-font/_groups/delete-groups.py
  33. 0  Scripts/{RoboFont → }/current-font/_groups/print-groups.py
  34. 0  Scripts/{RoboFont → }/current-font/_layers/delete-layer.py
  35. 0  Scripts/{RoboFont → }/current-font/_vmetrics/set-vmetrics.py
  36. 0  Scripts/{RoboFont → }/current-font/print-info.py
  37. 0  Scripts/{RoboFont → }/selected-glyphs/_anchors/clear-anchors.py
  38. 0  Scripts/{RoboFont → }/selected-glyphs/_anchors/rename-anchors.py
  39. +5 −12 Scripts/{RoboFont → }/selected-glyphs/_anchors/transfer-anchors.py
  40. 0  Scripts/{RoboFont → }/selected-glyphs/_color/clear-colors.py
  41. 0  Scripts/{RoboFont → }/selected-glyphs/_color/select-same-color.py
  42. 0  Scripts/{RoboFont → }/selected-glyphs/_encoding/auto-unicodes.py
  43. 0  Scripts/{RoboFont → }/selected-glyphs/_encoding/clear-unicodes.py
  44. +1 −3 Scripts/{RoboFont → }/selected-glyphs/_layers/copy-to-layer.py
  45. +3 −6 Scripts/{RoboFont → }/selected-glyphs/_layers/copy-to-mask.py
  46. 0  Scripts/{RoboFont → }/selected-glyphs/_metrics/copy-margins.py
  47. 0  Scripts/{RoboFont → }/selected-glyphs/_metrics/copy-widths.py
  48. 0  Scripts/{RoboFont → }/selected-glyphs/_metrics/set-margins.py
  49. 0  Scripts/{RoboFont → }/selected-glyphs/_metrics/set-width.py
  50. 0  Scripts/{RoboFont → }/selected-glyphs/_name/change-suffix.py
  51. 0  Scripts/{RoboFont → }/selected-glyphs/_name/print-glyph-names.py
  52. 0  Scripts/{RoboFont → }/selected-glyphs/_transform/gridfit.py
  53. 0  Scripts/{RoboFont → }/selected-glyphs/_transform/move.py
  54. 0  Scripts/{RoboFont → }/selected-glyphs/_transform/scale.py
  55. 0  Scripts/{RoboFont → }/selected-glyphs/_transform/skew.py
  56. 0  Scripts/{RoboFont → }/selected-glyphs/_transform/slide.py
  57. +7 −7 Scripts/{RoboFont → }/selected-glyphs/actions.py
  58. 0  Scripts/{RoboFont → }/selected-glyphs/delete.py
  59. 0  Scripts/{RoboFont/_hTools/_interpolate/interpolate-glyphs.py → selected-glyphs/interpolate.py}
  60. 0  Scripts/{RoboFont → }/selected-glyphs/mask.py
  61. 0  Scripts/{RoboFont → }/selected-points/nudge.py
View
2  Lib/hTools2/plugins/.gitignore
@@ -1 +1 @@
-[^.]*
+KLTF_WOFF.py
View
1  Lib/hTools2/plugins/__init__.py
@@ -0,0 +1 @@
+'''plugins'''
View
125 Lib/hTools2/plugins/colorsys.py
@@ -0,0 +1,125 @@
+# http://opensource.apple.com/source/python/python-3/python/Lib/colorsys.py
+
+"""Conversion functions between RGB and other color systems.
+
+This modules provides two functions for each color system ABC:
+
+ rgb_to_abc(r, g, b) --> a, b, c
+ abc_to_rgb(a, b, c) --> r, g, b
+
+All inputs and outputs are triples of floats in the range [0.0...1.0].
+Inputs outside this range may cause exceptions or invalid outputs.
+
+Supported color systems:
+RGB: Red, Green, Blue components
+YIQ: used by composite video signals
+HLS: Hue, Luminance, Saturation
+HSV: Hue, Saturation, Value
+"""
+# References:
+# XXX Where's the literature?
+
+__all__ = ["rgb_to_yiq","yiq_to_rgb","rgb_to_hls","hls_to_rgb",
+ "rgb_to_hsv","hsv_to_rgb"]
+
+# Some floating point constants
+
+ONE_THIRD = 1.0/3.0
+ONE_SIXTH = 1.0/6.0
+TWO_THIRD = 2.0/3.0
+
+
+# YIQ: used by composite video signals (linear combinations of RGB)
+# Y: perceived grey level (0.0 == black, 1.0 == white)
+# I, Q: color components
+
+def rgb_to_yiq(r, g, b):
+ y = 0.30*r + 0.59*g + 0.11*b
+ i = 0.60*r - 0.28*g - 0.32*b
+ q = 0.21*r - 0.52*g + 0.31*b
+ return (y, i, q)
+
+def yiq_to_rgb(y, i, q):
+ r = y + 0.948262*i + 0.624013*q
+ g = y - 0.276066*i - 0.639810*q
+ b = y - 1.105450*i + 1.729860*q
+ if r < 0.0: r = 0.0
+ if g < 0.0: g = 0.0
+ if b < 0.0: b = 0.0
+ if r > 1.0: r = 1.0
+ if g > 1.0: g = 1.0
+ if b > 1.0: b = 1.0
+ return (r, g, b)
+
+
+# HLS: Hue, Luminance, S???
+# H: position in the spectrum
+# L: ???
+# S: ???
+
+def rgb_to_hls(r, g, b):
+ maxc = max(r, g, b)
+ minc = min(r, g, b)
+ # XXX Can optimize (maxc+minc) and (maxc-minc)
+ l = (minc+maxc)/2.0
+ if minc == maxc: return 0.0, l, 0.0
+ if l <= 0.5: s = (maxc-minc) / (maxc+minc)
+ else: s = (maxc-minc) / (2.0-maxc-minc)
+ rc = (maxc-r) / (maxc-minc)
+ gc = (maxc-g) / (maxc-minc)
+ bc = (maxc-b) / (maxc-minc)
+ if r == maxc: h = bc-gc
+ elif g == maxc: h = 2.0+rc-bc
+ else: h = 4.0+gc-rc
+ h = (h/6.0) % 1.0
+ return h, l, s
+
+def hls_to_rgb(h, l, s):
+ if s == 0.0: return l, l, l
+ if l <= 0.5: m2 = l * (1.0+s)
+ else: m2 = l+s-(l*s)
+ m1 = 2.0*l - m2
+ return (_v(m1, m2, h+ONE_THIRD), _v(m1, m2, h), _v(m1, m2, h-ONE_THIRD))
+
+def _v(m1, m2, hue):
+ hue = hue % 1.0
+ if hue < ONE_SIXTH: return m1 + (m2-m1)*hue*6.0
+ if hue < 0.5: return m2
+ if hue < TWO_THIRD: return m1 + (m2-m1)*(TWO_THIRD-hue)*6.0
+ return m1
+
+
+# HSV: Hue, Saturation, Value(?)
+# H: position in the spectrum
+# S: ???
+# V: ???
+
+def rgb_to_hsv(r, g, b):
+ maxc = max(r, g, b)
+ minc = min(r, g, b)
+ v = maxc
+ if minc == maxc: return 0.0, 0.0, v
+ s = (maxc-minc) / maxc
+ rc = (maxc-r) / (maxc-minc)
+ gc = (maxc-g) / (maxc-minc)
+ bc = (maxc-b) / (maxc-minc)
+ if r == maxc: h = bc-gc
+ elif g == maxc: h = 2.0+rc-bc
+ else: h = 4.0+gc-rc
+ h = (h/6.0) % 1.0
+ return h, s, v
+
+def hsv_to_rgb(h, s, v):
+ if s == 0.0: return v, v, v
+ i = int(h*6.0) # XXX assume int() truncates!
+ f = (h*6.0) - i
+ p = v*(1.0 - s)
+ q = v*(1.0 - s*f)
+ t = v*(1.0 - s*(1.0-f))
+ if i%6 == 0: return v, t, p
+ if i == 1: return q, v, p
+ if i == 2: return p, v, t
+ if i == 3: return p, q, v
+ if i == 4: return t, p, v
+ if i == 5: return v, p, q
+ # Cannot get here
View
100 Lib/hTools2/plugins/nudge.py
@@ -0,0 +1,100 @@
+# Interpolated Nudge Original script by Christian Robertson of Betatype
+# http://betatype.com/node/18
+
+# RoboFont version by Travis Kochel of TK Type
+# http://www.tktype.com
+
+def getContourRange(cID, c):
+ start = c.bPoints[cID]
+ if c.GetContoursNumber() > cID:
+ end = len(g) - 1
+ else:
+ end = c.GetContourBegin(cID + 1) - 1
+ return start,end
+
+def getNextNode(nID, c):
+ numPoints = len(c.bPoints) - 1
+ if nID >= numPoints:
+ nID = 0
+ else: nID = nID + 1
+ return c.bPoints[nID]
+
+def getPrevNode(nID, c):
+ numPoints = len(c.bPoints) - 1
+ if nID <= 0:
+ nID = numPoints
+ else:
+ nID = nID - 1
+ return c.bPoints[nID]
+
+def interpolateNode(nindex, g, c, offset):
+ n = c.bPoints[nindex]
+ nn = getNextNode(nindex,c)
+ pn = getPrevNode(nindex,c)
+ # get change in x,y next and prev nodes
+ xDiffNn = abs(n.anchor[0] - nn.anchor[0])
+ yDiffNn = abs(n.anchor[1] - nn.anchor[1])
+ xDiffPn = abs(n.anchor[0] - pn.anchor[0])
+ yDiffPn = abs(n.anchor[1] - pn.anchor[1])
+ # get Ratio of BCP to x,y change next/prev node
+ if xDiffNn != 0:
+ xRatioNout = float(n.bcpOut[0]) / float(xDiffNn)
+ xRatioNn = float(nn.bcpIn[0]) / float(xDiffNn)
+ else:
+ xRatioNout = 0
+ xRatioNn = 0
+ if yDiffNn != 0:
+ yRatioNout = float(n.bcpOut[1]) / float(yDiffNn)
+ yRatioNn = float(nn.bcpIn[1]) / float(yDiffNn)
+ else:
+ yRatioNout = 0
+ yRatioNn = 0
+ if xDiffPn != 0:
+ xRatioNin = float(n.bcpIn[0]) / float(xDiffPn)
+ xRatioPn = float(pn.bcpOut[0]) / float(xDiffPn)
+ else:
+ xRatioNin = 0
+ xRatioPn = 0
+ if yDiffPn != 0:
+ yRatioNin = float(n.bcpIn[1]) / float(yDiffPn)
+ yRatioPn = float(pn.bcpOut[1]) / float(yDiffPn)
+ else:
+ yRatioNin = 0
+ yRatioPn = 0
+ # move the selected anchor
+ n.move(offset)
+ # get new diff
+ xDiffNnNew = abs(n.anchor[0] - nn.anchor[0])
+ yDiffNnNew = abs(n.anchor[1] - nn.anchor[1])
+ xDiffPnNew = abs(n.anchor[0] - pn.anchor[0])
+ yDiffPnNew = abs(n.anchor[1] - pn.anchor[1])
+ # find coordinates of new bcps based on ratio
+ if xDiffNnNew == 0:
+ xNoutNew = xRatioNout
+ xNnNew = xRatioNn
+ else:
+ xNoutNew = xRatioNout * xDiffNnNew
+ xNnNew = xRatioNn * xDiffNnNew
+ if yDiffNnNew == 0:
+ yNoutNew = yRatioNout
+ yNnNew = yRatioNn
+ else:
+ yNoutNew = yRatioNout * yDiffNnNew
+ yNnNew = yRatioNn * yDiffNnNew
+ if xDiffPnNew == 0:
+ xNinNew = xRatioNin
+ xPnNew = xRatioPn
+ else:
+ xNinNew = xRatioNin * xDiffPnNew
+ xPnNew = xRatioPn * xDiffPnNew
+ if yDiffPnNew == 0:
+ yNinNew = yRatioNin
+ yPnNew = yRatioPn
+ else:
+ yNinNew = yRatioNin * yDiffPnNew
+ yPnNew = yRatioPn * yDiffPnNew
+ # assign new bcp coordinates
+ n.bcpIn = (xNinNew, yNinNew)
+ n.bcpOut = (xNoutNew, yNoutNew)
+ nn.bcpIn = (xNnNew, yNnNew)
+ pn.bcpOut = (xPnNew, yPnNew)
View
13 Scripts/FontLab/selected-glyphs/get-glyphs-test.py
@@ -1,13 +0,0 @@
-#FLM: [h] get glyphs test
-
-from robofab.world import CurrentFont
-
-import hTools2.modules.fontutils
-reload(hTools2.modules.fontutils)
-
-from hTools2.modules.fontutils import getGlyphs
-
-f = CurrentFont()
-gNames = getGlyphs(f)
-
-print gNames
View
164 Scripts/FontLab/selected-glyphs/round-to-grid-dialog.py
@@ -1,164 +0,0 @@
-# [h] round to grid dialog
-
-'''shift all points above/below movable line'''
-
-from robofab.world import CurrentFont
-from dialogKit import *
-
-from hTools2.modules.fontutils import getGlyphs
-from hTools2.modules.color import *
-from hTools2.modules.glyphutils import roundPointsToGrid, roundAnchorsToGrid, roundMargins
-
-#------------
-# the dialog
-#------------
-
-class RoundToGridDialog(object):
-
- _points = True
- _anchors = True
- _sidebearings = True
- _mark = True
- _mark_color = randomColor()
- _gridsize = 30
- _height = 235
- _column_1 = 120
- _title = 'round to grid'
- _padding_top = 10
- _padding = 10
- _bWidth = 80
- _row_height = 30
- _bSpacing = 0
-
- def __init__(self, verbose=True):
- self._verbose = verbose
- self._width = self._column_1 + self._bWidth + (self._padding_top * 3)
- self.w = ModalDialog(
- (self._width,
- self._height),
- self._title,
- okCallback=self.okCallback)
- # grid size
- self.w.gridsize_label = TextBox(
- (self._padding,
- self._padding_top + (self._row_height * 0),
- self._column_1,
- self._row_height),
- "grid size:")
- self.w.gridsize_value = EditText(
- (self._column_1,
- self._padding_top + (self._row_height * 0),
- self._bWidth,
- self._row_height),
- self._gridsize,
- callback=self.gridsize_callback)
- # points
- self.w.points_checkbox = CheckBox(
- (self._padding,
- self._padding_top + (self._row_height * 1),
- -0,
- self._row_height),
- "points",
- callback=self.points_callback,
- value=self._points)
- # anchors
- self.w.anchors_checkbox = CheckBox(
- (self._padding,
- self._padding_top + (self._row_height * 2),
- -0,
- self._row_height),
- "anchors",
- callback=self.anchors_callback,
- value=self._anchors)
- # side-bearings
- self.w.sidebearings_checkbox = CheckBox(
- (self._padding,
- self._padding_top + (self._row_height * 3),
- -0,
- self._row_height),
- "side-bearings",
- callback=self.sidebearings_callback,
- value=self._sidebearings)
- # mark
- self.w.mark_checkbox = CheckBox(
- (self._padding,
- self._padding_top + (self._row_height * 4),
- -0,
- self._row_height),
- "mark",
- callback=self.mark_callback,
- value=True)
- # apply
- self.w.apply_button = Button(
- (self._padding,
- (2 * self._padding) + ((self._row_height) * 4),
- self._width - (2 * self._padding_top),
- self._row_height),
- 'apply',
- callback=self.apply_callback)
- # open window
- self.w.open()
-
- def gridsize_callback(self, sender):
- self._gridsize = sender.get()
-
- def points_callback(self, sender):
- self._points = sender.get()
-
- def anchors_callback(self, sender):
- self._anchors = sender.get()
-
- def sidebearings_callback(self, sender):
- self._sidebearings = sender.get()
-
- def mark_callback(self, sender):
- self._mark = sender.get()
-
- def apply_callback(self, sender):
- self.font = CurrentFont()
- if self.font is not None:
- gNames = getGlyphs(self.font)
- if len(gNames) > 0:
- # print info
- if self._verbose:
- print 'rounding glyphs to grid...\n'
- print '\tgrid size: %s' % self._gridsize
- print '\tpoints: %s' % self._points
- print '\tanchors: %s' % self._anchors
- print '\tside-bearings: %s' % self._sidebearings
- print '\tmark: %s' % self._mark
- print
- print '\t',
- # batch process glyphs
- for gName in gNames:
- print gName,
- if self._points:
- roundPointsToGrid(self.font[gName], (self._gridsize, self._gridsize))
- if self._anchors:
- roundAnchorsToGrid(self.font[gName], (self._gridsize, self._gridsize))
- if self._sidebearings:
- roundMargins(self.font[gName], self._gridsize, left=True, right=True)
- if self._mark:
- self.font[gName].mark = self._mark_color
- self.font[gName].update()
- # done
- print
- self.font.update()
- if self._verbose:
- print '\n...done.\n'
- # no glyphs selected
- else:
- print 'no glyph to process, please select one or more glyphs and try again.\n'
- # no font open
- else:
- print 'please open a font and try again.\n'
-
- def okCallback(self, sender):
- # print "...done.\n"
- pass
-
-#------
-# run!
-#------
-
-RoundToGridDialog(verbose=False)
View
151 Scripts/RoboFont/selected-glyphs/_layers/slide-layer.py
@@ -1,151 +0,0 @@
-# [h] slide layer dialog
-
-from vanilla import *
-
-from hTools2.modules.fontutils import get_full_name
-
-class slideLayerDialog(object):
-
- _title = "slide layer"
- _width = 280
- _height = 212
- _moveX = 0
- _moveY = 0
- _padding = 10
-
- def __init__(self):
- # get font & defaults
- self.font = CurrentFont()
- if self.font is not None:
-
- self.set_defaults_from_font_metrics()
- # get all fonts
- self.w = FloatingWindow(
- (self._width,
- self._height),
- self._title)
- self.w.box = Box(
- (self._padding,
- self._padding,
- -self._padding,
- 26))
- self.w.box.text = TextBox(
- (5,
- 1,
- -self._padding,
- 20),
- get_full_name(self.font),
- sizeStyle='small')
- # x slider
- self.w.x_label = TextBox(
- (self._padding,
- 50,
- -self._padding,
- 17),
- "slide x")
- self.w.x_slider = Slider(
- (70,
- 50,
- -15,
- 22),
- value = 0,
- maxValue=self._xMax,
- minValue=self._xMin,
- callback=self.slide_callback,
- sizeStyle='small')
- # y slider
- self.w.y_label = TextBox(
- (self._padding,
- 80,
- -self._padding,
- 17),
- "slide y")
- self.w.y_slider = Slider(
- (70,
- 80,
- -15,
- 22),
- value = 0,
- maxValue=self._yMax,
- minValue=self._yMin,
- callback=self.slide_callback,
- sizeStyle='small')
- # buttons
- self.w.button_restore = Button(
- (self._padding,
- -95,
- -self._padding,
- 20),
- "restore slider positions",
- callback=self.restore_callback,
- sizeStyle='small')
- self.w.button_update_font = Button(
- (self._padding,
- -65,
- -self._padding,
- 20),
- "switch to current font",
- callback=self.update_font_callback,
- sizeStyle='small')
- self.w.button_flip = Button(
- (self._padding,
- -35,
- -self._padding,
- 20),
- "flip foreground / mask",
- callback=self.flip_callback,
- sizeStyle='small')
- self.w.open()
- else:
- print 'No font selected, please open a font and try again.\n'
-
- def restore_move(self):
- self._moveX = 0
- self._moveY = 0
- self.w.x_slider.set(self._moveX)
- self.w.y_slider.set(self._moveY)
-
- def update_font(self):
- self.font = CurrentFont()
- self.w.box.text.set(get_full_name(self.font))
- self.set_defaults_from_font_metrics()
- self.restore_move()
-
- def set_defaults_from_font_metrics(self):
- self._xMax = self.font.info.unitsPerEm
- self._yMax = self.font.info.unitsPerEm / 2
- self._xMin = -self._xMax
- self._yMin = -self._yMax
-
- def update_font_callback(self, sender):
- self.update_font()
-
- def flip_callback(self, sender):
- _layer_name_1 = 'foreground'
- _layer_name_2 = 'mask'
- for gName in self.font.selection:
- self.font[gName].flipLayers(_layer_name_1, _layer_name_2)
-
- def slide_callback(self, sender):
- xValue = self.w.x_slider.get()
- yValue = self.w.y_slider.get()
- x = self._moveX - xValue
- y = self._moveY - yValue
- self._moveX = xValue
- self._moveY = yValue
- for gName in self.font.selection:
- try:
- self.font[gName].move((-x, -y))
- except:
- print 'cannot transform %s' % gName
-
- def restore_callback(self, sender):
- self.restore_move()
-
- def close_callback(self, sender):
- self.w.close()
-
-# run
-
-slideLayerDialog()
-
View
0  Scripts/RoboFont/_dev/.gitignore → Scripts/_dev/.gitignore
File renamed without changes
View
69 Scripts/RoboFont/_hTools/hFont/generate.py → Scripts/_hTools/hFont/generate.py
@@ -12,7 +12,7 @@
class generateFontDialog(object):
- _title = "generate"
+ _title = "hGenerate"
_padding = 10
_padding_top = 12
_box_height = 20
@@ -30,66 +30,83 @@ def __init__(self):
self.w = FloatingWindow(
(self._width, self._height),
self._title)
- p = self._padding
- pt = self._padding_top
- x = p
- y = pt
- bh1 = self._box_height
- bh2 = self._button_height
+ x = self._padding
+ y = self._padding_top
+ # test install
self.w._test_install = SquareButton(
- (x, y, -p, bh2),
+ (x, y,
+ -self._padding,
+ self._button_height),
"test install",
sizeStyle='small',
callback=self.test_install_callback)
- y += bh2 + pt
+ y += self._button_height + self._padding_top
self.w.line_1 = HorizontalLine((0, y, -0, 1))
- y += pt
+ y += self._padding_top
+ # generate otf
self.w.generate_otf = SquareButton(
- (x, y, -p, bh2),
+ (x, y,
+ -self._padding,
+ self._button_height),
"generate .otf",
sizeStyle="small",
callback=self.generate_otf_callback)
- y += bh2 + pt
+ y += self._button_height + self._padding_top
self.w._otfs_path = RadioGroup(
- (x - 3, y, -p, bh1),
+ (x - 3, y,
+ -self._padding,
+ self._box_height),
["otfs", "test"],
isVertical=False,
sizeStyle='small')
- y += bh1 + pt
+ y += self._box_height + self._padding_top
self.w._decompose = CheckBox(
- (x, y, -p, bh1),
+ (x, y,
+ -self._padding,
+ self._box_height),
"decompose",
value=self._decompose,
sizeStyle='small')
- y += bh1
+ y += self._box_height
self.w._remove_overlap = CheckBox(
- (x, y, -p, bh1),
+ (x, y,
+ -self._padding,
+ self._box_height),
"remove overlaps",
value=self._remove_overlap,
sizeStyle='small')
- y += bh1
+ y += self._box_height
self.w._autohint = CheckBox(
- (x, y, -p, bh1),
+ (x, y,
+ -self._padding,
+ self._box_height),
"ps autohint",
value=self._autohint,
sizeStyle='small')
- y += bh1
+ y += self._box_height
self.w._release_mode = CheckBox(
- (x, y, -p, bh1),
+ (x, y,
+ -self._padding,
+ self._box_height),
"release mode",
value=self._release_mode,
sizeStyle='small')
- y += bh1 + 7 # pt
+ y += self._box_height + 7
self.w.line_2 = HorizontalLine((0, y, -0, 1))
- y += pt
+ y += self._padding_top
+ # generate & upload woff
self.w._generate_woff = SquareButton(
- (x, y, -p, bh2),
+ (x, y,
+ -self._padding,
+ self._button_height),
"generate .woff",
sizeStyle='small',
callback=self.generate_woff_callback)
- y += bh2 + pt
+ y += self._button_height + self._padding_top
self.w._upload_woff = CheckBox(
- (x, y, -p, bh1),
+ (x, y,
+ -self._padding,
+ self._box_height),
"upload to ftp",
sizeStyle='small',
value=self._upload_woff)
View
2  Scripts/RoboFont/_hTools/hFont/groups.py → Scripts/_hTools/hFont/groups.py
@@ -16,7 +16,7 @@
class groupsDialog(object):
- _title = 'groups'
+ _title = 'hGroups'
_padding = 10
_padding_top = 10
_row_height = 23
View
2  Scripts/RoboFont/_hTools/hFont/guides.py → Scripts/_hTools/hFont/guides.py
@@ -19,7 +19,7 @@ def delete_guides(f):
class createGuidesDialog(object):
- _title = 'guides'
+ _title = 'hGuides'
_button_height = 20
_button_width = 90
_column_1 = 75
View
0  Scripts/RoboFont/_hTools/hFont/libs.py → Scripts/_hTools/hFont/libs.py
File renamed without changes
View
15 Scripts/RoboFont/_hTools/hFont/spacing.py → Scripts/_hTools/hFont/spacing.py
@@ -4,6 +4,7 @@
import hTools2.objects
import hTools2.modules.color
+import hTools2.modules.fontutils
reload(hTools2.objects)
reload(hTools2.modules.color)
@@ -16,7 +17,7 @@
class spacingGroupsDialog(object):
- _title = 'spacing'
+ _title = 'hSpacing'
_padding = 10
_padding_top = 10
_row_height = 23
@@ -41,8 +42,8 @@ def __init__(self):
"paint",
sizeStyle='small',
callback=self._apply_callback)
- # sides
y += self._button_height + self._padding_top
+ # sides
self.w._side = RadioGroup(
(x, y,
-self._padding,
@@ -50,12 +51,8 @@ def __init__(self):
["left", "right"],
isVertical=False,
sizeStyle='small')
- #---------
- # buttons
- #---------
y += self._row_height + self._padding_top
# import groups from project
- # y += self._button_height + self._padding_top
self.w._import_groups = SquareButton(
(x, y,
-self._padding,
@@ -64,6 +61,7 @@ def __init__(self):
sizeStyle='small',
callback=self._import_callback)
y += self._button_height - 1
+ # save groups to project
self.w._export_groups = SquareButton(
(x, y,
-self._padding,
@@ -71,12 +69,10 @@ def __init__(self):
"export",
sizeStyle='small',
callback=self._export_callback)
- # open
+ # open window
self.w.open()
- #-----------
# callbacks
- #-----------
def _apply_callback(self, sender):
font = hFont(CurrentFont())
@@ -101,4 +97,3 @@ def _export_callback(self, sender):
# run
spacingGroupsDialog()
-
View
0  Scripts/RoboFont/_hTools/hGlyph/build.py → Scripts/_hTools/hGlyph/build.py
File renamed without changes
View
0  Scripts/RoboFont/_hTools/hGlyph/import.py → Scripts/_hTools/hGlyph/import.py
File renamed without changes
View
3  Scripts/RoboFont/_hTools/hProject/batch-hProject.py → Scripts/_hTools/hProject/batch-hProject.py
@@ -20,6 +20,7 @@
class batchProjectDialog(object):
+ _title = "hProject"
_col1 = 140
_col2 = 180
_col3 = 80
@@ -48,7 +49,7 @@ def __init__(self):
self.w = FloatingWindow(
(self._width,
self._height),
- "batch hProject")
+ self._title)
#---------------
# projects list
#---------------
View
0  Scripts/RoboFont/_hTools/hWorld/check-folders.py → Scripts/_hTools/hWorld/check-folders.py
File renamed without changes
View
0  Scripts/RoboFont/_hTools/hWorld/edit-hSettings.py → Scripts/_hTools/hWorld/edit-hSettings.py
File renamed without changes
View
0  Scripts/RoboFont/_hTools/hWorld/make-folders.py → Scripts/_hTools/hWorld/make-folders.py
File renamed without changes
View
0  Scripts/RoboFont/all-fonts/actions.py → Scripts/all-fonts/actions.py
File renamed without changes
View
0  Scripts/RoboFont/all-fonts/close.py → Scripts/all-fonts/close.py
File renamed without changes
View
0  Scripts/RoboFont/all-fonts/generate-otfs.py → Scripts/all-fonts/generate-otfs.py
File renamed without changes
View
0  Scripts/RoboFont/batch-folder/batch-actions.py → Scripts/batch-folder/batch-actions.py
File renamed without changes
View
0  ...boFont/batch-folder/batch-generate-otfs-dialog.py → Scripts/batch-folder/batch-generate-otfs-dialog.py
File renamed without changes
View
0  ...RoboFont/batch-folder/batch-import-otfs-dialog.py → Scripts/batch-folder/batch-import-otfs-dialog.py
File renamed without changes
View
0  ...ts/RoboFont/current-font/_accent/mark-composed.py → Scripts/current-font/_accent/mark-composed.py
File renamed without changes
View
0  Scripts/RoboFont/current-font/_color/clear-colors.py → Scripts/current-font/_color/clear-colors.py
File renamed without changes
View
0  ...s/RoboFont/current-font/_color/delete-unmarked.py → Scripts/current-font/_color/delete-unmarked.py
File renamed without changes
View
0  Scripts/RoboFont/current-font/_color/paint-groups.py → Scripts/current-font/_color/paint-groups.py
File renamed without changes
View
0  ...ts/RoboFont/current-font/_glyphs/create-spaces.py → Scripts/current-font/_glyphs/create-spaces.py
File renamed without changes
View
0  ...ts/RoboFont/current-font/_glyphs/rename-glyphs.py → Scripts/current-font/_glyphs/rename-glyphs.py
File renamed without changes
View
0  ...ts/RoboFont/current-font/_groups/delete-groups.py → Scripts/current-font/_groups/delete-groups.py
File renamed without changes
View
0  ...pts/RoboFont/current-font/_groups/print-groups.py → Scripts/current-font/_groups/print-groups.py
File renamed without changes
View
0  ...pts/RoboFont/current-font/_layers/delete-layer.py → Scripts/current-font/_layers/delete-layer.py
File renamed without changes
View
0  ...s/RoboFont/current-font/_vmetrics/set-vmetrics.py → Scripts/current-font/_vmetrics/set-vmetrics.py
File renamed without changes
View
0  Scripts/RoboFont/current-font/print-info.py → Scripts/current-font/print-info.py
File renamed without changes
View
0  ...oboFont/selected-glyphs/_anchors/clear-anchors.py → Scripts/selected-glyphs/_anchors/clear-anchors.py
File renamed without changes
View
0  ...boFont/selected-glyphs/_anchors/rename-anchors.py → Scripts/selected-glyphs/_anchors/rename-anchors.py
File renamed without changes
View
17 ...Font/selected-glyphs/_anchors/transfer-anchors.py → Scripts/selected-glyphs/_anchors/transfer-anchors.py
@@ -1,12 +1,12 @@
# [h] transfer anchors dialog
from vanilla import *
-# from AppKit import NSColor
-from hTools2.modules.fontutils import get_full_name
-from hTools2.modules.anchors import transferAnchors
+import hTools2.modules.anchors
+reload(hTools2.modules.anchors)
-#from hTools2.modules.color import randomColor
+from hTools2.modules.fontutils import get_full_name
+from hTools2.modules.anchors import transfer_anchors
class transferAnchorsDialog(object):
@@ -83,10 +83,8 @@ def apply_callback(self, sender):
# get target font parameters
_target_font = self._all_fonts[self.w._target_value.get()]
# print info
- boolstring = [ False, True ]
print 'transfering anchors...\n'
print '\tsource font: %s' % get_full_name(_source_font)
- print
print '\ttarget font: %s' % get_full_name(_target_font)
print
print '\t',
@@ -97,7 +95,7 @@ def apply_callback(self, sender):
# prepare undo
_target_font[gName].prepareUndo('transfer anchors')
# transfer anchors
- transferAnchors(_source_font[gName], _target_font[gName])
+ transfer_anchors(_source_font[gName], _target_font[gName])
# update
_source_font[gName].update()
_target_font[gName].update()
@@ -112,11 +110,6 @@ def apply_callback(self, sender):
_source_font.update()
print '\n...done.\n'
- def close_callback(self, sender):
- self.w.close()
-
# run
transferAnchorsDialog()
-
-
View
0  ...s/RoboFont/selected-glyphs/_color/clear-colors.py → Scripts/selected-glyphs/_color/clear-colors.py
File renamed without changes
View
0  ...oFont/selected-glyphs/_color/select-same-color.py → Scripts/selected-glyphs/_color/select-same-color.py
File renamed without changes
View
0  ...boFont/selected-glyphs/_encoding/auto-unicodes.py → Scripts/selected-glyphs/_encoding/auto-unicodes.py
File renamed without changes
View
0  ...oFont/selected-glyphs/_encoding/clear-unicodes.py → Scripts/selected-glyphs/_encoding/clear-unicodes.py
File renamed without changes
View
4 ...RoboFont/selected-glyphs/_layers/copy-to-layer.py → Scripts/selected-glyphs/_layers/copy-to-layer.py
@@ -1,7 +1,5 @@
# [h] copy selected glyphs to layer dialog
-'''copy current layer of selected glyphs in current font to existing or new layer with given name'''
-
from vanilla import *
from AppKit import NSColor
@@ -26,7 +24,7 @@ class copyToLayerDialog(object):
_width = 123
_height = (_padding_top * 3) + (_line_height * 2) + _button_height + 5
- def __init__(self, ):
+ def __init__(self):
self.w = FloatingWindow(
(self._width,
self._height),
View
9 .../RoboFont/selected-glyphs/_layers/copy-to-mask.py → Scripts/selected-glyphs/_layers/copy-to-mask.py
@@ -1,9 +1,6 @@
# [h] transfer glyphs to mask
-'''copy current layer of selected glyphs in source font into "mask" layer in target font'''
-
from vanilla import *
-from AppKit import NSColor
import hTools2.modules.fontutils
reload(hTools2.modules.fontutils)
@@ -13,12 +10,12 @@
class copyToMaskDialog(object):
- _title = 'copy'
+ _title = 'mask'
_padding = 10
_padding_top = 8
_row_height = 25
_line_height = 20
- _button_height = 25
+ _button_height = 30
_column_1 = 103
_width = _column_1 + (_padding * 2)
_height = (_line_height * 2) + (_row_height * 2) + _button_height + (_padding_top * 4)
@@ -43,7 +40,7 @@ def __init__(self):
(x, y,
-self._padding,
self._line_height),
- "source",
+ "foreground",
sizeStyle='small')
y += self._line_height
self.w._source_value = PopUpButton(
View
0  ...RoboFont/selected-glyphs/_metrics/copy-margins.py → Scripts/selected-glyphs/_metrics/copy-margins.py
File renamed without changes
View
0  .../RoboFont/selected-glyphs/_metrics/copy-widths.py → Scripts/selected-glyphs/_metrics/copy-widths.py
File renamed without changes
View
0  .../RoboFont/selected-glyphs/_metrics/set-margins.py → Scripts/selected-glyphs/_metrics/set-margins.py
File renamed without changes
View
0  ...ts/RoboFont/selected-glyphs/_metrics/set-width.py → Scripts/selected-glyphs/_metrics/set-width.py
File renamed without changes
View
0  ...s/RoboFont/selected-glyphs/_name/change-suffix.py → Scripts/selected-glyphs/_name/change-suffix.py
File renamed without changes
View
0  ...boFont/selected-glyphs/_name/print-glyph-names.py → Scripts/selected-glyphs/_name/print-glyph-names.py
File renamed without changes
View
0  ...ts/RoboFont/selected-glyphs/_transform/gridfit.py → Scripts/selected-glyphs/_transform/gridfit.py
File renamed without changes
View
0  Scripts/RoboFont/selected-glyphs/_transform/move.py → Scripts/selected-glyphs/_transform/move.py
File renamed without changes
View
0  Scripts/RoboFont/selected-glyphs/_transform/scale.py → Scripts/selected-glyphs/_transform/scale.py
File renamed without changes
View
0  Scripts/RoboFont/selected-glyphs/_transform/skew.py → Scripts/selected-glyphs/_transform/skew.py
File renamed without changes
View
0  Scripts/RoboFont/selected-glyphs/_transform/slide.py → Scripts/selected-glyphs/_transform/slide.py
File renamed without changes
View
14 Scripts/RoboFont/selected-glyphs/actions.py → Scripts/selected-glyphs/actions.py
@@ -13,10 +13,10 @@ class transformSelectedGlyphsDialog(object):
_title = 'actions'
_row_height = 20
- _button_height = 25
+ _button_height = 30
_padding = 10
_padding_top = 8
- _width = 180
+ _width = 123
_height = (_padding_top * 3) + (_row_height * 7) + _button_height + 3
_gNames = []
@@ -50,7 +50,7 @@ def __init__(self):
(x, y,
-self._padding,
self._row_height),
- "round points to integers",
+ "round points",
callback=self.round_callback,
value=self._round,
sizeStyle='small')
@@ -70,7 +70,7 @@ def __init__(self):
(x, y,
-self._padding,
self._row_height),
- "auto contour order",
+ "auto order",
callback=self.order_callback,
value=self._order,
sizeStyle='small')
@@ -80,7 +80,7 @@ def __init__(self):
(x, y,
-self._padding,
self._row_height),
- "auto contour direction",
+ "auto direction",
callback=self.direction_callback,
value=self._direction,
sizeStyle='small')
@@ -90,7 +90,7 @@ def __init__(self):
(x, y,
-self._padding,
self._row_height),
- "remove overlaps",
+ "remove overlap",
callback=self.overlaps_callback,
value=self._overlaps,
sizeStyle='small')
@@ -100,7 +100,7 @@ def __init__(self):
(x, y,
-self._padding,
self._row_height),
- "add extreme points",
+ "add extremes",
callback=self.extremes_callback,
value=self._extremes,
sizeStyle='small')
View
0  Scripts/RoboFont/selected-glyphs/delete.py → Scripts/selected-glyphs/delete.py
File renamed without changes
View
0  ...boFont/_hTools/_interpolate/interpolate-glyphs.py → Scripts/selected-glyphs/interpolate.py
File renamed without changes
View
0  Scripts/RoboFont/selected-glyphs/mask.py → Scripts/selected-glyphs/mask.py
File renamed without changes
View
0  Scripts/RoboFont/selected-points/nudge.py → Scripts/selected-points/nudge.py
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.