Skip to content

Commit

Permalink
WIP Split even more and start implementing the other direction
Browse files Browse the repository at this point in the history
  • Loading branch information
belluzj committed Oct 18, 2017
1 parent fb8a113 commit a33eb16
Show file tree
Hide file tree
Showing 8 changed files with 564 additions and 218 deletions.
7 changes: 6 additions & 1 deletion Lib/glyphsLib/builder/blue_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
unicode_literals)


def set_blue_values(ufo, alignment_zones):
def to_ufo_blue_values(_context, ufo, master):
"""Set postscript blue values from Glyphs alignment zones."""

alignment_zones = master.alignmentZones
blue_values = []
other_blues = []
for zone in sorted(alignment_zones):
Expand All @@ -29,3 +30,7 @@ def set_blue_values(ufo, alignment_zones):

ufo.info.postscriptBlueValues = blue_values
ufo.info.postscriptOtherBlues = other_blues


def to_glyphs_blue_values(context, ufo, master):
pass
10 changes: 9 additions & 1 deletion Lib/glyphsLib/builder/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@

from __future__ import (print_function, division, absolute_import,
unicode_literals)
import datetime

UFO_FORMAT = '%Y/%m/%d %H:%M:%S'


def to_ufo_time(datetime_obj):
"""Format a datetime object as specified for UFOs."""
return datetime_obj.strftime('%Y/%m/%d %H:%M:%S')
return datetime_obj.strftime(UFO_FORMAT)


def from_ufo_time(string):
"""Parses a datetime as specified for UFOs into a datetime object."""
return datetime.strptime(string, UFO_FORMAT)
2 changes: 2 additions & 0 deletions Lib/glyphsLib/builder/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,5 @@
850: 62,
437: 63,
}

REVERSE_CODEPAGE_RANGES = {value: key for key, value in CODEPAGE_RANGES}
Loading

0 comments on commit a33eb16

Please sign in to comment.