# `GSFont glyphNamesForWildcard:contextLabel:error:`

*Instance Method*

Returns the local glyph names matching a name query.

## Declaration

```swift
func glyphNames(forWildcard query: String, contextLabel: String) throws -> [String]
```

```objc
- (NSArray<NSString *> *) glyphNamesForWildcard:(NSString *) query contextLabel:(NSString *) contextLabel error:(NSError **) error;
```

```python
glyphNamesForWildcard_contextLabel_error_(query: str, contextLabel: str) -> tuple[list[str], NSError]
```

## Parameters

- `query` — The name query to evaluate.
- `contextLabel` — A description of the query’s source for use in errors.
- `error` — On output, a pointer to an error object that describes why the method failed, or `nil` if no error occurred. If you are not interested in the error information, pass `nil` for this parameter.

## Discussion

A query can be a literal glyph name, a name pattern containing `*`, a glyph property comparison such as `script=arabic`, a predicate token enclosed in braces, or a glyph class name prefixed with `@`.

## See Also

### Glyph Name Queries

- [`GSFont expandWildcardsInNameList:contextLabel:error:`](/Core/GlyphsCore/GSFont/expandWildcardsInNameList:contextLabel:error:) — Expands name queries into a set of local glyph names.
- [`GSFont baseName:forWildCard:`](/Core/GlyphsCore/GSFont/baseName:forWildCard:) — Returns the part of a matching glyph name represented by `*` in a name pattern, or `nil` when the pattern does not contain `*` or the glyph name is shorter than the pattern.
- [`GSFont prepareName2Glyph`](/Core/GlyphsCore/GSFont/prepareName2Glyph) — Rebuilds the cache that maps local glyph names to glyphs.

