def to_glyphs_glyph(self, ufo_glyph, ufo_layer, master):
<EOL>if ufo_glyph.name in self.font.glyphs:<EOL><INDENT>glyph = self.font.glyphs[ufo_glyph.name]<EOL><DEDENT>else:<EOL><INDENT>glyph = self.glyphs_module.GSGlyph(name=ufo_glyph.name)<EOL>self.font.glyphs.append(glyph)<EOL><DEDENT>if ufo_glyph.unicodes:<EOL><INDENT>glyph.unicodes = ["<STR_LIT>".format(c) for c in ufo_glyph.unicodes]<EOL><DEDENT>glyph.note = ufo_glyph.note or "<STR_LIT>"<EOL>if GLYPHLIB_PREFIX + "<STR_LIT>" in ufo_glyph.lib:<EOL><INDENT>last_change = ufo_glyph.lib[GLYPHLIB_PREFIX + "<STR_LIT>"]<EOL>glyph.lastChange = from_loose_ufo_time(last_change)<EOL><DEDENT>if ufo_glyph.markColor:<EOL><INDENT>glyph.color = _to_glyphs_color(ufo_glyph.markColor)<EOL><DEDENT>if GLYPHLIB_PREFIX + "<STR_LIT>" in ufo_glyph.lib:<EOL><INDENT>glyph.export = ufo_glyph.lib[GLYPHLIB_PREFIX + "<STR_LIT>"]<EOL><DEDENT>if ufo_glyph.name in self.designspace.lib.get("<STR_LIT>", []):<EOL><INDENT>glyph.export = False<EOL><DEDENT>ps_names_key = PUBLIC_PREFIX + "<STR_LIT>"<EOL>if (<EOL>ps_names_key in ufo_glyph.font.lib<EOL>and ufo_glyph.name in ufo_glyph.font.lib[ps_names_key]<EOL>):<EOL><INDENT>glyph.production = ufo_glyph.font.lib[ps_names_key][ufo_glyph.name]<EOL><DEDENT>glyphinfo = glyphsLib.glyphdata.get_glyph(ufo_glyph.name)<EOL>layer = self.to_glyphs_layer(ufo_layer, glyph, master)<EOL>for key in ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>for prefix, glyphs_object in (<EOL>("<STR_LIT>", glyph),<EOL>("<STR_LIT>", layer),<EOL>("<STR_LIT>", layer),<EOL>):<EOL><INDENT>full_key = GLYPHLIB_PREFIX + prefix + key<EOL>if full_key in ufo_glyph.lib:<EOL><INDENT>value = ufo_glyph.lib[full_key]<EOL>setattr(glyphs_object, key, value)<EOL><DEDENT><DEDENT><DEDENT>if SCRIPT_LIB_KEY in ufo_glyph.lib:<EOL><INDENT>glyph.script = ufo_glyph.lib[SCRIPT_LIB_KEY]<EOL><DEDENT>if GLYPHLIB_PREFIX + "<STR_LIT>" in ufo_glyph.lib:<EOL><INDENT>category = ufo_glyph.lib[GLYPHLIB_PREFIX + "<STR_LIT>"]<EOL>glyph.category = category<EOL><DEDENT>else:<EOL><INDENT>category = glyphinfo.category<EOL><DEDENT>if GLYPHLIB_PREFIX + "<STR_LIT>" in ufo_glyph.lib:<EOL><INDENT>sub_category = ufo_glyph.lib[GLYPHLIB_PREFIX + "<STR_LIT>"]<EOL>glyph.subCategory = sub_category<EOL><DEDENT>else:<EOL><INDENT>sub_category = glyphinfo.subCategory<EOL><DEDENT>if hasattr(layer, "<STR_LIT>"):<EOL><INDENT>if ufo_glyph.width:<EOL><INDENT>layer.userData[BACKGROUND_WIDTH_KEY] = ufo_glyph.width<EOL><DEDENT><DEDENT>else:<EOL><INDENT>layer.width = ufo_glyph.width<EOL><DEDENT>if category == "<STR_LIT>" and sub_category == "<STR_LIT>" and layer.width == <NUM_LIT:0>:<EOL><INDENT>if ORIGINAL_WIDTH_KEY in ufo_glyph.lib:<EOL><INDENT>layer.width = ufo_glyph.lib[ORIGINAL_WIDTH_KEY]<EOL><DEDENT><DEDENT>self.to_glyphs_background_image(ufo_glyph, layer)<EOL>self.to_glyphs_guidelines(ufo_glyph, layer)<EOL>self.to_glyphs_annotations(ufo_glyph, layer)<EOL>self.to_glyphs_hints(ufo_glyph, layer)<EOL>self.to_glyphs_glyph_user_data(ufo_glyph.font, glyph)<EOL>self.to_glyphs_layer_user_data(ufo_glyph, layer)<EOL>self.to_glyphs_smart_component_axes(ufo_glyph, glyph)<EOL>self.to_glyphs_paths(ufo_glyph, layer)<EOL>self.to_glyphs_components(ufo_glyph, layer)<EOL>self.to_glyphs_glyph_anchors(ufo_glyph, layer)<EOL>
Add UFO glif metadata, paths, components, and anchors to a GSGlyph.
    If the matching GSGlyph does not exist, then it is created,
    else it is updated with the new data.
    In all cases, a matching GSLayer is created in the GSGlyph to hold paths.