# Path: Lib/glyphsLib/builder/axes.py
# def font_uses_axis_locations(font):
#     # It's possible for fonts to have the 'Axes' parameter but to NOT specify
#     # the master locations using 'Axis Location', in which case we have to
#     # resort to using instances or other old tricks to get the mapping.
#     # https://github.com/googlefonts/glyphsLib/issues/409
#     # https://github.com/googlefonts/glyphsLib/issues/411
#     return font.axes and all(
#         master.customParameters["Axis Location"] for master in font.masters
#     )
# 
# def get_axis_definitions(font):
#     axesParameter = font.customParameters["Axes"]
#     if axesParameter is None:
#         return DEFAULT_AXES_DEFS
# 
#     factory = AxisDefinitionFactory()
#     return [factory.get(axis.get("Tag"), axis["Name"]) for axis in axesParameter]
# 
# Path: Lib/glyphsLib/builder/constants.py
# GLYPHS_PREFIX = "com.schriftgestaltung."
# 
# GLYPHLIB_PREFIX = GLYPHS_PREFIX + "Glyphs."
# 
# UFO_FILENAME_CUSTOM_PARAM = "UFO Filename"


import os
from .axes import font_uses_axis_locations, get_axis_definitions
from .constants import GLYPHS_PREFIX, GLYPHLIB_PREFIX, UFO_FILENAME_CUSTOM_PARAM
    ufo = source.font
    ufo.info.ascender = master.ascender
    ufo.info.capHeight = master.capHeight
    ufo.info.descender = master.descender
    ufo.info.xHeight = master.xHeight

    horizontal_stems = master.horizontalStems
    vertical_stems = master.verticalStems
    italic_angle = -master.italicAngle
    if horizontal_stems:
        ufo.info.postscriptStemSnapH = horizontal_stems
    if vertical_stems:
        ufo.info.postscriptStemSnapV = vertical_stems
    if italic_angle is not None:
        ufo.info.italicAngle = italic_angle

    year = master.userData[UFO_YEAR_KEY]
    if year is not None:
        ufo.info.year = year
    note = master.userData[UFO_NOTE_KEY]
    if note is not None:
        ufo.info.note = note

    # All of this will go into the designspace as well
    # "Native" designspace fonts will only have the designspace info
    # FIXME: (jany) maybe we should not duplicate the information and only
    # write it in the designspace?
    widthValue = master.widthValue
    weightValue = master.weightValue
    if weightValue is not None:

# Path: Lib/glyphsLib/builder/axes.py
# def font_uses_axis_locations(font):
#     # It's possible for fonts to have the 'Axes' parameter but to NOT specify
#     # the master locations using 'Axis Location', in which case we have to
#     # resort to using instances or other old tricks to get the mapping.
#     # https://github.com/googlefonts/glyphsLib/issues/409
#     # https://github.com/googlefonts/glyphsLib/issues/411
#     return font.axes and all(
#         master.customParameters["Axis Location"] for master in font.masters
#     )
# 
# def get_axis_definitions(font):
#     axesParameter = font.customParameters["Axes"]
#     if axesParameter is None:
#         return DEFAULT_AXES_DEFS
# 
#     factory = AxisDefinitionFactory()
#     return [factory.get(axis.get("Tag"), axis["Name"]) for axis in axesParameter]
# 
# Path: Lib/glyphsLib/builder/constants.py
# GLYPHS_PREFIX = "com.schriftgestaltung."
# 
# GLYPHLIB_PREFIX = GLYPHS_PREFIX + "Glyphs."
# 
# UFO_FILENAME_CUSTOM_PARAM = "UFO Filename"


# Path: Lib/glyphsLib/builder/masters.py
import os
from .axes import font_uses_axis_locations, get_axis_definitions
from .constants import GLYPHS_PREFIX, GLYPHLIB_PREFIX, UFO_FILENAME_CUSTOM_PARAM

    ufo = source.font
    ufo.info.ascender = master.ascender
    ufo.info.capHeight = master.capHeight
    ufo.info.descender = master.descender
    ufo.info.xHeight = master.xHeight

    horizontal_stems = master.horizontalStems
    vertical_stems = master.verticalStems
    italic_angle = -master.italicAngle
    if horizontal_stems:
        ufo.info.postscriptStemSnapH = horizontal_stems
    if vertical_stems:
        ufo.info.postscriptStemSnapV = vertical_stems
    if italic_angle is not None:
        ufo.info.italicAngle = italic_angle

    year = master.userData[UFO_YEAR_KEY]
    if year is not None:
        ufo.info.year = year
    note = master.userData[UFO_NOTE_KEY]
    if note is not None:
        ufo.info.note = note

    # All of this will go into the designspace as well
    # "Native" designspace fonts will only have the designspace info
    # FIXME: (jany) maybe we should not duplicate the information and only
    # write it in the designspace?
    widthValue = master.widthValue
    weightValue = master.weightValue
    if weightValue is not None:

        ufo.lib[GLYPHS_PREFIX + "weightValue"] = weightValue