//
//  GSFont+RenameGlyphs.h
//  GlyphsCore
//
//  Created by Georg Seifert on 27.12.23.
//  Copyright © 2023 schriftgestaltung.de. All rights reserved.
//

#import <GlyphsCore/GSFont.h>
#import <GlyphsCore/GSGlyph.h>

NS_ASSUME_NONNULL_BEGIN

@interface GSFont (RenameGlyphs)

/// this shows an dialog asking if it should update
- (void)updateRenamedGlyphs:(NSDictionary *)renamedGlyphs;

/// This returns a key for every part that needs updating, or an empty array if there are none.
- (NSArray *)needsUpdateRenamedGlyphs:(NSDictionary *)renamedGlyphs;

/// this does the actual updates
- (void)doUpdateRenamedGlyphs:(NSDictionary *)renamedGlyphs;

+ (BOOL)code:(NSString *)code containsGlyphName:(NSString *)glyphName;

@end

@interface GSGlyph (RenameGlyphs)

/// The glyph name used within Glyphs, with font references updated when it changes.
///
/// Use this property when references to the old glyph name in the font should be updated.
@property (strong) NSString *nameUpdate;

/// Assigns a glyph name and updates references to the old glyph name within the font.
///
/// - Parameter name: The glyph name.
/// - Parameter changeName: Whether glyph information may replace the supplied name with its standard glyph name.
- (void)setNameUpdate:(NSString *)name changeName:(BOOL)changeName;

@end

NS_ASSUME_NONNULL_END
