# `GSGlyph isValidNameString:allowSpaces:error:`

*Type Method*

Checks whether a string follows the glyph name syntax.

## Declaration

```swift
class func isValidNameString(_ name: String, allowSpaces: Bool) throws
```

```objc
+ (BOOL) isValidNameString:(NSString *) name allowSpaces:(BOOL) allowSpaces error:(NSError **) error;
```

```python
isValidNameString_allowSpaces_error_(name: str, allowSpaces: bool) -> tuple[bool, NSError]
```

## Parameters

- `name` — The proposed glyph name.
- `allowSpaces` — Whether spaces are permitted within the name.
- `error` — On failure, an error describing the invalid name.

## Return Value

`YES` if the method succeeded, otherwise `NO`.

## Discussion

This does not check for duplicate names within a font.

## See Also

### Glyph Name

- [`GSGlyph.name`](/Core/GlyphsCore/GSGlyph/name) — The glyph name used within Glyphs.
- [`GSGlyph setName:changeName:`](/Core/GlyphsCore/GSGlyph/setName:changeName:) — Assigns a glyph name and updates related glyph information.
- [`GSGlyph setName:changeName:update:validate:`](/Core/GlyphsCore/GSGlyph/setName:changeName:update:validate:) — Assigns a glyph name with control over related updates.
- [`GSGlyph setNameFast:`](/Core/GlyphsCore/GSGlyph/setNameFast:) — Assigns a glyph name without updating related state.
- [`GSGlyph setNameFastCache:`](/Core/GlyphsCore/GSGlyph/setNameFastCache:) — Assigns a glyph name and updates name lookup in the containing font.
- [`GSGlyph.nameUpdate`](/Core/GlyphsCore/GSGlyph/nameUpdate) — The glyph name used within Glyphs, with font references updated when it changes.
- [`GSGlyph setNameUpdate:changeName:`](/Core/GlyphsCore/GSGlyph/setNameUpdate:changeName:) — Assigns a glyph name and updates references to the old glyph name within the font.
- [`GSGlyph validateName:`](/Core/GlyphsCore/GSGlyph/validateName:) — Checks whether a glyph name can be assigned to the receiver.
- [`GSGlyph ensureValidName:`](/Core/GlyphsCore/GSGlyph/ensureValidName:) — Finds the standard glyph name corresponding to a nonstandard name.

