# `GSFont copyLayersFrom:sourceFontMasterID:targetFontMasterID:`

*Instance Method*

Copies layers associated with one master identifier to another master identifier.

## Declaration

```swift
func copyLayers(from otherFont: GSFont, sourceFontMasterID: String, targetFontMasterID: String)
```

```objc
- (void) copyLayersFrom:(GSFont *) otherFont sourceFontMasterID:(NSString *) sourceFontMasterID targetFontMasterID:(NSString *) targetFontMasterID;
```

```python
copyLayersFrom_sourceFontMasterID_targetFontMasterID_(otherFont: GSFont, sourceFontMasterID: str, targetFontMasterID: str)
```

## Discussion

The copied layers are added to matching glyphs by glyph name.

## See Also

### Master Content

- [`GSFont addFontMasterAndContent:`](/Core/GlyphsCore/GSFont/addFontMasterAndContent:) — Adds a local master and copies the content associated with it into the font.
- [`GSFont insertFontMasterAndContent:atIndex:`](/Core/GlyphsCore/GSFont/insertFontMasterAndContent:atIndex:) — Inserts a local master and copies the content associated with it into the font.
- [`GSFont removeFontMasterAndContent:`](/Core/GlyphsCore/GSFont/removeFontMasterAndContent:) — Removes a local master and the layer content associated with it.
- [`GSFont replaceFontMasterAtIndex:withFontMaster:`](/Core/GlyphsCore/GSFont/replaceFontMasterAtIndex:withFontMaster:) — Replaces a local master at an index without changing layer content.
- [`GSFont copyGlyphs:sourceFontMasterID:targetFontMasterID:addMissing:`](/Core/GlyphsCore/GSFont/copyGlyphs:sourceFontMasterID:targetFontMasterID:addMissing:) — Copies glyph layers associated with one master identifier to another master identifier.
- [`GSFont copyInfoFrom:sourceFontMasterID:targetFontMasterID:`](/Core/GlyphsCore/GSFont/copyInfoFrom:sourceFontMasterID:targetFontMasterID:) — Copies master-specific font information from one master identifier to another master identifier.
- [`GSFont addFontAsNewMaster:`](/Core/GlyphsCore/GSFont/addFontAsNewMaster:) — Adds a master from another font as a new local master.
- [`GSFont addMasterFromInstance:error:`](/Core/GlyphsCore/GSFont/addMasterFromInstance:error:) — Adds the generated contents of an instance as a new local master.

