def from_layer(cls, font, layerName=None, copy=False, skipExportGlyphs=None):
        if layerName is not None:
            layer = font.layers[layerName]
        else:
            layer = font.layers.defaultLayer
        if copy:
            self = _copyLayer(layer, obj_type=cls)
            self.lib = deepcopy(layer.lib)
        else:
            self = cls((g.name, g) for g in layer)
            self.lib = layer.lib
        if skipExportGlyphs:
            for glyph in self.values():
                if any(c.baseGlyph in skipExportGlyphs for c in glyph.components):
                    deepCopyContours(self, glyph, glyph, Transform(), skipExportGlyphs)
                    if hasattr(glyph, "removeComponent"):
                        for c in [
                            component
                            for component in glyph.components
                            if component.baseGlyph in skipExportGlyphs
                        ]:
                            glyph.removeComponent(c)
                    else:
                        glyph.components[:] = [
                            c
                            for c in glyph.components
                            if c.baseGlyph not in skipExportGlyphs
                        ]
            for glyph_name in skipExportGlyphs:
                if glyph_name in self:
                    del self[glyph_name]
        self.name = layer.name if layerName is not None else None
        return self