|
| 1 | +/* Implementation of class GSFontAssetInstaller |
| 2 | + Copyright (C) 2024 Free Software Foundation, Inc. |
| 3 | +
|
| 4 | + By: Gregory John Casamento <greg.casamento@gmail.com> |
| 5 | + Date: September 5, 2025 |
| 6 | +
|
| 7 | + This file is part of the GNUstep Library. |
| 8 | +
|
| 9 | + This library is free software; you can redistribute it and/or |
| 10 | + modify it under the terms of the GNU Lesser General Public |
| 11 | + License as published by the Free Software Foundation; either |
| 12 | + version 2.1 of the License, or (at your option) any later version. |
| 13 | +
|
| 14 | + This library is distributed in the hope that it will be useful, |
| 15 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 | + Lesser General Public License for more details. |
| 18 | +
|
| 19 | + You should have received a copy of the GNU Lesser General Public |
| 20 | + License along with this library; if not, write to the Free |
| 21 | + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 22 | + Boston, MA 02110 USA. |
| 23 | +*/ |
| 24 | + |
| 25 | +#ifndef GSFONTASSETINSTALLER_H |
| 26 | +#define GSFONTASSETINSTALLER_H |
| 27 | + |
| 28 | +#import <Foundation/NSObject.h> |
| 29 | + |
| 30 | +@interface GSFontAssetInstaller : NSObject |
| 31 | + |
| 32 | ++ (GSFontAssetInstaller *) sharedFontInstaller; |
| 33 | ++ (void) setDefaultClass: (Class)cls; |
| 34 | + |
| 35 | +// abstract methods |
| 36 | + |
| 37 | +/** |
| 38 | + * Validates a downloaded font file. |
| 39 | + * This method can be overridden to implement custom validation |
| 40 | + * logic, such as checking font metadata, licensing information, |
| 41 | + * or performing security scans. The default implementation |
| 42 | + * checks file existence, size, and format signatures. |
| 43 | + */ |
| 44 | +- (BOOL) validateFontPath: (NSString *)fontPath error: (NSError **)error; |
| 45 | + |
| 46 | +/** |
| 47 | + * Installs a font file to the appropriate system location. |
| 48 | + * This method can be overridden to implement custom installation |
| 49 | + * strategies, such as using system APIs, registering with font |
| 50 | + * management services, or applying custom permissions. Returns |
| 51 | + * YES if installation was successful, NO otherwise. |
| 52 | + */ |
| 53 | +- (BOOL) installFontPath: (NSString *)fontPath error: (NSError **)error; |
| 54 | + |
| 55 | +/** |
| 56 | + * Returns the system fonts directory for the current platform. |
| 57 | + * This method can be overridden to customize the system font |
| 58 | + * installation location or to support additional platforms. |
| 59 | + */ |
| 60 | +- (NSString *) systemFontsDirectory; |
| 61 | + |
| 62 | +/** |
| 63 | + * Returns the user fonts directory for the current platform. |
| 64 | + * This method can be overridden to customize the user font |
| 65 | + * installation location or to support additional platforms. |
| 66 | + */ |
| 67 | +- (NSString *) userFontsDirectory; |
| 68 | + |
| 69 | +@end |
| 70 | + |
| 71 | +#endif |
0 commit comments